Changeset 289108 in webkit


Ignore:
Timestamp:
Feb 4, 2022 3:58:52 AM (6 months ago)
Author:
svillar@igalia.com
Message:

HTMLMediaElement should dispatch the resize event asynchronously
https://bugs.webkit.org/show_bug.cgi?id=230895

Reviewed by Darin Adler.

Source/WebCore:

The HTMLMediaElement is currently queueing a task to dispatch the resize event in the post layout phase.
There is no need to run it synchronously and we could move it to another queue were it will be run
asynchronously as it was done for other similar tasks in the past.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::layoutSizeChanged):

LayoutTests:

  • media/modern-media-controls/media-controller/media-controller-resize.html: Remove the event

listener to avoid an extra notification.

  • platform/mac/TestExpectations: Unskipped tests that pass now.
  • platform/wincairo/TestExpectations: Ditto.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r289101 r289108  
     12022-02-04  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        HTMLMediaElement should dispatch the resize event asynchronously
     4        https://bugs.webkit.org/show_bug.cgi?id=230895
     5
     6        Reviewed by Darin Adler.
     7
     8        * media/modern-media-controls/media-controller/media-controller-resize.html: Remove the event
     9        listener to avoid an extra notification.
     10        * platform/mac/TestExpectations: Unskipped tests that pass now.
     11        * platform/wincairo/TestExpectations: Ditto.
     12
    1132022-02-03  Myles C. Maxfield  <mmaxfield@apple.com>
    214
  • trunk/LayoutTests/media/modern-media-controls/media-controller/media-controller-resize.html

    r214282 r289108  
    1717shouldBeEqualToString("mediaControls.style.height", "240px");
    1818
    19 shadowRoot.addEventListener("resize", () => {
     19function testResize() {
    2020    shouldBeEqualToString("mediaControls.style.width", "400px");
    2121    shouldBeEqualToString("mediaControls.style.height", "300px");
     22    shadowRoot.removeEventListener("resize", testResize);
    2223    setTimeout(() => {
    2324        debug("");
     
    2526        finishJSTest();
    2627    });
    27 });
     28}
     29
     30shadowRoot.addEventListener("resize", testResize);
    2831
    2932debug("");
  • trunk/LayoutTests/platform/mac/TestExpectations

    r288728 r289108  
    20832083[ Mojave Catalina ] imported/w3c/web-platform-tests/css/css-counter-styles/lower-armenian/css3-counter-styles-112.html [ ImageOnlyFailure ]
    20842084
    2085 webkit.org/b/222185 media/media-extension-with-fragment.html [ Crash ]
    2086 
    20872085webkit.org/b/222205 css3/calc/transforms-translate.html [ Pass ImageOnlyFailure ]
    20882086
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r288671 r289108  
    242242media/track/in-band/track-in-band-srt-mkv-track-order.html [ Skip ]
    243243media/invalid-media-url-crash.html [ Skip ]
    244 media/media-extension-with-fragment.html [ Skip ]
    245244
    246245# VIDEO_PRESENTATION_MODE is disabled
  • trunk/Source/WebCore/ChangeLog

    r289107 r289108  
     12022-02-04  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        HTMLMediaElement should dispatch the resize event asynchronously
     4        https://bugs.webkit.org/show_bug.cgi?id=230895
     5
     6        Reviewed by Darin Adler.
     7
     8        The HTMLMediaElement is currently queueing a task to dispatch the resize event in the post layout phase.
     9        There is no need to run it synchronously and we could move it to another queue were it will be run
     10        asynchronously as it was done for other similar tasks in the past.
     11
     12        * html/HTMLMediaElement.cpp:
     13        (WebCore::HTMLMediaElement::layoutSizeChanged):
     14
    1152022-02-04  Pablo Saavedra  <psaavedra@igalia.com>
    216
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r288793 r289108  
    46554655void HTMLMediaElement::layoutSizeChanged()
    46564656{
    4657     if (RefPtr frameView = document().view()) {
    4658         auto task = [this, protectedThis = Ref { *this }] {
    4659             if (auto root = userAgentShadowRoot())
    4660                 root->dispatchEvent(Event::create("resize", Event::CanBubble::No, Event::IsCancelable::No));
    4661         };
    4662         frameView->queuePostLayoutCallback(WTFMove(task));
    4663     }
     4657    auto task = [this] {
     4658        if (auto root = userAgentShadowRoot())
     4659            root->dispatchEvent(Event::create("resize", Event::CanBubble::No, Event::IsCancelable::No));
     4660    };
     4661    queueTaskKeepingObjectAlive(*this, TaskSource::MediaElement, WTFMove(task));
    46644662
    46654663    if (!m_receivedLayoutSizeChanged) {
Note: See TracChangeset for help on using the changeset viewer.