Title: [136347] trunk
- Revision
- 136347
- Author
- [email protected]
- Date
- 2012-12-02 09:25:18 -0800 (Sun, 02 Dec 2012)
Log Message
Bad rendering of web page because of image's height is set to 100%
https://bugs.webkit.org/show_bug.cgi?id=28035
Reviewed by Eric Seidel.
Source/WebCore:
Call computeReplacedLogicalHeight() to get the correct logical height of a replaced element
for calculating the element's width. RenderBox::computeLogicalHeightUsing() is a helper function designed for finding
the min and max height values and is not the way to find the actual used height of a replaced element.
WebKit's quirks-mode behaviour for the test case is unaffected by this change.
Tests: fast/css/computed-image-width-with-percent-height-quirksmode.html
fast/css/computed-image-width-with-percent-height.html
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeReplacedLogicalWidth):
LayoutTests:
* fast/css/computed-image-width-with-percent-height-expected.html: Added.
* fast/css/computed-image-width-with-percent-height-quirksmode-expected.html: Added.
* fast/css/computed-image-width-with-percent-height-quirksmode.html: Added.
* fast/css/computed-image-width-with-percent-height.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (136346 => 136347)
--- trunk/LayoutTests/ChangeLog 2012-12-02 15:35:24 UTC (rev 136346)
+++ trunk/LayoutTests/ChangeLog 2012-12-02 17:25:18 UTC (rev 136347)
@@ -1,3 +1,15 @@
+2012-12-02 Robert Hogan <[email protected]>
+
+ Bad rendering of web page because of image's height is set to 100%
+ https://bugs.webkit.org/show_bug.cgi?id=28035
+
+ Reviewed by Eric Seidel.
+
+ * fast/css/computed-image-width-with-percent-height-expected.html: Added.
+ * fast/css/computed-image-width-with-percent-height-quirksmode-expected.html: Added.
+ * fast/css/computed-image-width-with-percent-height-quirksmode.html: Added.
+ * fast/css/computed-image-width-with-percent-height.html: Added.
+
2012-12-02 Mihnea Ovidenie <[email protected]>
[CSS Regions] regionlayoutupdate event fires continuously
Added: trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-expected.html (0 => 136347)
--- trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-expected.html (rev 0)
+++ trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-expected.html 2012-12-02 17:25:18 UTC (rev 136347)
@@ -0,0 +1,14 @@
+<!DOCTYPE>
+<html>
+<head>
+ <style>
+ div { height:25px; width: 25px; background: lime;}
+ </style>
+</head>
+<body>
+ The square below should be 25px by 25px.
+ <!-- https://bugs.webkit.org/show_bug.cgi?id=28035 -->
+ <div></div>
+</body>
+</html>
+
Added: trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-quirksmode-expected.txt (0 => 136347)
--- trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-quirksmode-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-quirksmode-expected.txt 2012-12-02 17:25:18 UTC (rev 136347)
@@ -0,0 +1,2 @@
+
+PASSED
Added: trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-quirksmode.html (0 => 136347)
--- trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-quirksmode.html (rev 0)
+++ trunk/LayoutTests/fast/css/computed-image-width-with-percent-height-quirksmode.html 2012-12-02 17:25:18 UTC (rev 136347)
@@ -0,0 +1,32 @@
+<!DOCTYPE>
+<html>
+<head>
+ <!-- https://bugs.webkit.org/show_bug.cgi?id=28035 -->
+ <!-- In quirks mode, an image with height set to 100% should expand to fill the height of the body of the document. -->
+ <style>
+ img { height:100%; }
+ </style>
+ <script type="text/_javascript_">
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function run() {
+ testHeight = window.getComputedStyle(document.getElementById("image"), null).getPropertyValue("height");
+ referenceHeight = window.getComputedStyle(document.getElementById("body"), null).getPropertyValue("height");
+ if (testHeight == referenceHeight)
+ document.getElementById("console").innerText = "PASSED";
+ else
+ document.getElementById("console").innerText = "FAILED: testHeight=" + testHeight +"; expected " + referenceHeight;
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+ </script>
+</head>
+<body id="body" _onload_="setTimeout('run()', 0);">
+ <img id="image" src=""
+ <div id="console"/>
+</body>
+</html>
+
Added: trunk/LayoutTests/fast/css/computed-image-width-with-percent-height.html (0 => 136347)
--- trunk/LayoutTests/fast/css/computed-image-width-with-percent-height.html (rev 0)
+++ trunk/LayoutTests/fast/css/computed-image-width-with-percent-height.html 2012-12-02 17:25:18 UTC (rev 136347)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <style>
+ img { height:100%; }
+ </style>
+</head>
+<body>
+ The square below should be 25px by 25px.
+ <!-- https://bugs.webkit.org/show_bug.cgi?id=28035 -->
+ <!-- In strict mode, an image with height set to 100% should expand to its instrinsic height and width. -->
+ <br>
+ <img src=""
+</body>
+</html>
+
Modified: trunk/Source/WebCore/ChangeLog (136346 => 136347)
--- trunk/Source/WebCore/ChangeLog 2012-12-02 15:35:24 UTC (rev 136346)
+++ trunk/Source/WebCore/ChangeLog 2012-12-02 17:25:18 UTC (rev 136347)
@@ -1,3 +1,22 @@
+2012-12-02 Robert Hogan <[email protected]>
+
+ Bad rendering of web page because of image's height is set to 100%
+ https://bugs.webkit.org/show_bug.cgi?id=28035
+
+ Reviewed by Eric Seidel.
+
+ Call computeReplacedLogicalHeight() to get the correct logical height of a replaced element
+ for calculating the element's width. RenderBox::computeLogicalHeightUsing() is a helper function designed for finding
+ the min and max height values and is not the way to find the actual used height of a replaced element.
+
+ WebKit's quirks-mode behaviour for the test case is unaffected by this change.
+
+ Tests: fast/css/computed-image-width-with-percent-height-quirksmode.html
+ fast/css/computed-image-width-with-percent-height.html
+
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::computeReplacedLogicalWidth):
+
2012-12-02 Mihnea Ovidenie <[email protected]>
[CSS Regions] regionlayoutupdate event fires continuously
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (136346 => 136347)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2012-12-02 15:35:24 UTC (rev 136346)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2012-12-02 17:25:18 UTC (rev 136347)
@@ -363,7 +363,7 @@
// or if 'width' has a computed value of 'auto', 'height' has some other computed value, and the element does have an intrinsic ratio; then the used value
// of 'width' is: (used height) * (intrinsic ratio)
if (intrinsicRatio && ((heightIsAuto && !hasIntrinsicWidth && hasIntrinsicHeight) || !heightIsAuto)) {
- LayoutUnit logicalHeight = computeReplacedLogicalHeightUsing(MainOrPreferredSize, style()->logicalHeight());
+ LayoutUnit logicalHeight = computeReplacedLogicalHeight();
return computeReplacedLogicalWidthRespectingMinMaxWidth(roundToInt(round(logicalHeight * intrinsicRatio)));
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes