Title: [125050] trunk
Revision
125050
Author
[email protected]
Date
2012-08-08 10:46:50 -0700 (Wed, 08 Aug 2012)

Log Message

REGRESSION (r123171): <svg> element with intrinsic size and max-width gets sized incorrectly
https://bugs.webkit.org/show_bug.cgi?id=93388

Reviewed by Beth Dakin.

Source/WebCore: 

Test: svg/css/max-width-3.html

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox): Added code to set
m_intrinsicSize in the no-contentRenderer branch of this function so that the calls to
RenderBox::computeReplacedLogical{Height,Width} in the end use the right intrinsic size.
This is similar to what the contentRenderer branch of this function already does.

LayoutTests: 

* svg/css/max-width-3-expected.html: Added.
* svg/css/max-width-3.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125049 => 125050)


--- trunk/LayoutTests/ChangeLog	2012-08-08 17:38:18 UTC (rev 125049)
+++ trunk/LayoutTests/ChangeLog	2012-08-08 17:46:50 UTC (rev 125050)
@@ -1,3 +1,13 @@
+2012-08-08  Dan Bernstein  <[email protected]>
+
+        REGRESSION (r123171): <svg> element with intrinsic size and max-width gets sized incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=93388
+
+        Reviewed by Beth Dakin.
+
+        * svg/css/max-width-3-expected.html: Added.
+        * svg/css/max-width-3.html: Added.
+
 2012-08-08  Keishi Hattori  <[email protected]>
 
         Make slider tick mark snapping threshold configurable for each platform

Added: trunk/LayoutTests/svg/css/max-width-3-expected.html (0 => 125050)


--- trunk/LayoutTests/svg/css/max-width-3-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/max-width-3-expected.html	2012-08-08 17:46:50 UTC (rev 125050)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<svg style="background-color: red;" width="200" height="500" viewbox="0 0 200 500">
+    <rect x="0" y="0" width="200" height="500" fill="green" />
+</svg>

Added: trunk/LayoutTests/svg/css/max-width-3.html (0 => 125050)


--- trunk/LayoutTests/svg/css/max-width-3.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/max-width-3.html	2012-08-08 17:46:50 UTC (rev 125050)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<svg style="background-color: red; max-width: 500px; max-height: 500px;" width="200" height="500" viewbox="0 0 200 500">
+    <rect x="0" y="0" width="200" height="500" fill="green" />
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (125049 => 125050)


--- trunk/Source/WebCore/ChangeLog	2012-08-08 17:38:18 UTC (rev 125049)
+++ trunk/Source/WebCore/ChangeLog	2012-08-08 17:46:50 UTC (rev 125050)
@@ -1,3 +1,18 @@
+2012-08-08  Dan Bernstein  <[email protected]>
+
+        REGRESSION (r123171): <svg> element with intrinsic size and max-width gets sized incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=93388
+
+        Reviewed by Beth Dakin.
+
+        Test: svg/css/max-width-3.html
+
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox): Added code to set
+        m_intrinsicSize in the no-contentRenderer branch of this function so that the calls to
+        RenderBox::computeReplacedLogical{Height,Width} in the end use the right intrinsic size.
+        This is similar to what the contentRenderer branch of this function already does.
+
 2012-08-08  Keishi Hattori  <[email protected]>
 
         Make slider tick mark snapping threshold configurable for each platform

Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (125049 => 125050)


--- trunk/Source/WebCore/rendering/RenderReplaced.cpp	2012-08-08 17:38:18 UTC (rev 125049)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp	2012-08-08 17:46:50 UTC (rev 125050)
@@ -297,8 +297,11 @@
         }
     } else {
         computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio, isPercentageIntrinsicSize);
-        if (intrinsicRatio)
+        if (intrinsicRatio) {
             ASSERT(!isPercentageIntrinsicSize);
+            if (!intrinsicSize.isEmpty())
+                m_intrinsicSize = isHorizontalWritingMode() ? flooredIntSize(intrinsicSize) : flooredIntSize(intrinsicSize).transposedSize(); // FIXME: This introduces precision errors. We should convert m_intrinsicSize to be a float.
+        }
     }
 
     // Now constrain the intrinsic size along each axis according to minimum and maximum width/heights along the
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to