Changeset 221014 in webkit


Ignore:
Timestamp:
Aug 22, 2017 8:56:32 AM (7 years ago)
Author:
mrajca@apple.com
Message:

Call updateIsPlayingMedia whenever m_userHasInteractedWithMediaElement changes
https://bugs.webkit.org/show_bug.cgi?id=175796

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-user-gesture-tracking.html

The page media state depends on m_userHasInteractedWithMediaElement, so force it to update
as soon as m_userHasInteractedWithMediaElement changes. This fixes an issue where the media
state would not reflect the user interaction flag until a call to updateIsPlayingMedia was made.

  • dom/Document.cpp:

(WebCore::Document::noteUserInteractionWithMediaElement):

  • dom/Document.h:

(WebCore::Document::noteUserInteractionWithMediaElement): Deleted.

  • testing/Internals.cpp:

(WebCore::Internals::pageMediaState):

LayoutTests:

Skip the test on iOS like all the other tests that use runWithKeyDown.

  • media/video-user-gesture-tracking-expected.txt: Added.
  • media/video-user-gesture-tracking.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r220996 r221014  
     12017-08-21  Matt Rajca  <mrajca@apple.com>
     2
     3        Call updateIsPlayingMedia whenever m_userHasInteractedWithMediaElement changes
     4        https://bugs.webkit.org/show_bug.cgi?id=175796
     5
     6        Reviewed by Eric Carlson.
     7
     8        Skip the test on iOS like all the other tests that use runWithKeyDown.
     9
     10        * media/video-user-gesture-tracking-expected.txt: Added.
     11        * media/video-user-gesture-tracking.html: Added.
     12
    1132017-08-21  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/platform/ios/TestExpectations

    r220912 r221014  
    25712571media/video-playsinline.html
    25722572media/video-remote-control-playpause.html
     2573media/video-user-gesture-tracking.html
    25732574media/video-volume-slider-drag.html
    25742575media/video-webkit-playsinline.html
  • trunk/Source/WebCore/ChangeLog

    r221008 r221014  
     12017-08-21  Matt Rajca  <mrajca@apple.com>
     2
     3        Call updateIsPlayingMedia whenever m_userHasInteractedWithMediaElement changes
     4        https://bugs.webkit.org/show_bug.cgi?id=175796
     5
     6        Reviewed by Eric Carlson.
     7
     8        Test: media/video-user-gesture-tracking.html
     9
     10        The page media state depends on m_userHasInteractedWithMediaElement, so force it to update
     11        as soon as m_userHasInteractedWithMediaElement changes. This fixes an issue where the media
     12        state would not reflect the user interaction flag until a call to updateIsPlayingMedia was made.
     13
     14        * dom/Document.cpp:
     15        (WebCore::Document::noteUserInteractionWithMediaElement):
     16        * dom/Document.h:
     17        (WebCore::Document::noteUserInteractionWithMediaElement): Deleted.
     18        * testing/Internals.cpp:
     19        (WebCore::Internals::pageMediaState):
     20
    1212017-08-22  Zan Dobersek  <zdobersek@igalia.com>
    222
  • trunk/Source/WebCore/dom/Document.cpp

    r220857 r221014  
    36073607}
    36083608
     3609void Document::noteUserInteractionWithMediaElement()
     3610{
     3611    if (m_userHasInteractedWithMediaElement)
     3612        return;
     3613
     3614    m_userHasInteractedWithMediaElement = true;
     3615    updateIsPlayingMedia();
     3616}
     3617
    36093618void Document::updateIsPlayingMedia(uint64_t sourceElementID)
    36103619{
  • trunk/Source/WebCore/dom/Document.h

    r220957 r221014  
    12741274    WEBCORE_EXPORT void removeAudioProducer(MediaProducer*);
    12751275    MediaProducer::MediaStateFlags mediaState() const { return m_mediaState; }
    1276     void noteUserInteractionWithMediaElement() { m_userHasInteractedWithMediaElement = true; }
     1276    void noteUserInteractionWithMediaElement();
    12771277    bool isCapturing() const { return MediaProducer::isCapturing(m_mediaState); }
    12781278    WEBCORE_EXPORT void updateIsPlayingMedia(uint64_t = HTMLMediaElementInvalidID);
  • trunk/Source/WebCore/testing/Internals.cpp

    r220734 r221014  
    35823582    if (state & MediaProducer::HasMutedVideoCaptureDevice)
    35833583        string.append("HasMutedVideoCaptureDevice,");
     3584    if (state & MediaProducer::HasUserInteractedWithMediaElement)
     3585        string.append("HasUserInteractedWithMediaElement,");
    35843586
    35853587    if (string.isEmpty())
Note: See TracChangeset for help on using the changeset viewer.