12013-01-08 Mike West <mkwst@chromium.org>
2
3 <iframe seamless> using display: inline or float, (shrink-wrapping) are too tall
4 https://bugs.webkit.org/show_bug.cgi?id=87707
5
6 Reviewed by NOBODY (OOPS!).
7
8 Seamless documents currently render incorrectly when their content fills
9 the width of the container into which they're placed. Because FrameView
10 assumes that the container's size is properly set before the first pass
11 of layout, vertical scrollbars are incorrectly forced onto seamless
12 content, because seamless sets the container's height to 0 before
13 handing it off to FrameView for layout. The scrollbars make the
14 available width for the seamless document ~15px smaller than it should
15 be, resulting in content getting bumped to the next line.
16
17 The relevant distinction between scrollbar negotiation in RenderBlock
18 and FrameView/ScrollView is that RenderBlock waits until after the first
19 pass of layout before applying scrollbars to the content. This patch
20 special-cases ScrollView::updateScrollbars to do more or less the same,
21 avoiding the forced scrollbars on the first pass of layout when the
22 document being rendered is a) seamless, and b) has a full visible height
23 of 0.
24
25 The change should be covered by rebaselines for the newly-passing
26 results in fast/frame/seamless-{float,inline}.html
27
28 * page/FrameView.cpp:
29 (WebCore::FrameView::layout):
30 If we're rendering a seamless document, don't force vertical
31 scrollbars on the initial layout.
32 (WebCore::FrameView::isSeamlessDocument):
33 (WebCore):
34 * page/FrameView.h:
35 (FrameView):
36 Overrides ScrollView's new isSeamlessDocument method to expose the
37 frame's document's seamless state.
38 * platform/ScrollView.cpp:
39 (WebCore::ScrollView::updateScrollbars):
40 If we're rendering a seamless document, and the full visible height
41 is 0, then don't force a vertical scrollbar.
42 (WebCore::ScrollView::setContentsSize):
43 If we're rendering a seamless document, and the full visible height
44 is 0, then don't call out to update scrollbars.
45 * platform/ScrollView.h:
46 (ScrollView):
47 (WebCore::ScrollView::isSeamlessDocument):
48 A new method, overridden by FrameView in order to allow us to make
49 reasonable decisions in ScrollView::updateScrollbars.
50