LayoutTests/ChangeLog

 12012-11-23 Mihnea Ovidenie <mihnea@adobe.com>
 2
 3 [CSS Regions] Absolutely positioned region does not expand to fill its container
 4 https://bugs.webkit.org/show_bug.cgi?id=102385
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Added new test for the case of an absolutely positioned region inside a container. The region has top/left/bottom/right 0
 9 and it should expand to the container limits.
 10 Also modified expectations for another test that has absolutely positioned auto-height regions, that now have height computed properly.
 11
 12 * fast/regions/autosize-abspos-anchoredregion-expected.txt: Added.
 13 * fast/regions/autosize-abspos-anchoredregion.html: Added.
 14 * platform/chromium/fast/regions/autoheight-regions-mark-expected.txt:
 15 * platform/efl/fast/regions/autoheight-regions-mark-expected.txt:
 16 * platform/gtk/fast/regions/autoheight-regions-mark-expected.txt:
 17 * platform/mac/fast/regions/autoheight-regions-mark-expected.txt:
 18 * platform/qt/fast/regions/autoheight-regions-mark-expected.txt:
 19
1202012-11-23 Robert Kroeger <rjkroege@chromium.org>
221
322 Unreviewed gardening: updated test expectations for failure in

LayoutTests/fast/regions/autosize-abspos-anchoredregion-expected.txt

 1Test for [CSS Regions] Absolutely positioned region does not expand to fill its container.
 2
 3On success, you should not see any red or FAIL below.
 4
 5PASS
 6PASS
 7PASS
 8PASS

LayoutTests/fast/regions/autosize-abspos-anchoredregion.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <style>
 5 .container { position: relative; width: 100px; height: 100px; }
 6 .region { -webkit-flow-from: flow; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; background-color: green; }
 7 .redBox { position: absolute; background-color: red; }
 8
 9 #red1 { width: 100px; height: 100px; }
 10
 11 #red2 { width: 50px; height: 100px; }
 12 #region2 { width: 50px; }
 13
 14 #red3 { width: 100px; height: 50px; }
 15 #region3 { height: 50px; }
 16
 17 #red4 { width: 50px; height: 50px; }
 18 #region4 { width: 50px; height: 50px; }
 19 </style>
 20 </head>
 21 <script src="../../resources/check-layout.js"></script>
 22 <body onload="checkLayout('.region')">
 23 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=102385"> [CSS Regions] Absolutely positioned region does not expand to fill its container</a>.</p>
 24 <p>On success, you should not see any red or FAIL below.</p>
 25 <div class="container">
 26 <div id="red1" class="redBox"></div>
 27 <div id="region1" class="region" data-expected-width=100 data-expected-height=100></div>
 28 </div>
 29
 30 <div class="container">
 31 <div id="red2" class="redBox"></div>
 32 <div id="region2" class="region" data-expected-width=50 data-expected-height=100></div>
 33 </div>
 34
 35 <div class="container">
 36 <div id="red3" class="redBox"></div>
 37 <div id="region3" class="region" data-expected-width=100 data-expected-height=50></div>
 38 </div>
 39
 40 <div class="container">
 41 <div id="red4" class="redBox"></div>
 42 <div id="region4" class="region" data-expected-width=50 data-expected-height=50></div>
 43 </div>
 44 </body>
 45</html>

LayoutTests/platform/chromium/fast/regions/autoheight-regions-mark-expected.txt

@@layer at (0,0) size 800x116
77 RenderRegion {DIV} at (0,50) size 50x0
88 RenderRegion {DIV} at (0,50) size 50x0
99 RenderRegion {DIV} at (0,50) size 50x50
 10layer at (8,50) size 50x450
 11 RenderRegion {DIV} at (8,50) size 50x450
 12layer at (50,8) size 650x50
 13 RenderRegion {DIV} at (50,8) size 650x50
1014Flow Threads
1115 Thread with flow-name 'flow'
1216 layer at (0,0) size 50x50

@@Flow Threads
1721 Regions for flow 'flow2'
1822 RenderRegion {DIV} #region2 hasAutoLogicalHeight
1923 Thread with flow-name 'flow3'
 24 layer at (0,0) size 50x450
 25 RenderNamedFlowThread at (0,0) size 50x450
2026 Regions for flow 'flow3'
2127 RenderRegion {DIV} #region3
2228 Thread with flow-name 'flow4'
 29 layer at (0,0) size 650x50
 30 RenderNamedFlowThread at (0,0) size 650x50
2331 Regions for flow 'flow4'
2432 RenderRegion {DIV} #region4
2533 Thread with flow-name 'flow5'

LayoutTests/platform/efl/fast/regions/autoheight-regions-mark-expected.txt

@@layer at (0,0) size 800x116
77 RenderRegion {DIV} at (0,50) size 50x0
88 RenderRegion {DIV} at (0,50) size 50x0
99 RenderRegion {DIV} at (0,50) size 50x50
 10layer at (8,50) size 50x450
 11 RenderRegion {DIV} at (8,50) size 50x450
 12layer at (50,8) size 650x50
 13 RenderRegion {DIV} at (50,8) size 650x50
1014Flow Threads
1115 Thread with flow-name 'flow'
1216 layer at (0,0) size 50x50

@@Flow Threads
1721 Regions for flow 'flow2'
1822 RenderRegion {DIV} #region2 hasAutoLogicalHeight
1923 Thread with flow-name 'flow3'
 24 layer at (0,0) size 50x450
 25 RenderNamedFlowThread at (0,0) size 50x450
2026 Regions for flow 'flow3'
2127 RenderRegion {DIV} #region3
2228 Thread with flow-name 'flow4'
 29 layer at (0,0) size 650x50
 30 RenderNamedFlowThread at (0,0) size 650x50
2331 Regions for flow 'flow4'
2432 RenderRegion {DIV} #region4
2533 Thread with flow-name 'flow5'

LayoutTests/platform/gtk/fast/regions/autoheight-regions-mark-expected.txt

@@layer at (0,0) size 800x116
77 RenderRegion {DIV} at (0,50) size 50x0
88 RenderRegion {DIV} at (0,50) size 50x0
99 RenderRegion {DIV} at (0,50) size 50x50
 10layer at (8,50) size 50x450
 11 RenderRegion {DIV} at (8,50) size 50x450
 12layer at (50,8) size 650x50
 13 RenderRegion {DIV} at (50,8) size 650x50
1014Flow Threads
1115 Thread with flow-name 'flow'
1216 layer at (0,0) size 50x50

@@Flow Threads
1721 Regions for flow 'flow2'
1822 RenderRegion {DIV} #region2 hasAutoLogicalHeight
1923 Thread with flow-name 'flow3'
 24 layer at (0,0) size 50x450
 25 RenderNamedFlowThread at (0,0) size 50x450
2026 Regions for flow 'flow3'
2127 RenderRegion {DIV} #region3
2228 Thread with flow-name 'flow4'
 29 layer at (0,0) size 650x50
 30 RenderNamedFlowThread at (0,0) size 650x50
2331 Regions for flow 'flow4'
2432 RenderRegion {DIV} #region4
2533 Thread with flow-name 'flow5'

LayoutTests/platform/mac/fast/regions/autoheight-regions-mark-expected.txt

@@layer at (0,0) size 800x116
77 RenderRegion {DIV} at (0,50) size 50x0
88 RenderRegion {DIV} at (0,50) size 50x0
99 RenderRegion {DIV} at (0,50) size 50x50
 10layer at (8,50) size 50x450
 11 RenderRegion {DIV} at (8,50) size 50x450
 12layer at (50,8) size 650x50
 13 RenderRegion {DIV} at (50,8) size 650x50
1014Flow Threads
1115 Thread with flow-name 'flow'
1216 layer at (0,0) size 50x50

@@Flow Threads
1721 Regions for flow 'flow2'
1822 RenderRegion {DIV} #region2 hasAutoLogicalHeight
1923 Thread with flow-name 'flow3'
 24 layer at (0,0) size 50x450
 25 RenderNamedFlowThread at (0,0) size 50x450
2026 Regions for flow 'flow3'
2127 RenderRegion {DIV} #region3
2228 Thread with flow-name 'flow4'
 29 layer at (0,0) size 650x50
 30 RenderNamedFlowThread at (0,0) size 650x50
2331 Regions for flow 'flow4'
2432 RenderRegion {DIV} #region4
2533 Thread with flow-name 'flow5'

LayoutTests/platform/qt/fast/regions/autoheight-regions-mark-expected.txt

@@layer at (0,0) size 800x116
77 RenderRegion {DIV} at (0,50) size 50x0
88 RenderRegion {DIV} at (0,50) size 50x0
99 RenderRegion {DIV} at (0,50) size 50x50
 10layer at (8,50) size 50x450
 11 RenderRegion {DIV} at (8,50) size 50x450
 12layer at (50,8) size 650x50
 13 RenderRegion {DIV} at (50,8) size 650x50
1014Flow Threads
1115 Thread with flow-name 'flow'
1216 layer at (0,0) size 50x50

@@Flow Threads
1721 Regions for flow 'flow2'
1822 RenderRegion {DIV} #region2 hasAutoLogicalHeight
1923 Thread with flow-name 'flow3'
 24 layer at (0,0) size 50x450
 25 RenderNamedFlowThread at (0,0) size 50x450
2026 Regions for flow 'flow3'
2127 RenderRegion {DIV} #region3
2228 Thread with flow-name 'flow4'
 29 layer at (0,0) size 650x50
 30 RenderNamedFlowThread at (0,0) size 650x50
2331 Regions for flow 'flow4'
2432 RenderRegion {DIV} #region4
2533 Thread with flow-name 'flow5'

Source/WebCore/ChangeLog

 12012-11-23 Mihnea Ovidenie <mihnea@adobe.com>
 2
 3 [CSS Regions] Absolutely positioned region does not expand to fill its container
 4 https://bugs.webkit.org/show_bug.cgi?id=102385
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In the case of an absolutely positioned region with height auto, height computation should follow
 9 the path of block elements instead of replaced elements.
 10
 11 Test: fast/regions/autosize-abspos-anchoredregion.html
 12
 13 * rendering/RenderBox.cpp:
 14 (WebCore::RenderBox::computePositionedLogicalHeight): Skip replaced element height computation when a region has height auto.
 15 * rendering/RenderRegion.h:
 16 (WebCore::RenderRegion::shouldHaveAutoLogicalHeight): Make it private since it is not accessed from outside.
 17
1182012-11-23 Robert Kroeger <rjkroege@chromium.org>
219
320 Remove unused ScrollByPixelVelocity

Source/WebCore/rendering/RenderBox.cpp

@@static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBottom
29592959void RenderBox::computePositionedLogicalHeight(LogicalExtentComputedValues& computedValues) const
29602960{
29612961 if (isReplaced()) {
2962  computePositionedLogicalHeightReplaced(computedValues);
2963  return;
 2962 // FIXME: For regions with height auto, we want to compute width using the normal block sizing code.
 2963 // For now, regions are replaced elements and this code can be removed once the RenderRegion
 2964 // will inherit from RenderBlock instead of RenderReplaced.
 2965 // (see https://bugs.webkit.org/show_bug.cgi?id=74132 )
 2966 if (!isRenderRegion() || (isRenderRegion() && shouldComputeSizeAsReplaced())) {
 2967 computePositionedLogicalHeightReplaced(computedValues);
 2968 return;
 2969 }
29642970 }
29652971
29662972 // The following is based off of the W3C Working Draft from April 11, 2006 of

Source/WebCore/rendering/RenderRegion.h

@@public:
114114 // or columns added together.
115115 virtual LayoutUnit logicalHeightOfAllFlowThreadContent() const;
116116
117  bool shouldHaveAutoLogicalHeight() const
118  {
119  bool hasSpecifiedEndpointsForHeight = style()->logicalTop().isSpecified() && style()->logicalBottom().isSpecified();
120  bool hasAnchoredEndpointsForHeight = isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight;
121  return style()->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
122  }
123117 bool hasAutoLogicalHeight() const { return m_hasAutoLogicalHeight; }
124118
125119 bool needsOverrideLogicalContentHeightComputation() const;

@@private:
152146 // FIXME: these functions should be revisited once RenderRegion inherits from RenderBlock
153147 // instead of RenderReplaced (see https://bugs.webkit.org/show_bug.cgi?id=74132 )
154148 // When width is auto, use normal block/box sizing code except when inline.
155  virtual bool isInlineBlockOrInlineTable() const OVERRIDE { return isInline() && style()->logicalWidth().isAuto(); }
156  virtual bool shouldComputeSizeAsReplaced() const OVERRIDE { return !style()->logicalWidth().isAuto(); }
 149 virtual bool isInlineBlockOrInlineTable() const OVERRIDE { return isInline() && !shouldComputeSizeAsReplaced(); }
 150 virtual bool shouldComputeSizeAsReplaced() const OVERRIDE { return !style()->logicalWidth().isAuto() && !style()->logicalHeight().isAuto(); }
 151
 152 bool shouldHaveAutoLogicalHeight() const
 153 {
 154 bool hasSpecifiedEndpointsForHeight = style()->logicalTop().isSpecified() && style()->logicalBottom().isSpecified();
 155 bool hasAnchoredEndpointsForHeight = isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight;
 156 return style()->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
 157 }
157158
158159 virtual void insertedIntoTree() OVERRIDE;
159160 virtual void willBeRemovedFromTree() OVERRIDE;