Title: [118074] trunk
Revision
118074
Author
[email protected]
Date
2012-05-22 15:52:34 -0700 (Tue, 22 May 2012)

Log Message

REGRESSION (r105513): CSS max-width is not applied to SVG element
https://bugs.webkit.org/show_bug.cgi?id=87050

Reviewed by Darin Adler.

Source/WebCore: 

Tests: svg/css/max-height.html
       svg/css/max-width.html

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth): Changed to also call into the base
class implementation of this function if max-width was specified.
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Changed to call into the bas class
implementation of this function if either height or max-height were specified.

LayoutTests: 

* svg/css/max-height-expected.png: Added.
* svg/css/max-height-expected.txt: Added.
* svg/css/max-height.html: Added.
* svg/css/max-width-expected.png: Added.
* svg/css/max-width-expected.txt: Added.
* svg/css/max-width.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (118073 => 118074)


--- trunk/LayoutTests/ChangeLog	2012-05-22 22:49:00 UTC (rev 118073)
+++ trunk/LayoutTests/ChangeLog	2012-05-22 22:52:34 UTC (rev 118074)
@@ -1,3 +1,17 @@
+2012-05-22  Dan Bernstein  <[email protected]>
+
+        REGRESSION (r105513): CSS max-width is not applied to SVG element
+        https://bugs.webkit.org/show_bug.cgi?id=87050
+
+        Reviewed by Darin Adler.
+
+        * svg/css/max-height-expected.png: Added.
+        * svg/css/max-height-expected.txt: Added.
+        * svg/css/max-height.html: Added.
+        * svg/css/max-width-expected.png: Added.
+        * svg/css/max-width-expected.txt: Added.
+        * svg/css/max-width.html: Added.
+
 2012-05-22  Emil A Eklund  <[email protected]>
 
         Unreviewed chromium test_expectations update, added bug number for a couple of skipped tests.

Added: trunk/LayoutTests/svg/css/max-height-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/svg/css/max-height-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/svg/css/max-height-expected.txt (0 => 118074)


--- trunk/LayoutTests/svg/css/max-height-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/css/max-height-expected.txt	2012-05-22 22:52:34 UTC (rev 118074)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderSVGRoot {svg} at (158,8) size 100x100
+        RenderSVGRect {rect} at (158,8) size 100x100 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=400.00] [height=400.00]
+      RenderText {#text} at (0,0) size 0x0

Added: trunk/LayoutTests/svg/css/max-height.html (0 => 118074)


--- trunk/LayoutTests/svg/css/max-height.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/max-height.html	2012-05-22 22:52:34 UTC (rev 118074)
@@ -0,0 +1,6 @@
+<style>
+    svg { max-height: 100px; }
+</style>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400px" height="400px" viewBox="0 0 400 400">
+    <rect x="0" y="0" width="400" height="400"/>
+</svg>

Added: trunk/LayoutTests/svg/css/max-width-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/svg/css/max-width-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/svg/css/max-width-expected.txt (0 => 118074)


--- trunk/LayoutTests/svg/css/max-width-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/css/max-width-expected.txt	2012-05-22 22:52:34 UTC (rev 118074)
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderSVGRoot {svg} at (8,158) size 100x100
+        RenderSVGRect {rect} at (8,158) size 100x100 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=400.00] [height=400.00]
+      RenderText {#text} at (0,0) size 0x0

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


--- trunk/LayoutTests/svg/css/max-width.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/max-width.html	2012-05-22 22:52:34 UTC (rev 118074)
@@ -0,0 +1,6 @@
+<style>
+    svg { max-width: 100px; }
+</style>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400px" height="400px" viewBox="0 0 400 400">
+    <rect x="0" y="0" width="400" height="400"/>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (118073 => 118074)


--- trunk/Source/WebCore/ChangeLog	2012-05-22 22:49:00 UTC (rev 118073)
+++ trunk/Source/WebCore/ChangeLog	2012-05-22 22:52:34 UTC (rev 118074)
@@ -1,3 +1,19 @@
+2012-05-22  Dan Bernstein  <[email protected]>
+
+        REGRESSION (r105513): CSS max-width is not applied to SVG element
+        https://bugs.webkit.org/show_bug.cgi?id=87050
+
+        Reviewed by Darin Adler.
+
+        Tests: svg/css/max-height.html
+               svg/css/max-width.html
+
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): Changed to also call into the base
+        class implementation of this function if max-width was specified.
+        (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Changed to call into the bas class
+        implementation of this function if either height or max-height were specified.
+
 2012-05-22  Kentaro Hara  <[email protected]>
 
         [V8] Pass Isolate to throwTypeError()

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (118073 => 118074)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2012-05-22 22:49:00 UTC (rev 118073)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2012-05-22 22:52:34 UTC (rev 118074)
@@ -167,7 +167,7 @@
     if (!m_containerSize.isEmpty())
         return m_containerSize.width();
 
-    if (style()->logicalWidth().isSpecified())
+    if (style()->logicalWidth().isSpecified() || style()->logicalMaxWidth().isSpecified())
         return RenderReplaced::computeReplacedLogicalWidth(includeMaxWidth);
 
     if (svg->widthAttributeEstablishesViewport())
@@ -187,7 +187,7 @@
     if (!m_containerSize.isEmpty())
         return m_containerSize.height();
 
-    if (hasReplacedLogicalHeight())
+    if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().isSpecified())
         return RenderReplaced::computeReplacedLogicalHeight();
 
     if (svg->heightAttributeEstablishesViewport()) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to