Changeset 251567 in webkit


Ignore:
Timestamp:
Oct 24, 2019 3:40:07 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

Unreviewed, rolling out r251269, r251294, and r251328.
https://bugs.webkit.org/show_bug.cgi?id=203384

Probably made many animation tests flaky (Requested by rniwa
on #webkit).

Reverted changesets:

"Integrate resize event with HTML5 event loop"
https://bugs.webkit.org/show_bug.cgi?id=202964
https://trac.webkit.org/changeset/251269

"Flaky Test: fast/events/resize-subframe-in-rendering-
update.html"
https://bugs.webkit.org/show_bug.cgi?id=203140
https://trac.webkit.org/changeset/251294

"Flaky Test: fast/events/resize-subframe-in-rendering-
update.html"
https://bugs.webkit.org/show_bug.cgi?id=203140
https://trac.webkit.org/changeset/251328

Patch by Commit Queue <commit-queue@webkit.org> on 2019-10-24

Location:
trunk
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251565 r251567  
     12019-10-24  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r251269, r251294, and r251328.
     4        https://bugs.webkit.org/show_bug.cgi?id=203384
     5
     6        Probably made many animation tests flaky (Requested by rniwa
     7        on #webkit).
     8
     9        Reverted changesets:
     10
     11        "Integrate resize event with HTML5 event loop"
     12        https://bugs.webkit.org/show_bug.cgi?id=202964
     13        https://trac.webkit.org/changeset/251269
     14
     15        "Flaky Test: fast/events/resize-subframe-in-rendering-
     16        update.html"
     17        https://bugs.webkit.org/show_bug.cgi?id=203140
     18        https://trac.webkit.org/changeset/251294
     19
     20        "Flaky Test: fast/events/resize-subframe-in-rendering-
     21        update.html"
     22        https://bugs.webkit.org/show_bug.cgi?id=203140
     23        https://trac.webkit.org/changeset/251328
     24
    1252019-10-24  Sihui Liu  <sihui_liu@apple.com>
    226
  • trunk/LayoutTests/fast/shadow-dom/trusted-event-scoped-flags.html

    r251269 r251567  
    111111
    112112    iframe.onload = function () {
    113         requestAnimationFrame(function () {
     113        iframe.contentDocument.body.getBoundingClientRect();
     114        log(iframe.contentWindow, "resize");
     115        setTimeout(function () {
     116            iframe.style.width = '200px';
     117            iframe.style.height = '200px';
     118            iframe.contentDocument.body.getBoundingClientRect();
    114119            setTimeout(function () {
    115                 iframe.contentDocument.body.getBoundingClientRect();
    116                 log(iframe.contentWindow, "resize");
    117                 iframe.style.width = '200px';
    118                 iframe.style.height = '200px';
    119                 iframe.contentDocument.body.getBoundingClientRect();
    120                 requestAnimationFrame(function () {
    121                     checkFlags('', {eventType: 'resize', composed: false});
    122                     finishJSTest();
    123                 });
     120                checkFlags('', {eventType: 'resize', composed: false});
     121                finishJSTest();
    124122            }, 0);
    125         });
     123        }, 0);
    126124    }
    127125
  • trunk/Source/WebCore/ChangeLog

    r251558 r251567  
     12019-10-24  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r251269, r251294, and r251328.
     4        https://bugs.webkit.org/show_bug.cgi?id=203384
     5
     6        Probably made many animation tests flaky (Requested by rniwa
     7        on #webkit).
     8
     9        Reverted changesets:
     10
     11        "Integrate resize event with HTML5 event loop"
     12        https://bugs.webkit.org/show_bug.cgi?id=202964
     13        https://trac.webkit.org/changeset/251269
     14
     15        "Flaky Test: fast/events/resize-subframe-in-rendering-
     16        update.html"
     17        https://bugs.webkit.org/show_bug.cgi?id=203140
     18        https://trac.webkit.org/changeset/251294
     19
     20        "Flaky Test: fast/events/resize-subframe-in-rendering-
     21        update.html"
     22        https://bugs.webkit.org/show_bug.cgi?id=203140
     23        https://trac.webkit.org/changeset/251328
     24
    1252019-10-23  Ryosuke Niwa  <rniwa@webkit.org>
    226
  • trunk/Source/WebCore/dom/Document.cpp

    r251558 r251567  
    224224#include "VisibilityChangeClient.h"
    225225#include "VisitedLinkState.h"
    226 #include "VisualViewport.h"
    227226#include "WebAnimation.h"
    228227#include "WheelEvent.h"
     
    39673966}
    39683967
    3969 void Document::setNeedsDOMWindowResizeEvent()
    3970 {
    3971     m_needsDOMWindowResizeEvent = true;
    3972     scheduleTimedRenderingUpdate();
    3973 }
    3974 
    3975 void Document::setNeedsVisualViewportResize()
    3976 {
    3977     m_needsVisualViewportResizeEvent = true;
    3978     scheduleTimedRenderingUpdate();
    3979 }
    3980 
    3981 // https://drafts.csswg.org/cssom-view/#run-the-resize-steps
    3982 void Document::runResizeSteps()
    3983 {
    3984     // FIXME: The order of dispatching is not specified: https://github.com/WICG/visual-viewport/issues/65.
    3985     if (m_needsDOMWindowResizeEvent) {
    3986         LOG(Events, "Document %p sending resize events to window", this);
    3987         m_needsDOMWindowResizeEvent = false;
    3988         dispatchWindowEvent(Event::create(eventNames().resizeEvent, Event::CanBubble::No, Event::IsCancelable::No));
    3989     }
    3990     if (m_needsVisualViewportResizeEvent) {
    3991         LOG(Events, "Document %p sending resize events to visualViewport", this);
    3992         m_needsVisualViewportResizeEvent = false;
    3993         if (auto* window = domWindow())
    3994             window->visualViewport().dispatchEvent(Event::create(eventNames().resizeEvent, Event::CanBubble::No, Event::IsCancelable::No));
    3995     }
    3996 }
    3997 
    39983968void Document::addAudioProducer(MediaProducer& audioProducer)
    39993969{
  • trunk/Source/WebCore/dom/Document.h

    r251558 r251567  
    13611361    void updateViewportUnitsOnResize();
    13621362
    1363     void setNeedsDOMWindowResizeEvent();
    1364     void setNeedsVisualViewportResize();
    1365     void runResizeSteps();
    1366 
    13671363    WEBCORE_EXPORT void addAudioProducer(MediaProducer&);
    13681364    WEBCORE_EXPORT void removeAudioProducer(MediaProducer&);
     
    20172013
    20182014    bool m_hasStyleWithViewportUnits { false };
    2019     bool m_needsDOMWindowResizeEvent { false };
    2020     bool m_needsVisualViewportResizeEvent { false };
    20212015    bool m_isTimerThrottlingEnabled { false };
    20222016    bool m_isSuspended { false };
  • trunk/Source/WebCore/page/FrameView.cpp

    r251369 r251567  
    34233423#endif
    34243424
    3425     LOG(Events, "FrameView %p sendResizeEventIfNeeded scheduling resize event for document %p, size %dx%d", this, frame().document(), currentSize.width(), currentSize.height());
    3426     frame().document()->setNeedsDOMWindowResizeEvent();
    3427 
    34283425    bool isMainFrame = frame().isMainFrame();
     3426    bool canSendResizeEventSynchronously = isMainFrame && !m_shouldAutoSize;
     3427
     3428    LOG(Events, "FrameView %p sendResizeEventIfNeeded sending resize event, size %dx%d (canSendResizeEventSynchronously %d)", this, currentSize.width(), currentSize.height(), canSendResizeEventSynchronously);
     3429
     3430    Ref<Event> resizeEvent = Event::create(eventNames().resizeEvent, Event::CanBubble::No, Event::IsCancelable::No);
     3431    if (canSendResizeEventSynchronously)
     3432        frame().document()->dispatchWindowEvent(resizeEvent);
     3433    else {
     3434        // FIXME: Queueing this event for an unpredictable time in the future seems
     3435        // intrinsically racy. By the time this resize event fires, the frame might
     3436        // be resized again, so we could end up with two resize events for the same size.
     3437        frame().document()->enqueueWindowEvent(WTFMove(resizeEvent));
     3438    }
     3439
    34293440    if (InspectorInstrumentation::hasFrontends() && isMainFrame) {
    34303441        if (Page* page = frame().page()) {
  • trunk/Source/WebCore/page/Page.cpp

    r251322 r251567  
    12951295    SetForScope<bool> change(m_inUpdateRendering, true);
    12961296
    1297     layoutIfNeeded();
    1298 
    1299     for (auto& document : collectDocuments())
    1300         document->runResizeSteps();
     1297    Vector<RefPtr<Document>> documents;
     1298
     1299    // The requestAnimationFrame callbacks may change the frame hierarchy of the page
     1300    forEachDocument([&documents] (Document& document) {
     1301        documents.append(&document);
     1302    });
     1303
     1304    // FIXME: Run the resize steps
    13011305
    13021306    // FIXME: Run the scroll steps
     
    13051309        document->evaluateMediaQueriesAndReportChanges();
    13061310
    1307     Vector<Ref<Document>> documents = collectDocuments(); // The requestAnimationFrame callbacks may change the frame hierarchy of the page
    13081311    for (auto& document : documents) {
    13091312        DOMHighResTimeStamp timestamp = document->domWindow()->nowTimestamp();
     
    28722875}
    28732876
    2874 Vector<Ref<Document>> Page::collectDocuments()
    2875 {
    2876     Vector<Ref<Document>> documents;
    2877     for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
    2878         auto* document = frame->document();
    2879         if (!document)
    2880             continue;
    2881         documents.append(*document);
    2882     }
    2883     return documents;
    2884 }
    2885 
    28862877void Page::applicationWillResignActive()
    28872878{
  • trunk/Source/WebCore/page/Page.h

    r251269 r251567  
    751751
    752752    void forEachDocument(const WTF::Function<void(Document&)>&);
    753     Vector<Ref<Document>> collectDocuments();
    754753
    755754    enum class TimerThrottlingState { Disabled, Enabled, EnabledIncreasing };
  • trunk/Source/WebCore/page/VisualViewport.cpp

    r251269 r251567  
    186186    if (!frame)
    187187        return;
    188     frame->document()->setNeedsVisualViewportResize();
     188
     189    frame->document()->eventQueue().enqueueResizeEvent(*this, Event::CanBubble::No, Event::IsCancelable::No);
    189190}
    190191
Note: See TracChangeset for help on using the changeset viewer.