Changeset 163182 in webkit


Ignore:
Timestamp:
Jan 31, 2014 11:36:57 AM (10 years ago)
Author:
Simon Fraser
Message:

Even when in fixed layout mode, some platforms need to do layout after a viewport change
https://bugs.webkit.org/show_bug.cgi?id=128003

Reviewed by Andreas Kling.

iOS uses fixed layout mode in both WK1 and WK2, but lays out fixed position
elements relative to a variable viewport. This code assumed that fixed layout
implies a fixed viewport.

Fix by testing for useCustomFixedPositionLayoutRect() in the fixed layout case.

Also removed RenderView::hasCustomFixedPosition() which is no longer used.

  • page/FrameView.cpp:

(WebCore::FrameView::shouldLayoutAfterViewportChange):
(WebCore::FrameView::visibleContentsResized):

  • page/FrameView.h:
  • rendering/RenderView.cpp:
  • rendering/RenderView.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163181 r163182  
     12014-01-31  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Even when in fixed layout mode, some platforms need to do layout after a viewport change
     4        https://bugs.webkit.org/show_bug.cgi?id=128003
     5
     6        Reviewed by Andreas Kling.
     7
     8        iOS uses fixed layout mode in both WK1 and WK2, but lays out fixed position
     9        elements relative to a variable viewport. This code assumed that fixed layout
     10        implies a fixed viewport.
     11       
     12        Fix by testing for useCustomFixedPositionLayoutRect() in the fixed layout case.
     13       
     14        Also removed RenderView::hasCustomFixedPosition() which is no longer used.
     15       
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::shouldLayoutAfterViewportChange):
     18        (WebCore::FrameView::visibleContentsResized):
     19        * page/FrameView.h:
     20        * rendering/RenderView.cpp:
     21        * rendering/RenderView.h:
     22
    1232014-01-31  Zan Dobersek  <zdobersek@igalia.com>
    224
  • trunk/Source/WebCore/page/FrameView.cpp

    r163180 r163182  
    21402140}
    21412141
     2142bool FrameView::shouldLayoutAfterViewportChange() const
     2143{
     2144    return hasViewportConstrainedObjects() && (!useFixedLayout() || useCustomFixedPositionLayoutRect());
     2145}
     2146
    21422147void FrameView::visibleContentsResized()
    21432148{
     
    21612166#endif
    21622167
    2163     if (!useFixedLayout() && needsLayout())
     2168    if (shouldLayoutAfterViewportChange() && needsLayout())
    21642169        layout();
    21652170
  • trunk/Source/WebCore/page/FrameView.h

    r163146 r163182  
    130130    void setCustomFixedPositionLayoutRect(const IntRect&);
    131131    bool updateFixedPositionLayoutRect();
     132#else
     133    bool useCustomFixedPositionLayoutRect() const { return false; }
    132134#endif
    133135
     
    480482    void updateCanBlitOnScrollRecursively();
    481483    bool contentsInCompositedLayer() const;
     484    bool shouldLayoutAfterViewportChange() const;
    482485
    483486    bool shouldUpdateCompositingLayersAfterScrolling() const;
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r163079 r163182  
    11981198}
    11991199
    1200 #if PLATFORM(IOS)
    1201 static bool isFixedPositionInViewport(const RenderObject& renderer, const RenderObject* container)
    1202 {
    1203     return (renderer.style().position() == FixedPosition) && renderer.container() == container;
    1204 }
    1205 
    1206 bool RenderView::hasCustomFixedPosition(const RenderObject& renderer, ContainingBlockCheck checkContainer) const
    1207 {
    1208     if (!frameView().useCustomFixedPositionLayoutRect())
    1209         return false;
    1210 
    1211     if (checkContainer == CheckContainingBlock)
    1212         return isFixedPositionInViewport(renderer, this);
    1213 
    1214     return renderer.style().position() == FixedPosition;
    1215 }
    1216 #endif
    1217 
    12181200void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject& object)
    12191201{
  • trunk/Source/WebCore/rendering/RenderView.h

    r163079 r163182  
    192192    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
    193193
    194 #if PLATFORM(IOS)
    195     enum ContainingBlockCheck { CheckContainingBlock, DontCheckContainingBlock };
    196     bool hasCustomFixedPosition(const RenderObject&, ContainingBlockCheck = CheckContainingBlock) const;
    197 #endif
    198 
    199194    IntervalArena* intervalArena();
    200195
Note: See TracChangeset for help on using the changeset viewer.