Title: [139548] trunk
- Revision
- 139548
- Author
- [email protected]
- Date
- 2013-01-12 04:59:55 -0800 (Sat, 12 Jan 2013)
Log Message
Available height should respect min and max height
https://bugs.webkit.org/show_bug.cgi?id=106479
Source/WebCore:
Reviewed by Ojan Vafai.
When calculating a relative positioned block's offset as a percentage of its container, respect the min
and max height set on the container
Tests: fast/block/percent-top-respects-max-height.html
fast/block/percent-top-respects-min-height.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::availableLogicalHeight):
LayoutTests:
Reviewed by Ojan Vafai.
* fast/block/percent-top-respects-max-height-expected.txt: Added.
* fast/block/percent-top-respects-max-height.html: Added.
* fast/block/percent-top-respects-min-height-expected.txt: Added.
* fast/block/percent-top-respects-min-height.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (139547 => 139548)
--- trunk/LayoutTests/ChangeLog 2013-01-12 12:04:56 UTC (rev 139547)
+++ trunk/LayoutTests/ChangeLog 2013-01-12 12:59:55 UTC (rev 139548)
@@ -1,3 +1,15 @@
+2013-01-12 Robert Hogan <[email protected]>
+
+ Available height should respect min and max height
+ https://bugs.webkit.org/show_bug.cgi?id=106479
+
+ Reviewed by Ojan Vafai.
+
+ * fast/block/percent-top-respects-max-height-expected.txt: Added.
+ * fast/block/percent-top-respects-max-height.html: Added.
+ * fast/block/percent-top-respects-min-height-expected.txt: Added.
+ * fast/block/percent-top-respects-min-height.html: Added.
+
2013-01-12 Victor Carbune <[email protected]>
CC Button doesn't always show up
Added: trunk/LayoutTests/fast/block/percent-top-respects-max-height-expected.txt (0 => 139548)
--- trunk/LayoutTests/fast/block/percent-top-respects-max-height-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/block/percent-top-respects-max-height-expected.txt 2013-01-12 12:59:55 UTC (rev 139548)
@@ -0,0 +1,3 @@
+https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.
+
+PASS
Added: trunk/LayoutTests/fast/block/percent-top-respects-max-height.html (0 => 139548)
--- trunk/LayoutTests/fast/block/percent-top-respects-max-height.html (rev 0)
+++ trunk/LayoutTests/fast/block/percent-top-respects-max-height.html 2013-01-12 12:59:55 UTC (rev 139548)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { width: 250px; }
+ .container {:
+ background: green;
+ position: relative;
+ height: 600px;
+ max-height: 300px;
+ }
+ .box {:
+ height: 100px;
+ position: relative;
+ top: 50%;
+ background: blue;
+ }
+ .ref {:
+ height: 100px;
+ position: absolute;
+ top: 150px;
+ background: red;
+ }
+ </style>
+ <script src=""
+ </head>
+
+ <body>
+ <p>https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.</p>
+ <div class="container">
+ <div class="ref"></div>
+ <div class="box" data-total-y="150"></div>
+ </div>
+ <script>
+ checkLayout('.box')
+ </script>
+ </body>
+</html>
Added: trunk/LayoutTests/fast/block/percent-top-respects-min-height-expected.txt (0 => 139548)
--- trunk/LayoutTests/fast/block/percent-top-respects-min-height-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/block/percent-top-respects-min-height-expected.txt 2013-01-12 12:59:55 UTC (rev 139548)
@@ -0,0 +1,3 @@
+https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.
+
+PASS
Added: trunk/LayoutTests/fast/block/percent-top-respects-min-height.html (0 => 139548)
--- trunk/LayoutTests/fast/block/percent-top-respects-min-height.html (rev 0)
+++ trunk/LayoutTests/fast/block/percent-top-respects-min-height.html 2013-01-12 12:59:55 UTC (rev 139548)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { width: 250px; }
+ .container {:
+ background: green;
+ position: relative;
+ height: 50px;
+ min-height: 300px;
+ }
+ .box {:
+ height: 100px;
+ position: relative;
+ top: 50%;
+ background: blue;
+ }
+ .ref {:
+ height: 100px;
+ position: absolute;
+ top: 150px;
+ background: red;
+ }
+ </style>
+ <script src=""
+ </head>
+
+ <body>
+ <p>https://bugs.webkit.org/show_bug.cgi?id=106479: There should be no red below.</p>
+ <div class="container">
+ <div class="ref"></div>
+ <div class="box" data-total-y="150"></div>
+ </div>
+ <script>
+ checkLayout('.box')
+ </script>
+ </body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (139547 => 139548)
--- trunk/Source/WebCore/ChangeLog 2013-01-12 12:04:56 UTC (rev 139547)
+++ trunk/Source/WebCore/ChangeLog 2013-01-12 12:59:55 UTC (rev 139548)
@@ -1,3 +1,19 @@
+2013-01-12 Robert Hogan <[email protected]>
+
+ Available height should respect min and max height
+ https://bugs.webkit.org/show_bug.cgi?id=106479
+
+ Reviewed by Ojan Vafai.
+
+ When calculating a relative positioned block's offset as a percentage of its container, respect the min
+ and max height set on the container
+
+ Tests: fast/block/percent-top-respects-max-height.html
+ fast/block/percent-top-respects-min-height.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::availableLogicalHeight):
+
2013-01-12 Victor Carbune <[email protected]>
CC Button doesn't always show up
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (139547 => 139548)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2013-01-12 12:04:56 UTC (rev 139547)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2013-01-12 12:59:55 UTC (rev 139548)
@@ -2627,7 +2627,7 @@
LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const
{
- return availableLogicalHeightUsing(style()->logicalHeight(), heightType);
+ return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style()->logicalHeight(), heightType));
}
LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes