Changeset 229361 in webkit


Ignore:
Timestamp:
Mar 7, 2018 9:11:17 AM (6 years ago)
Author:
fred.wang@free.fr
Message:

Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
https://bugs.webkit.org/show_bug.cgi?id=183081

Patch by Frederic Wang <fwang@igalia.com> on 2018-03-07
Reviewed by Antonio Gomes.

Source/WebCore:

The frames may be resized when the FrameFlattening option is modified and hence this patch
forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
bug 171667).

Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html

  • page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or

FrameFlattening options is changed.

  • page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().

(WebCore::SettingsBase::setNeedsRelayoutAllFrames): Make layout and preferred widths dirty
on all frames in the page and schedule a relayout.

  • page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().

LayoutTests:

Add a test to check whether an iframe changes its flattening status after one of the option
AsyncFrameScrolling/FrameFlattening is enabled/disabled.

  • platform/ios-simulator/TestExpectations: Remove failure for scrolling-in-object.html.
  • platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic-expected.txt: Added.
  • platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r229360 r229361  
     12018-03-07  Frederic Wang  <fwang@igalia.com>
     2
     3        Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
     4        https://bugs.webkit.org/show_bug.cgi?id=183081
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Add a test to check whether an iframe changes its flattening status after one of the option
     9        AsyncFrameScrolling/FrameFlattening is enabled/disabled.
     10
     11        * platform/ios-simulator/TestExpectations: Remove failure for scrolling-in-object.html.
     12        * platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic-expected.txt: Added.
     13        * platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html: Added.
     14
    1152018-03-07  Per Arne Vollan  <pvollan@apple.com>
    216
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r229088 r229361  
    55
    66css3/font-variant-small-caps-synthesis-coverage.html [ ImageOnlyFailure ]
    7 fast/frames/flattening/scrolling-in-object.html [ ImageOnlyFailure ]
    87fast/frames/sandboxed-iframe-close-top-noclose.html [ Failure ]
    98fast/multicol/flexbox-rows.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r229359 r229361  
     12018-03-07  Frederic Wang  <fwang@igalia.com>
     2
     3        Relayout frames after AsyncFrameScrolling or FrameFlattening option is changed
     4        https://bugs.webkit.org/show_bug.cgi?id=183081
     5
     6        Reviewed by Antonio Gomes.
     7
     8        The frames may be resized when the FrameFlattening option is modified and hence this patch
     9        forces a relayout. It also does that when AsyncFrameScrolling is modified too, since that
     10        may imply changes in frame flattening after bug 173704. Forcing a relayout will also be
     11        enough to trigger other updates for async frame scrolling in the future (see bug 149264 and
     12        bug 171667).
     13
     14        Test: platform/ios/fast/frames/flattening/iframe-flattening-async-frame-scrolling-dynamic.html
     15
     16        * page/Settings.yaml: Call setNeedsRelayoutAllFrames when one of the AsyncFrameScrolling or
     17        FrameFlattening options is changed.
     18        * page/SettingsBase.cpp: Include RenderWidget to make call on frame->ownerRenderer().
     19        (WebCore::SettingsBase::setNeedsRelayoutAllFrames):  Make layout and preferred widths dirty
     20        on all frames in the page and schedule a relayout.
     21        * page/SettingsBase.h: Declare setNeedsRelayoutAllFrames().
     22
    1232018-03-07  Alejandro G. Castro  <alex@igalia.com>
    224
  • trunk/Source/WebCore/page/Settings.yaml

    r229088 r229361  
    357357  type: FrameFlattening
    358358  initial: FrameFlattening::Disabled
     359  onChange: setNeedsRelayoutAllFrames
    359360asyncFrameScrollingEnabled:
    360361  initial: false
     362  onChange: setNeedsRelayoutAllFrames
    361363
    362364webSecurityEnabled:
  • trunk/Source/WebCore/page/SettingsBase.cpp

    r229088 r229361  
    4242#include "Page.h"
    4343#include "PageCache.h"
     44#include "RenderWidget.h"
    4445#include "RuntimeApplicationChecks.h"
    4546#include "Settings.h"
     
    268269    if (m_page)
    269270        m_page->setNeedsRecalcStyleInAllFrames();
     271}
     272
     273void SettingsBase::setNeedsRelayoutAllFrames()
     274{
     275    if (!m_page)
     276        return;
     277
     278    for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
     279        if (!frame->ownerRenderer())
     280            continue;
     281        frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc();
     282    }
    270283}
    271284
  • trunk/Source/WebCore/page/SettingsBase.h

    r229088 r229361  
    165165    // Helpers used by generated Settings.cpp.
    166166    void setNeedsRecalcStyleInAllFrames();
     167    void setNeedsRelayoutAllFrames();
    167168    void mediaTypeOverrideChanged();
    168169    void imagesEnabledChanged();
Note: See TracChangeset for help on using the changeset viewer.