Title: [142236] trunk
- Revision
- 142236
- Author
- [email protected]
- Date
- 2013-02-07 23:35:48 -0800 (Thu, 07 Feb 2013)
Log Message
<iframe seamless> should avoid vertical scrollbars during the initial layout passes.
https://bugs.webkit.org/show_bug.cgi?id=87707
Reviewed by Eric Seidel.
Source/WebCore:
Seamless documents currently render incorrectly when their content fills
the width of the container into which they're placed. Because FrameView
assumes that the container's size is properly set before the first pass
of layout, vertical scrollbars are incorrectly forced onto seamless
content, because seamless sets the container's height to 0 before
handing it off to FrameView for layout. The scrollbars make the
available width for the seamless document ~15px smaller than it should
be, resulting in content getting bumped to the next line.
This patch special-cases FrameView::calculateScrollbarModesForLayout in
order to force scrollbars off for seamless documents with a full visible
height of 0px. Once the layout pass has grabbed the content height and
applied it to the visible height, scrollbars will again be applicable.
The change should be covered by rebaselines for the newly-passing
results in fast/frame/seamless-{float,inline}.html
* page/FrameView.cpp:
(WebCore::FrameView::calculateScrollbarModesForLayout):
If we're rendering a seamless document, and the full visible height
is 0, and the vertical scrollbar would otherwise be ScrollbarAuto,
then force ScrollbarAlwaysOff.
LayoutTests:
* fast/frames/seamless/seamless-float-expected.txt:
* fast/frames/seamless/seamless-inline-expected.txt:
Rebaseline the now-passing bits of these tests.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (142235 => 142236)
--- trunk/LayoutTests/ChangeLog 2013-02-08 07:34:27 UTC (rev 142235)
+++ trunk/LayoutTests/ChangeLog 2013-02-08 07:35:48 UTC (rev 142236)
@@ -1,3 +1,14 @@
+2013-02-07 Mike West <[email protected]>
+
+ <iframe seamless> should avoid vertical scrollbars during the initial layout passes.
+ https://bugs.webkit.org/show_bug.cgi?id=87707
+
+ Reviewed by Eric Seidel.
+
+ * fast/frames/seamless/seamless-float-expected.txt:
+ * fast/frames/seamless/seamless-inline-expected.txt:
+ Rebaseline the now-passing bits of these tests.
+
2013-02-07 Alok Priyadarshi <[email protected]>
Unreviewed rebaseline.
Modified: trunk/LayoutTests/fast/frames/seamless/seamless-float-expected.txt (142235 => 142236)
--- trunk/LayoutTests/fast/frames/seamless/seamless-float-expected.txt 2013-02-08 07:34:27 UTC (rev 142235)
+++ trunk/LayoutTests/fast/frames/seamless/seamless-float-expected.txt 2013-02-08 07:35:48 UTC (rev 142236)
@@ -1,6 +1,6 @@
Test that floated seamless iframes 'shrink-wrap' their contents, as floated divs would.
PASS window.getComputedStyle(iframe1).width is "150px"
-FAIL window.getComputedStyle(iframe1).height should be 50px. Was 100px.
+PASS window.getComputedStyle(iframe1).height is "50px"
PASS window.getComputedStyle(iframe2).width is "100px"
PASS window.getComputedStyle(iframe2).height is "100px"
Modified: trunk/LayoutTests/fast/frames/seamless/seamless-inline-expected.txt (142235 => 142236)
--- trunk/LayoutTests/fast/frames/seamless/seamless-inline-expected.txt 2013-02-08 07:34:27 UTC (rev 142235)
+++ trunk/LayoutTests/fast/frames/seamless/seamless-inline-expected.txt 2013-02-08 07:35:48 UTC (rev 142236)
@@ -2,8 +2,8 @@
PASS window.getComputedStyle(iframe1).display is "inline-block"
PASS window.getComputedStyle(iframe2).display is "inline-block"
PASS window.getComputedStyle(iframe1).width is "150px"
-FAIL window.getComputedStyle(iframe1).height should be 50px. Was 100px.
-FAIL window.getComputedStyle(parent1).height should be 50px. Was 100px.
+PASS window.getComputedStyle(iframe1).height is "50px"
+PASS window.getComputedStyle(parent1).height is "50px"
PASS window.getComputedStyle(iframe2).width is "100px"
PASS window.getComputedStyle(iframe2).height is "100px"
PASS window.getComputedStyle(parent2).height is "150px"
Modified: trunk/Source/WebCore/ChangeLog (142235 => 142236)
--- trunk/Source/WebCore/ChangeLog 2013-02-08 07:34:27 UTC (rev 142235)
+++ trunk/Source/WebCore/ChangeLog 2013-02-08 07:35:48 UTC (rev 142236)
@@ -1,3 +1,33 @@
+2013-02-07 Mike West <[email protected]>
+
+ <iframe seamless> should avoid vertical scrollbars during the initial layout passes.
+ https://bugs.webkit.org/show_bug.cgi?id=87707
+
+ Reviewed by Eric Seidel.
+
+ Seamless documents currently render incorrectly when their content fills
+ the width of the container into which they're placed. Because FrameView
+ assumes that the container's size is properly set before the first pass
+ of layout, vertical scrollbars are incorrectly forced onto seamless
+ content, because seamless sets the container's height to 0 before
+ handing it off to FrameView for layout. The scrollbars make the
+ available width for the seamless document ~15px smaller than it should
+ be, resulting in content getting bumped to the next line.
+
+ This patch special-cases FrameView::calculateScrollbarModesForLayout in
+ order to force scrollbars off for seamless documents with a full visible
+ height of 0px. Once the layout pass has grabbed the content height and
+ applied it to the visible height, scrollbars will again be applicable.
+
+ The change should be covered by rebaselines for the newly-passing
+ results in fast/frame/seamless-{float,inline}.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::calculateScrollbarModesForLayout):
+ If we're rendering a seamless document, and the full visible height
+ is 0, and the vertical scrollbar would otherwise be ScrollbarAuto,
+ then force ScrollbarAlwaysOff.
+
2013-02-07 Kent Tamura <[email protected]>
document.activeElement should not return a non-focusable element
Modified: trunk/Source/WebCore/page/FrameView.cpp (142235 => 142236)
--- trunk/Source/WebCore/page/FrameView.cpp 2013-02-08 07:34:27 UTC (rev 142235)
+++ trunk/Source/WebCore/page/FrameView.cpp 2013-02-08 07:35:48 UTC (rev 142236)
@@ -691,7 +691,11 @@
if (m_canHaveScrollbars || strategy == RulesFromWebContentOnly) {
hMode = ScrollbarAuto;
- vMode = ScrollbarAuto;
+ // Seamless documents begin with heights of 0; we special case that here
+ // to correctly render documents that don't need scrollbars.
+ IntSize fullVisibleSize = visibleContentRect(true /*includeScrollbars*/).size();
+ bool isSeamlessDocument = frame() && frame()->document() && frame()->document()->shouldDisplaySeamlesslyWithParent();
+ vMode = (isSeamlessDocument && !fullVisibleSize.height()) ? ScrollbarAlwaysOff : ScrollbarAuto;
} else {
hMode = ScrollbarAlwaysOff;
vMode = ScrollbarAlwaysOff;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes