Title: [163182] trunk/Source/WebCore
- Revision
- 163182
- Author
- [email protected]
- Date
- 2014-01-31 11:36:57 -0800 (Fri, 31 Jan 2014)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (163181 => 163182)
--- trunk/Source/WebCore/ChangeLog 2014-01-31 19:34:11 UTC (rev 163181)
+++ trunk/Source/WebCore/ChangeLog 2014-01-31 19:36:57 UTC (rev 163182)
@@ -1,3 +1,25 @@
+2014-01-31 Simon Fraser <[email protected]>
+
+ 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:
+
2014-01-31 Zan Dobersek <[email protected]>
Guard GLContextEGL::platformContext() with USE(3D_GRAPHICS)
Modified: trunk/Source/WebCore/page/FrameView.cpp (163181 => 163182)
--- trunk/Source/WebCore/page/FrameView.cpp 2014-01-31 19:34:11 UTC (rev 163181)
+++ trunk/Source/WebCore/page/FrameView.cpp 2014-01-31 19:36:57 UTC (rev 163182)
@@ -2139,6 +2139,11 @@
ScrollView::fixedLayoutSizeChanged();
}
+bool FrameView::shouldLayoutAfterViewportChange() const
+{
+ return hasViewportConstrainedObjects() && (!useFixedLayout() || useCustomFixedPositionLayoutRect());
+}
+
void FrameView::visibleContentsResized()
{
// We check to make sure the view is attached to a frame() as this method can
@@ -2160,7 +2165,7 @@
}
#endif
- if (!useFixedLayout() && needsLayout())
+ if (shouldLayoutAfterViewportChange() && needsLayout())
layout();
if (RenderView* renderView = this->renderView()) {
Modified: trunk/Source/WebCore/page/FrameView.h (163181 => 163182)
--- trunk/Source/WebCore/page/FrameView.h 2014-01-31 19:34:11 UTC (rev 163181)
+++ trunk/Source/WebCore/page/FrameView.h 2014-01-31 19:36:57 UTC (rev 163182)
@@ -129,6 +129,8 @@
IntRect customFixedPositionLayoutRect() const { return m_customFixedPositionLayoutRect; }
void setCustomFixedPositionLayoutRect(const IntRect&);
bool updateFixedPositionLayoutRect();
+#else
+ bool useCustomFixedPositionLayoutRect() const { return false; }
#endif
#if ENABLE(REQUEST_ANIMATION_FRAME)
@@ -479,6 +481,7 @@
bool useSlowRepaintsIfNotOverlapped() const;
void updateCanBlitOnScrollRecursively();
bool contentsInCompositedLayer() const;
+ bool shouldLayoutAfterViewportChange() const;
bool shouldUpdateCompositingLayersAfterScrolling() const;
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (163181 => 163182)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2014-01-31 19:34:11 UTC (rev 163181)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2014-01-31 19:36:57 UTC (rev 163182)
@@ -1197,24 +1197,6 @@
return *m_flowThreadController;
}
-#if PLATFORM(IOS)
-static bool isFixedPositionInViewport(const RenderObject& renderer, const RenderObject* container)
-{
- return (renderer.style().position() == FixedPosition) && renderer.container() == container;
-}
-
-bool RenderView::hasCustomFixedPosition(const RenderObject& renderer, ContainingBlockCheck checkContainer) const
-{
- if (!frameView().useCustomFixedPositionLayoutRect())
- return false;
-
- if (checkContainer == CheckContainingBlock)
- return isFixedPositionInViewport(renderer, this);
-
- return renderer.style().position() == FixedPosition;
-}
-#endif
-
void RenderView::pushLayoutStateForCurrentFlowThread(const RenderObject& object)
{
if (!m_flowThreadController)
Modified: trunk/Source/WebCore/rendering/RenderView.h (163181 => 163182)
--- trunk/Source/WebCore/rendering/RenderView.h 2014-01-31 19:34:11 UTC (rev 163181)
+++ trunk/Source/WebCore/rendering/RenderView.h 2014-01-31 19:36:57 UTC (rev 163182)
@@ -191,11 +191,6 @@
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
-#if PLATFORM(IOS)
- enum ContainingBlockCheck { CheckContainingBlock, DontCheckContainingBlock };
- bool hasCustomFixedPosition(const RenderObject&, ContainingBlockCheck = CheckContainingBlock) const;
-#endif
-
IntervalArena* intervalArena();
IntSize viewportSize() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes