Changeset 163216 in webkit


Ignore:
Timestamp:
Jan 31, 2014 3:57:29 PM (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.

Re-land 163182 with a less aggresive check in visibleContentsResized() for
needing to layout.

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

    r163212 r163216  
     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        Re-land 163182 with a less aggresive check in visibleContentsResized() for
     9        needing to layout.
     10
     11        iOS uses fixed layout mode in both WK1 and WK2, but lays out fixed position
     12        elements relative to a variable viewport. This code assumed that fixed layout
     13        implies a fixed viewport.
     14       
     15        Fix by testing for useCustomFixedPositionLayoutRect() in the fixed layout case.
     16       
     17        Also removed RenderView::hasCustomFixedPosition() which is no longer used.
     18       
     19        * page/FrameView.cpp:
     20        (WebCore::FrameView::shouldLayoutAfterViewportChange):
     21        (WebCore::FrameView::visibleContentsResized):
     22        * page/FrameView.h:
     23        * rendering/RenderView.cpp:
     24        * rendering/RenderView.h:
     25
    1262014-01-31  Alexey Proskuryakov  <ap@apple.com>
    227
  • trunk/Source/WebCore/page/FrameView.cpp

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

    r163190 r163216  
    130130    void setCustomFixedPositionLayoutRect(const IntRect&);
    131131    bool updateFixedPositionLayoutRect();
     132#else
     133    bool useCustomFixedPositionLayoutRect() const { return false; }
    132134#endif
    133135
     
    487489    void updateCanBlitOnScrollRecursively();
    488490    bool contentsInCompositedLayer() const;
     491    bool shouldLayoutAfterContentsResized() const;
    489492
    490493    bool shouldUpdateCompositingLayersAfterScrolling() const;
  • trunk/Source/WebCore/rendering/RenderView.cpp

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

    r163188 r163216  
    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.