<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171480] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171480">171480</a></dd>
<dt>Author</dt> <dd>bjonesbe@adobe.com</dd>
<dt>Date</dt> <dd>2014-07-23 10:56:18 -0700 (Wed, 23 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Ensure we compute the min and max height of replaced elements to 'none' or 0 when appropriate.
https://bugs.webkit.org/show_bug.cgi?id=135181

Reviewed by David Hyatt.

Source/WebCore:
If a replaced element has a percentage min or max height specified then that height value should
compute to 'none' for max-height and 0 for min-height when its containing block
does not have a height 'specified explicitly'.

This is based on a Blink patch by Robert Hogan.

Tests: css2.1/20110323/max-height-percentage-003.html
       fast/replaced/max-height-percentage-quirks.html
       fast/replaced/min-height-percentage-quirks.html
       fast/replaced/min-height-percentage.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::logicalHeightComputesAsNone):
(WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
* rendering/RenderBox.h:

LayoutTests:
* css2.1/20110323/max-height-percentage-003-expected.html: Added.
* css2.1/20110323/max-height-percentage-003.html: Added.
* fast/replaced/max-height-percentage-quirks-expected.html: Added.
* fast/replaced/max-height-percentage-quirks.html: Added.
* fast/replaced/min-height-percentage-expected.html: Added.
* fast/replaced/min-height-percentage-quirks-expected.html: Added.
* fast/replaced/min-height-percentage-quirks.html: Added.
* fast/replaced/min-height-percentage.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxh">trunk/Source/WebCore/rendering/RenderBox.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss2120110323maxheightpercentage003expectedhtml">trunk/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html</a></li>
<li><a href="#trunkLayoutTestscss2120110323maxheightpercentage003html">trunk/LayoutTests/css2.1/20110323/max-height-percentage-003.html</a></li>
<li><a href="#trunkLayoutTestsfastreplacedmaxheightpercentagequirksexpectedhtml">trunk/LayoutTests/fast/replaced/max-height-percentage-quirks-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastreplacedmaxheightpercentagequirkshtml">trunk/LayoutTests/fast/replaced/max-height-percentage-quirks.html</a></li>
<li><a href="#trunkLayoutTestsfastreplacedminheightpercentageexpectedhtml">trunk/LayoutTests/fast/replaced/min-height-percentage-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastreplacedminheightpercentagequirksexpectedhtml">trunk/LayoutTests/fast/replaced/min-height-percentage-quirks-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastreplacedminheightpercentagequirkshtml">trunk/LayoutTests/fast/replaced/min-height-percentage-quirks.html</a></li>
<li><a href="#trunkLayoutTestsfastreplacedminheightpercentagehtml">trunk/LayoutTests/fast/replaced/min-height-percentage.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (171479 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-23 17:35:29 UTC (rev 171479)
+++ trunk/LayoutTests/ChangeLog        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-07-23  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
+
+        Ensure we compute the min and max height of replaced elements to 'none' or 0 when appropriate.
+        https://bugs.webkit.org/show_bug.cgi?id=135181
+
+        Reviewed by David Hyatt.
+
+        * css2.1/20110323/max-height-percentage-003-expected.html: Added.
+        * css2.1/20110323/max-height-percentage-003.html: Added.
+        * fast/replaced/max-height-percentage-quirks-expected.html: Added.
+        * fast/replaced/max-height-percentage-quirks.html: Added.
+        * fast/replaced/min-height-percentage-expected.html: Added.
+        * fast/replaced/min-height-percentage-quirks-expected.html: Added.
+        * fast/replaced/min-height-percentage-quirks.html: Added.
+        * fast/replaced/min-height-percentage.html: Added.
+
</ins><span class="cx"> 2014-07-23  Mihnea Ovidenie  &lt;mihnea@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ASSERTION FAILED: generatingElement() in WebCore::RenderNamedFlowFragment::regionOversetState
</span></span></pre></div>
<a id="trunkLayoutTestscss2120110323maxheightpercentage003expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html                                (rev 0)
+++ trunk/LayoutTests/css2.1/20110323/max-height-percentage-003-expected.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+  &lt;p&gt;Test passes if there is a filled black square.&lt;/p&gt;
+
+  &lt;div id=&quot;parent&quot;&gt;
+    &lt;img src=&quot;support/black96x96.png&quot; alt=&quot;Image download support must be enabled&quot;&gt;
+  &lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss2120110323maxheightpercentage003html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css2.1/20110323/max-height-percentage-003.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css2.1/20110323/max-height-percentage-003.html                                (rev 0)
+++ trunk/LayoutTests/css2.1/20110323/max-height-percentage-003.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
+&lt;html&gt;
+
+ &lt;head&gt;
+
+  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
+
+  &lt;title&gt;CSS Test: max-height percentage - inline replaced element inside an auto-height container&lt;/title&gt;
+
+  &lt;link rel=&quot;author&quot; title=&quot;GĂ©rard Talbot&quot; href=&quot;http://www.gtalbot.org/BrowserBugsSection/css21testsuite/&quot;&gt;
+
+  &lt;!--
+  Original post:
+  Image % sizing interoperability
+  from Bogdan Brinza who deserves credit for reporting this
+  http://lists.w3.org/Archives/Public/www-style/2014Jun/0079.html
+  --&gt;
+
+  &lt;link rel=&quot;help&quot; href=&quot;http://www.w3.org/TR/CSS21/visudet.html#min-max-heights&quot; title=&quot;10.7 Minimum and maximum heights: 'min-height' and 'max-height'&quot;&gt;
+  &lt;link rel=&quot;bookmark&quot; href=&quot;http://lists.w3.org/Archives/Public/www-style/2014Jun/0079.html&quot; title=&quot;Image % sizing interoperability&quot;&gt;
+  &lt;link rel=&quot;match&quot; href=&quot;reference/ref-filled-black-96px-square.htm&quot;&gt;
+
+  &lt;meta content=&quot;image&quot; name=&quot;flags&quot;&gt;
+  &lt;meta content=&quot;This test checks that a max-height percentage is calculated with respect to the height of the generated box's containing block only if and only when such containing block's height is specified explicitly (i.e., it depends on content height; its specified height is not 'auto'). In this test, the div#child has an 'auto' height; therefore the max-height percentage is treated as 'none' and so the image should be rendered (entirely visible) inside that div#child. Note that div#parent's initial overflow value is 'visible'.&quot; name=&quot;assert&quot;&gt;
+
+  &lt;style type=&quot;text/css&quot;&gt;
+  div#parent {height: 0px;}
+
+  img {max-height: 100%;}
+  &lt;/style&gt;
+
+ &lt;/head&gt;
+
+ &lt;body&gt;
+
+  &lt;p&gt;Test passes if there is a filled black square.&lt;/p&gt;
+
+  &lt;div id=&quot;parent&quot;&gt;
+    &lt;div id=&quot;child&quot;&gt;&lt;img src=&quot;support/black96x96.png&quot; alt=&quot;Image download support must be enabled&quot;&gt;&lt;/div&gt;
+  &lt;/div&gt;
+
+ &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastreplacedmaxheightpercentagequirksexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/replaced/max-height-percentage-quirks-expected.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/replaced/max-height-percentage-quirks-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/replaced/max-height-percentage-quirks-expected.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;p&gt;Test passes if there is a filled blue square.&lt;/p&gt;
+&lt;div id=&quot;parent&quot;&gt;
+    &lt;div id=&quot;child&quot;&gt;&lt;img src=&quot;resources/square-blue-100x100.png&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastreplacedmaxheightpercentagequirkshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/replaced/max-height-percentage-quirks.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/replaced/max-height-percentage-quirks.html                                (rev 0)
+++ trunk/LayoutTests/fast/replaced/max-height-percentage-quirks.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;style&gt;
+    div#parent {height: 0px;}
+    img {max-height: 100%;}
+&lt;/style&gt;
+&lt;p&gt;Test passes if there is a filled blue square.&lt;/p&gt;
+&lt;div id=&quot;parent&quot;&gt;
+    &lt;div id=&quot;child&quot;&gt;&lt;img src=&quot;resources/square-blue-100x100.png&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastreplacedminheightpercentageexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/replaced/min-height-percentage-expected.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/replaced/min-height-percentage-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/replaced/min-height-percentage-expected.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+    &lt;style&gt;
+        img { height: 50px;}
+    &lt;/style&gt;
+    &lt;p&gt; The blue square should be 50px by 50px. This is because http://www.w3.org/TR/CSS21/visudet.html#min-max-heights says: &quot;If the height of the containing block is not specified explicitly 
+          (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as '0' (for 'min-height').&quot; &lt;/p&gt;
+    &lt;div&gt;
+        &lt;img id=&quot;image&quot; src=&quot;resources/square-blue-100x100.png&quot;&gt;
+    &lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastreplacedminheightpercentagequirksexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/replaced/min-height-percentage-quirks-expected.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/replaced/min-height-percentage-quirks-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/replaced/min-height-percentage-quirks-expected.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;style&gt;
+    img {height: 50px;}
+&lt;/style&gt;
+&lt;p&gt; The blue square should be 50px by 50px. This is because http://www.w3.org/TR/CSS21/visudet.html#min-max-heights says: &quot;If the height of the containing block is not specified explicitly 
+(i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as '0' (for 'min-height').&quot; &lt;/p&gt;
+&lt;div&gt;
+    &lt;div id=&quot;child&quot;&gt;&lt;img id=&quot;image&quot; src=&quot;resources/square-blue-100x100.png&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastreplacedminheightpercentagequirkshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/replaced/min-height-percentage-quirks.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/replaced/min-height-percentage-quirks.html                                (rev 0)
+++ trunk/LayoutTests/fast/replaced/min-height-percentage-quirks.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;style&gt;
+    img {min-height: 100%; max-height: 50px;}
+&lt;/style&gt;
+&lt;p&gt; The blue square should be 50px by 50px. This is because http://www.w3.org/TR/CSS21/visudet.html#min-max-heights says: &quot;If the height of the containing block is not specified explicitly 
+(i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as '0' (for 'min-height').&quot; &lt;/p&gt;
+&lt;div&gt;
+    &lt;div id=&quot;child&quot;&gt;&lt;img id=&quot;image&quot; src=&quot;resources/square-blue-100x100.png&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastreplacedminheightpercentagehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/replaced/min-height-percentage.html (0 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/replaced/min-height-percentage.html                                (rev 0)
+++ trunk/LayoutTests/fast/replaced/min-height-percentage.html        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+    &lt;style&gt;
+        img {min-height: 100%; max-height: 50px;}
+    &lt;/style&gt;
+    &lt;p&gt; The blue square should be 50px by 50px. This is because http://www.w3.org/TR/CSS21/visudet.html#min-max-heights says: &quot;If the height of the containing block is not specified explicitly 
+          (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as '0' (for 'min-height').&quot; &lt;/p&gt;
+    &lt;div&gt;
+        &lt;div id=&quot;child&quot;&gt;&lt;img id=&quot;image&quot; src=&quot;resources/square-blue-100x100.png&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171479 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-23 17:35:29 UTC (rev 171479)
+++ trunk/Source/WebCore/ChangeLog        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2014-07-23  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
</span><span class="cx"> 
</span><ins>+        Ensure we compute the min and max height of replaced elements to 'none' or 0 when appropriate.
+        https://bugs.webkit.org/show_bug.cgi?id=135181
+
+        Reviewed by David Hyatt.
+
+        If a replaced element has a percentage min or max height specified then that height value should
+        compute to 'none' for max-height and 0 for min-height when its containing block
+        does not have a height 'specified explicitly'.
+
+        This is based on a Blink patch by Robert Hogan.
+
+        Tests: css2.1/20110323/max-height-percentage-003.html
+               fast/replaced/max-height-percentage-quirks.html
+               fast/replaced/min-height-percentage-quirks.html
+               fast/replaced/min-height-percentage.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::logicalHeightComputesAsNone):
+        (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
+        * rendering/RenderBox.h:
+
+2014-07-23  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
+
</ins><span class="cx">         Remove CSS_EXCLUSIONS compile flag and leftover code
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=135175
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (171479 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2014-07-23 17:35:29 UTC (rev 171479)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -2929,10 +2929,37 @@
</span><span class="cx">     return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLogicalHeightUsing(style().logicalHeight()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool RenderBox::logicalHeightComputesAsNone(SizeType sizeType) const
+{
+    ASSERT(sizeType == MinSize || sizeType == MaxSize);
+    Length logicalHeight = sizeType == MinSize ? style().logicalMinHeight() : style().logicalMaxHeight();
+    Length initialLogicalHeight = sizeType == MinSize ? RenderStyle::initialMinSize() : RenderStyle::initialMaxSize();
+
+    if (logicalHeight == initialLogicalHeight)
+        return true;
+
+    if (!logicalHeight.isPercent() || isOutOfFlowPositioned())
+        return false;
+
+    // Anonymous block boxes are ignored when resolving percentage values that would refer to it:
+    // the closest non-anonymous ancestor box is used instead.
+    RenderBlock* containingBlock = this-&gt;containingBlock();
+    while (containingBlock-&gt;isAnonymous())
+        containingBlock = containingBlock-&gt;containingBlock();
+
+    return containingBlock-&gt;hasAutoHeightOrContainingBlockWithAutoHeight();
+}
+
</ins><span class="cx"> LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const
</span><span class="cx"> {
</span><del>-    LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style().logicalMinHeight());
-    LayoutUnit maxLogicalHeight = style().logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style().logicalMaxHeight());
</del><ins>+    // If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned,
+    // the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height').
+    LayoutUnit minLogicalHeight;
+    if (!logicalHeightComputesAsNone(MinSize))
+        minLogicalHeight = computeReplacedLogicalHeightUsing(style().logicalMinHeight());
+    LayoutUnit maxLogicalHeight = logicalHeight;
+    if (!logicalHeightComputesAsNone(MaxSize))
+        maxLogicalHeight =  computeReplacedLogicalHeightUsing(style().logicalMaxHeight());
</ins><span class="cx">     return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.h (171479 => 171480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.h        2014-07-23 17:35:29 UTC (rev 171479)
+++ trunk/Source/WebCore/rendering/RenderBox.h        2014-07-23 17:56:18 UTC (rev 171480)
</span><span class="lines">@@ -702,6 +702,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual LayoutRect frameRectForStickyPositioning() const override final { return frameRect(); }
</span><span class="cx"> 
</span><ins>+    bool logicalHeightComputesAsNone(SizeType) const;
+
</ins><span class="cx"> private:
</span><span class="cx">     // The width/height of the contents + borders + padding.  The x/y location is relative to our container (which is not always our parent).
</span><span class="cx">     LayoutRect m_frameRect;
</span></span></pre>
</div>
</div>

</body>
</html>