Title: [123785] trunk
- Revision
- 123785
- Author
- [email protected]
- Date
- 2012-07-26 13:10:26 -0700 (Thu, 26 Jul 2012)
Log Message
<svg> element with no intrinsic size and max-width gets sized incorrectly
https://bugs.webkit.org/show_bug.cgi?id=92410
Reviewed by Dean Jackson.
Source/WebCore:
Test: svg/css/max-width-2.html
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeReplacedLogicalWidth): The rule for computing the width for
elements whose computed width and height are both auto and which have no intrinsic size, but
have an intrinsic ratio was applied only to elements with a content renderer (such as <img>
with an SVG source). Removed the requirement to have a content renderer, so that it will
apply to all elements including <svg>.
LayoutTests:
* svg/css/max-width-2-expected.html: Added.
* svg/css/max-width-2.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (123784 => 123785)
--- trunk/LayoutTests/ChangeLog 2012-07-26 20:02:06 UTC (rev 123784)
+++ trunk/LayoutTests/ChangeLog 2012-07-26 20:10:26 UTC (rev 123785)
@@ -1,3 +1,13 @@
+2012-07-26 Dan Bernstein <[email protected]>
+
+ <svg> element with no intrinsic size and max-width gets sized incorrectly
+ https://bugs.webkit.org/show_bug.cgi?id=92410
+
+ Reviewed by Dean Jackson.
+
+ * svg/css/max-width-2-expected.html: Added.
+ * svg/css/max-width-2.html: Added.
+
2012-07-26 Tony Chang <[email protected]>
Regression: r123696 made css3/flexbox tests failing
Added: trunk/LayoutTests/svg/css/max-width-2-expected.html (0 => 123785)
--- trunk/LayoutTests/svg/css/max-width-2-expected.html (rev 0)
+++ trunk/LayoutTests/svg/css/max-width-2-expected.html 2012-07-26 20:10:26 UTC (rev 123785)
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<div style="outline: dashed lightblue; height: 300px; width: 400px;">
+ <svg style="background-color: yellow;" width="400" height="133" viewBox="0 0 900 300">
+ <rect x="0" y="0" width="900" height="300" />
+ </svg>
+</div>
Added: trunk/LayoutTests/svg/css/max-width-2.html (0 => 123785)
--- trunk/LayoutTests/svg/css/max-width-2.html (rev 0)
+++ trunk/LayoutTests/svg/css/max-width-2.html 2012-07-26 20:10:26 UTC (rev 123785)
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<div style="outline: dashed lightblue; height: 300px; width: 400px;">
+ <svg style="background-color: yellow; max-width: 100%; max-height: 100%;" width="100%" height="100%" viewBox="0 0 900 300">
+ <rect x="0" y="0" width="900" height="300" />
+ </svg>
+</div>
Modified: trunk/Source/WebCore/ChangeLog (123784 => 123785)
--- trunk/Source/WebCore/ChangeLog 2012-07-26 20:02:06 UTC (rev 123784)
+++ trunk/Source/WebCore/ChangeLog 2012-07-26 20:10:26 UTC (rev 123785)
@@ -1,3 +1,19 @@
+2012-07-26 Dan Bernstein <[email protected]>
+
+ <svg> element with no intrinsic size and max-width gets sized incorrectly
+ https://bugs.webkit.org/show_bug.cgi?id=92410
+
+ Reviewed by Dean Jackson.
+
+ Test: svg/css/max-width-2.html
+
+ * rendering/RenderReplaced.cpp:
+ (WebCore::RenderReplaced::computeReplacedLogicalWidth): The rule for computing the width for
+ elements whose computed width and height are both auto and which have no intrinsic size, but
+ have an intrinsic ratio was applied only to elements with a content renderer (such as <img>
+ with an SVG source). Removed the requirement to have a content renderer, so that it will
+ apply to all elements including <svg>.
+
2012-07-26 Tony Chang <[email protected]>
Regression: r123696 made css3/flexbox tests failing
Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (123784 => 123785)
--- trunk/Source/WebCore/rendering/RenderReplaced.cpp 2012-07-26 20:02:06 UTC (rev 123784)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp 2012-07-26 20:10:26 UTC (rev 123785)
@@ -365,7 +365,7 @@
// If 'height' and 'width' both have computed values of 'auto' and the element has an intrinsic ratio but no intrinsic height or width, then the used value of
// 'width' is undefined in CSS 2.1. However, it is suggested that, if the containing block's width does not itself depend on the replaced element's width, then
// the used value of 'width' is calculated from the constraint equation used for block-level, non-replaced elements in normal flow.
- if (heightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight && contentRenderer) {
+ if (heightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight) {
// The aforementioned 'constraint equation' used for block-level, non-replaced elements in normal flow:
// 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
LayoutUnit logicalWidth;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes