⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267724 in webkit


Ignore:
Timestamp:
Sep 28, 2020, 9:10:11 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

webkitfullscreenchange does not fire for shadow DOM elements
https://bugs.webkit.org/show_bug.cgi?id=216607

Patch by Tetsuharu Ohzeki <Tetsuharu Ohzeki> on 2020-09-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

This bug was caused by the webkitfullscreenchange event being fired
but without _composed_ flag set.

This patch fixed the bug by making it composed as defined as
the step 3-2 of https://fullscreen.spec.whatwg.org/#run-the-fullscreen-steps.
so that event listeners outside shadow tree could observe it.

Test: fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html

  • dom/FullscreenManager.cpp:

(WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):

LayoutTests:

Added a regression test for making an element inside a shadow tree full screen,
and listening to webkitfullscreenchange outside the shadow tree.

  • fast/shadow-dom/fullscreen-in-shadow-event-should-propagate-expected.txt: Added.
  • fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html: Added.
  • platform/ios-wk2/TestExpectations:

Other testcases related to fullscreen API in fast/shadow-dom/ are also
disabled for ios-wk2.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r267723 r267724  
     12020-09-28  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
     2
     3        webkitfullscreenchange does not fire for shadow DOM elements
     4        https://bugs.webkit.org/show_bug.cgi?id=216607
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added a regression test for making an element inside a shadow tree full screen,
     9        and listening to `webkitfullscreenchange` outside the shadow tree.
     10
     11        * fast/shadow-dom/fullscreen-in-shadow-event-should-propagate-expected.txt: Added.
     12        * fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html: Added.
     13        * platform/ios-wk2/TestExpectations:
     14        Other testcases related to fullscreen API in fast/shadow-dom/ are also
     15        disabled for ios-wk2.
     16
    1172020-09-28  Devin Rousso  <drousso@apple.com>
    218
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r267168 r267724  
    10181018fast/dom/Window/post-message-user-action.html [ Skip ]
    10191019fast/images/image-usemap-parsing.html [ Skip ]
     1020fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html [ Skip ]
    10201021fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html [ Skip ]
    10211022fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r267713 r267724  
     12020-09-28  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
     2
     3        webkitfullscreenchange does not fire for shadow DOM elements
     4        https://bugs.webkit.org/show_bug.cgi?id=216607
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This bug was caused by the `webkitfullscreenchange` event being fired
     9        but without _composed_ flag set.
     10
     11        This patch fixed the bug by making it composed as defined as
     12        the step 3-2 of https://fullscreen.spec.whatwg.org/#run-the-fullscreen-steps.
     13        so that event listeners outside shadow tree could observe it.
     14
     15        Test: fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html
     16
     17        * dom/FullscreenManager.cpp:
     18        (WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):
     19
    1202020-09-28  Eric Carlson  <eric.carlson@apple.com>
    221
  • trunk/Source/WebCore/dom/FullscreenManager.cpp

    r265357 r267724  
    483483void FullscreenManager::dispatchFullscreenChangeOrErrorEvent(Deque<RefPtr<Node>>& queue, const AtomString& eventName, bool shouldNotifyMediaElement)
    484484{
     485    // Step 3 of https://fullscreen.spec.whatwg.org/#run-the-fullscreen-steps
    485486    while (!queue.isEmpty()) {
    486487        RefPtr<Node> node = queue.takeFirst();
     
    502503        UNUSED_PARAM(shouldNotifyMediaElement);
    503504#endif
    504         node->dispatchEvent(Event::create(eventName, Event::CanBubble::Yes, Event::IsCancelable::No));
     505        node->dispatchEvent(Event::create(eventName, Event::CanBubble::Yes, Event::IsCancelable::No, Event::IsComposed::Yes));
    505506    }
    506507}
Note: See TracChangeset for help on using the changeset viewer.