https://bugs.webkit.org/show_bug.cgi?id=143360
Reviewed by Beth Dakin.
Test: fast/fixed-layout/fixed-layout.html
* platform/ScrollView.cpp:
(WebCore::ScrollView::setFrameRect):
Update scrollbars when the ScrollView frameRect changes. We were previously
depending on the layout that always happens after this to update scrollbars,
but with fixed layout mode, there won't be a layout! Also, FrameView's
setFrameRect override will sync this scrollbar update with the scrollbar
layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Turn off fixed layout when resetting state.
(WebCore::Internals::setUseFixedLayout):
(WebCore::Internals::setFixedLayoutSize):
* testing/Internals.h:
* testing/Internals.idl:
Add internals functions to set the fixed layout size and to turn on fixed layout.
* fast/fixed-layout/fixed-layout-expected.png: Added.
* fast/fixed-layout/fixed-layout-expected.txt: Added.
* fast/fixed-layout/fixed-layout.html: Added.
Add a simple fixed layout test. We can add more (or recover some from
when the Qt tests were purged) now that it's testable again.
This test also happens to test the aforementioned setFrameRect change,
because without it, the RenderView's layer would be left at the wrong
size (800x600) because the scrollbars would be left behind in the resize.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182307
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-04-02 Timothy Horton <timothy_horton@apple.com>
+
+ Scrollbars are left in the wrong position when resizing a fixed layout view
+ https://bugs.webkit.org/show_bug.cgi?id=143360
+
+ Reviewed by Beth Dakin.
+
+ * fast/fixed-layout/fixed-layout-expected.png: Added.
+ * fast/fixed-layout/fixed-layout-expected.txt: Added.
+ * fast/fixed-layout/fixed-layout.html: Added.
+ Add a simple fixed layout test. We can add more (or recover some from
+ when the Qt tests were purged) now that it's testable again.
+
+ This test also happens to test the aforementioned setFrameRect change,
+ because without it, the RenderView's layer would be left at the wrong
+ size (800x600) because the scrollbars would be left behind in the resize.
+
2015-04-02 Brent Fulgham <bfulgham@apple.com>
New ruby tests are failing on all non-Mac platforms.
--- /dev/null
+layer at (0,0) size 400x400
+ RenderView at (0,0) size 400x400
+layer at (0,0) size 400x400
+ RenderBlock {HTML} at (0,0) size 400x400
+ RenderBody {BODY} at (0,0) size 400x400
+layer at (0,0) size 400x400
+ RenderBlock (positioned) {DIV} at (0,0) size 400x400 [bgcolor=#008000]
+layer at (0,0) size 100x100
+ RenderBlock (positioned) {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
--- /dev/null
+<head>
+<script>
+window.onload = function () {
+ if (!window.testRunner) {
+ document.write("Test cannot be run manually.");
+ return;
+ }
+
+ testRunner.waitUntilDone();
+
+ window.resizeTo(200, 200);
+
+ internals.setUseFixedLayout(true);
+ internals.setFixedLayoutSize(400, 400);
+
+ setTimeout(function () {
+ testRunner.notifyDone();
+ }, 0);
+}
+</script>
+</head>
+<body style="margin: 0;">
+<div style="width: 100%; height: 100%; position: absolute; background-color: green;"></div>
+<div style="width: 50vw; height: 50vh; position: absolute; background-color: blue;"></div>
+</body>
\ No newline at end of file
+2015-04-02 Timothy Horton <timothy_horton@apple.com>
+
+ Scrollbars are left in the wrong position when resizing a fixed layout view
+ https://bugs.webkit.org/show_bug.cgi?id=143360
+
+ Reviewed by Beth Dakin.
+
+ Test: fast/fixed-layout/fixed-layout.html
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::setFrameRect):
+ Update scrollbars when the ScrollView frameRect changes. We were previously
+ depending on the layout that always happens after this to update scrollbars,
+ but with fixed layout mode, there won't be a layout! Also, FrameView's
+ setFrameRect override will sync this scrollbar update with the scrollbar
+ layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::resetToConsistentState):
+ Turn off fixed layout when resetting state.
+
+ (WebCore::Internals::setUseFixedLayout):
+ (WebCore::Internals::setFixedLayoutSize):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+ Add internals functions to set the fixed layout size and to turn on fixed layout.
+
2015-04-02 Brady Eidson <beidson@apple.com>
Unreviewed: Reapplied Change after rollout.
Widget::setFrameRect(newRect);
frameRectsChanged();
+
+ updateScrollbars(scrollOffset());
if (!m_useFixedLayout && oldRect.size() != newRect.size())
availableContentSizeChanged(AvailableSizeChangeReason::AreaSizeChanged);
mainFrameView->setHeaderHeight(0);
mainFrameView->setFooterHeight(0);
page->setTopContentInset(0);
+ mainFrameView->setUseFixedLayout(false);
+ mainFrameView->setFixedLayoutSize(IntSize());
}
TextRun::setAllowsRoundingHacks(false);
frame->setPageZoomFactor(zoomFactor);
}
+void Internals::setUseFixedLayout(bool useFixedLayout, ExceptionCode& ec)
+{
+ Document* document = contextDocument();
+ if (!document || !document->view()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+ FrameView* frameView = document->view();
+ frameView->setUseFixedLayout(useFixedLayout);
+}
+
+void Internals::setFixedLayoutSize(int width, int height, ExceptionCode& ec)
+{
+ Document* document = contextDocument();
+ if (!document || !document->view()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+ FrameView* frameView = document->view();
+ frameView->setFixedLayoutSize(IntSize(width, height));
+}
+
void Internals::setHeaderHeight(float height)
{
Document* document = contextDocument();
void setPageScaleFactor(float scaleFactor, int x, int y, ExceptionCode&);
void setPageZoomFactor(float zoomFactor, ExceptionCode&);
+ void setUseFixedLayout(bool useFixedLayout, ExceptionCode&);
+ void setFixedLayoutSize(int width, int height, ExceptionCode&);
+
void setHeaderHeight(float);
void setFooterHeight(float);
[RaisesException] void setPageScaleFactor(unrestricted float scaleFactor, long x, long y);
[RaisesException] void setPageZoomFactor(unrestricted float zoomFactor);
+ [RaisesException] void setUseFixedLayout(boolean useFixedLayout);
+ [RaisesException] void setFixedLayoutSize(long width, long height);
+
void setHeaderHeight(unrestricted float height);
void setFooterHeight(unrestricted float height);