Source/WebCore/ChangeLog

 12013-01-09 Robert Hogan <robert@webkit.org>
 2
 3 Available height should respect min and max height
 4 https://bugs.webkit.org/show_bug.cgi?id=106479
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 When calculating a relative positioned block's offset as a percentage of its container, respect the min
 9 and max height set on the container
 10
 11 Tests: fast/block/percent-top-respects-max-height.html
 12 fast/block/percent-top-respects-min-height.html
 13
 14 * rendering/RenderBox.cpp:
 15 (WebCore::RenderBox::availableLogicalHeight):
 16
1172013-01-08 Robert Hogan <robert@webkit.org>
218
319 REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements

Source/WebCore/rendering/RenderBox.cpp

@@LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(SizeType sizeType, Lengt
26072607
26082608LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const
26092609{
2610  return availableLogicalHeightUsing(style()->logicalHeight(), heightType);
 2610 return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style()->logicalHeight(), heightType));
26112611}
26122612
26132613LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const

LayoutTests/ChangeLog

 12013-01-09 Robert Hogan <robert@webkit.org>
 2
 3 Available height should respect min and max height
 4 https://bugs.webkit.org/show_bug.cgi?id=106479
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/block/percent-top-respects-max-height-expected.txt: Added.
 9 * fast/block/percent-top-respects-max-height.html: Added.
 10 * fast/block/percent-top-respects-min-height-expected.txt: Added.
 11 * fast/block/percent-top-respects-min-height.html: Added.
 12
1132013-01-08 Robert Hogan <robert@webkit.org>
214
315 REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements

LayoutTests/fast/block/percent-top-respects-max-height-expected.txt

 1https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.
 2
 3PASS
 4PASS

LayoutTests/fast/block/percent-top-respects-max-height.html

 1<!DOCTYPE html>
 2<html>
 3 <head>
 4 <style>
 5 div { width: 250px; }
 6 .container {
 7 background: green;
 8 position: relative;
 9 height: 600px;
 10 max-height: 300px;
 11 }
 12 .box {
 13 height: 100px;
 14 position: relative;
 15 top: 50%;
 16 background: blue;
 17 }
 18 .ref {
 19 height: 100px;
 20 position: absolute;
 21 top: 150px;
 22 background: red;
 23 }
 24 </style>
 25 <script src="../../resources/check-layout.js"></script>
 26 </head>
 27
 28 <body>
 29 <p>https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.</p>
 30 <div class="container">
 31 <div id="ref" class="ref"></div>
 32 <div id="box" class="box"></div>
 33 </div>
 34 <script>
 35 document.getElementById("box").setAttribute('data-total-y', 150);
 36 checkLayout('body > div > div')
 37 </script>
 38 </body>
 39</html>

LayoutTests/fast/block/percent-top-respects-min-height-expected.txt

 1https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.
 2
 3PASS
 4PASS

LayoutTests/fast/block/percent-top-respects-min-height.html

 1<!DOCTYPE html>
 2<html>
 3 <head>
 4 <style>
 5 div { width: 250px; }
 6 .container {
 7 background: green;
 8 position: relative;
 9 height: 50px;
 10 min-height: 300px;
 11 }
 12 .box {
 13 height: 100px;
 14 position: relative;
 15 top: 50%;
 16 background: blue;
 17 }
 18 .ref {
 19 height: 100px;
 20 position: absolute;
 21 top: 150px;
 22 background: red;
 23 }
 24 </style>
 25 <script src="../../resources/check-layout.js"></script>
 26 </head>
 27
 28 <body>
 29 <p>https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.</p>
 30 <div class="container">
 31 <div class="ref"></div>
 32 <div id="box" class="box"></div>
 33 </div>
 34 <script>
 35 document.getElementById("box").setAttribute('data-total-y', 150);
 36 checkLayout('body > div > div')
 37 </script>
 38 </body>
 39</html>