Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
REGRESSION(r143102): iframe with percentage height within table with …
…anonymous cell fails. https://bugs.webkit.org/show_bug.cgi?id=113077 Source/WebCore: Patch by Zalan Bujtas <zalan@apple.com> on 2013-03-27 Reviewed by Antti Koivisto. http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level "Anonymous block boxes are ignored when resolving percentage values that would refer to it: the closest non-anonymous ancestor box is used instead." When figuring out whether auto height needs to be applied on the current box, ignore anonymous ancestors until the first non-anonymous containing block is found. This matches both Firefox and Opera behaviour. Test: fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight): Switch from isAnonymousBlock() to isAnonymous() to make sure all anonymous boxes are ignored. Remove isTableCell() check which is a noop as table cell isn't an anonymous block. LayoutTests: Patch by Zalan Bujtas <zalan@apple.com> on 2013-03-27 Reviewed by Antti Koivisto. * fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell-expected.txt: Added. * fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html: Added. Canonical link: https://commits.webkit.org/131762@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
112 additions
and 4 deletions.
- +10 −0 LayoutTests/ChangeLog
- +10 −0 ...s/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell-expected.txt
- +68 −0 LayoutTests/fast/replaced/iframe-with-percentage-height-within-table-with-anonymous-table-cell.html
- +21 −0 Source/WebCore/ChangeLog
- +3 −4 Source/WebCore/rendering/RenderBoxModelObject.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,10 @@ | ||
This test checks that iframe with percentage height within anonymous table cell has the correct height (strict mode). | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS getHeight('iframe-100') is window.innerHeight | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,68 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<title>Test for embedded iframe with height: 100% and anonymous table cell parent.</title> | ||
<script src="../js/resources/js-test-pre.js"></script> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.waitUntilDone(); | ||
testRunner.dumpAsText(); | ||
} | ||
|
||
function getComputedStyleForElement(element, cssPropertyName) | ||
{ | ||
if (!element) { | ||
return null; | ||
} | ||
if (window.getComputedStyle) { | ||
return window.getComputedStyle(element, '').getPropertyValue(cssPropertyName.replace(/([A-Z])/g, "-$1").toLowerCase()); | ||
} | ||
if (element.currentStyle) { | ||
return element.currentStyle[cssPropertyName]; | ||
} | ||
return null; | ||
} | ||
|
||
function parsePixelValue(str) | ||
{ | ||
if (typeof str != "string" || str.length < 3 || str.substr(str.length - 2) != "px") { | ||
testFailed(str + " is unparsable."); | ||
return -1; | ||
} | ||
return parseFloat(str); | ||
} | ||
|
||
function getHeight(id) | ||
{ | ||
return parsePixelValue(getComputedStyleForElement(document.getElementById(id), 'height')); | ||
} | ||
|
||
function test() | ||
{ | ||
description("This test checks that iframe with percentage height within anonymous table cell has the correct height (strict mode)."); | ||
|
||
shouldBe("getHeight('iframe-100')", "window.innerHeight"); | ||
|
||
isSuccessfullyParsed(); | ||
|
||
if (window.testRunner) { | ||
testRunner.notifyDone(); | ||
} | ||
} | ||
</script> | ||
<style> | ||
html, body { | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body onload="test()"> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
|
||
<div style="display:table; height: 100%;"> | ||
<div style="display:table-row; height: 100%;"> | ||
<iframe id="iframe-100" frameborder="0px" style="height: 100%;" src=""></iframe> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters