<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171341] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171341">171341</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-22 06:27:38 -0700 (Tue, 22 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Turn width/height to presentation attributes
https://bugs.webkit.org/show_bug.cgi?id=135046

Patch by Dirk Schulze &lt;krit@webkit.org&gt; on 2014-07-18
Reviewed by Dean Jackson.

Source/WebCore:
The elements &lt;svg&gt;, &lt;image&gt;, &lt;pattern&gt;, &lt;mask&gt; and &lt;foreignObject&gt; have the
'width' and 'height' attributes. So far they can just be set by SVG DOM or
setAttribute. Furthermore, animations just work with SVG Animation - No support
for CSS Animations and CSS Transitions. We started to turn the width and height
attributes on SVG roots to presentation attributes already. A presentation
attribute is a CSS property that can also be set by DOM (or now by SVG DOM).

This patch turns all width and height attributes to presentation attributes. It
basically allows authors to style width and height with CSS as well. Width and
height can now be set with CSS style sheets and can be animated with CSS.

To some degree it made it possible to remove code duplication. However, since
SVG DOM requires us to use SVGLength types and since we did not turn all
SVG attributes to the CSS length values (and our internal Length struct) yet,
we still need a hybrid - a bridge between SVGLength (for SVG DOM) and Length (for
RenderStyle). Once we move all attributes to use the Length struct, we can make SVGLength
a wrapper for Length and can move more code to the render tree.

The current challenge is to synchronize SVG DOM, normal DOM and RenderStyle.
With this patch we handle most part in RenderStyle. SVG DOM changes are
synchronized to DOM and RenderStyle will call needsStyleRecalc. Furthermore,
SVG Animations will continue to animate the SVG DOM (and synchronize the changes
back to RenderStyle) if the element has a JS property for the currently animated
attribute.

Short example:

    &lt;rect&gt;
        &lt;animate attributeName=&quot;width&quot;&gt;
    &lt;/rect&gt;

The &lt;rect&gt; element has the SVG DOM property 'width'. Therefore, we animate the SVG DOM
property and synchronize RenderStyle.

    &lt;ellipse&gt;
        &lt;animate attributeName=&quot;width&quot;&gt;
    &lt;/ellipse&gt;

The &lt;ellipse&gt; element does NOT have the SVG DOM property 'width'. Therefore, we
animate the CSS property directly. With synchronizing RenderStyle in all cases, we
make sure that the CSS cascade works even on animating on multiple SVG hierarchy
levels (animation of 'width' on &lt;g&gt; and inheriting the property value on a child
&lt;rect&gt;).

With using presentation attributes, we also inherit the CSS property parsing for
SVG attributes. &lt;rect width=&quot;  100px  &quot;&gt; is possible now. (Note the trailing whitespaces.)
This follows a recent resolution of the SVG WG.

Since we turned width and height to presentation attributes, the layout optimization
selfHasRelativeLengths() in the DOM can't be used anymore. selfHasRelativeLengths() was
intended to solve a problem where we did not layout relatively position/sized elements
when the parent changes its size. However, as a side effect it did not call layout
for absolutely positioned/sized elements since the layout does not change. I run
all performance tests that we have and even wrote a test with hundreds of elements
that would be affected by this optimization. The differences were inside the sigma
of a normal test run. (Means I couldn't measure a performance difference.)
Therefore, it is not worth it to keep the &quot;optimization&quot; around and I will probably
remove it entirely for all basic shapes but &lt;path&gt; and &lt;polygon&gt; in future patches.

Tests: svg/css/parse-height.html
       svg/css/parse-width.html
       svg/css/width-height-presentation-attribute-expected.svg
       svg/css/width-height-presentation-attribute.svg

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): We never calculated the computed
    value of width/height for SVG elements and returned auto instead. This is based
    on a rule of CSS 2 and needs to be fixed in CSS3.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyLength::applyValue): Length always incorporates the zoom level.
    In SVG we still apply the zoom after all operations by scaling the context. We need
    to take this in account for Length and don't apply zoom on SVG inline elements.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::useSVGZoomRulesForLength):
    See above.
* css/StyleResolver.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement): Do not call width() and height() on
    SVG DOM but use the values of RenderStyle instead.
* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromRectElement): Ditto.
* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::resetAnimatedType): We need to differ between CSS properties
    with and without SVG DOM on the current element. In the later case we animate the
    SVG DOM and need to synch RenderStyle.
(WebCore::SVGAnimateElement::clearAnimatedType): Ditto.
(WebCore::SVGAnimateElement::applyResultsToTarget): Ditto.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): This checks if the CSS property
    has to be synched with SVG DOM.
(WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
* svg/SVGAnimationElement.h:
* svg/SVGElement.cpp:
(WebCore::populateAttributeNameToCSSPropertyIDMap): Add width and heigth to the CSS property
    list for presentation attributes.
(WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): CSS properties with
    SVG DOM synchronization need to be treated differently. Collect them in a separate map.
(WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Caller for the map.
(WebCore::SVGElement::animatedPropertyTypeForAttribute): We need to check both maps here:
    CSS properties and CSS properties with SVG DOM synch.
(WebCore::SVGElement::isAnimatableCSSProperty): Ditto.
(WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Just return true if the property name
    is in the map of properties with SVG DOM for the current element.
* svg/SVGElement.h:
(WebCore::SVGElement::invalidateSVGPresentationAttributeStyle): Call needsStyleRecalc.
* svg/SVGFilterElement.cpp: Make width/height presentation attribute.
(WebCore::SVGFilterElement::svgAttributeChanged):
(WebCore::SVGFilterElement::selfHasRelativeLengths): Deleted.
* svg/SVGFilterElement.h: Ditto.
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
(WebCore::SVGForeignObjectElement::selfHasRelativeLengths): Deleted.
* svg/SVGForeignObjectElement.h:
* svg/SVGImageElement.cpp: Ditto.
(WebCore::SVGImageElement::svgAttributeChanged):
(WebCore::SVGImageElement::isPresentationAttribute): Deleted.
(WebCore::SVGImageElement::collectStyleForPresentationAttribute): Deleted.
(WebCore::SVGImageElement::selfHasRelativeLengths): Deleted.
* svg/SVGImageElement.h:
* svg/SVGLength.h: Transform an Length value to an absolute value by taking the SVG viewport
    into account. (An SVG viewport is not the same as the CSS viewport.)
* svg/SVGLengthContext.cpp: Ditto.
(WebCore::SVGLengthContext::valueForLength):
* svg/SVGLengthContext.h:
* svg/SVGMaskElement.cpp: Make width/height presentation attribute.
(WebCore::SVGMaskElement::svgAttributeChanged):
(WebCore::SVGMaskElement::selfHasRelativeLengths): Deleted.
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp: Ditto.
(WebCore::SVGPatternElement::svgAttributeChanged):
(WebCore::SVGPatternElement::selfHasRelativeLengths): Deleted.
* svg/SVGPatternElement.h:
* svg/SVGRectElement.cpp: Ditto.
(WebCore::SVGRectElement::svgAttributeChanged):
(WebCore::SVGRectElement::selfHasRelativeLengths): Deleted.
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp: Ditto.
(WebCore::SVGSVGElement::svgAttributeChanged): Clean up redundant layout calls.
(WebCore::SVGSVGElement::isPresentationAttribute): Deleted.
(WebCore::SVGSVGElement::collectStyleForPresentationAttribute): Deleted.
* svg/SVGSVGElement.h:
* svg/properties/SVGAnimatedProperty.cpp: Synchronize SVG DOM with DOM.
(WebCore::SVGAnimatedProperty::commitChange):

LayoutTests:
We already had a lot of tests for animating width/height as property.
So far they assumed that this is not possible. They simply needed to
be updated.

Furthermore, I added reference tests to test different inheritance
scenarios of CSS properties and setting them to elements.

A parsing test makes sure that the global property values inherit is
supported as well as CSS parsing rules for SVG attributes.
Negative tests test not-allowed behavior.

* platform/mac/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt:
* svg/animations/attributeTypes-expected.txt:
* svg/animations/resources/attributeTypes.svg:
* svg/animations/script-tests/attributeTypes.js:
(sample1):
(sample2):
(sample3):
* svg/css/getComputedStyle-basic-expected.txt:
* svg/css/parse-height-expected.txt: Added.
* svg/css/parse-height.html: Added.
* svg/css/parse-width-expected.txt: Added.
* svg/css/parse-width.html: Added.
* svg/css/width-height-presentation-attribute-expected.svg: Added.
* svg/css/width-height-presentation-attribute.svg: Added.
* svg/custom/mask-excessive-malloc-expected.txt:
* svg/hixie/error/015-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgW3CSVG11coordsunits03bexpectedtxt">trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgzoompagezoomforeignObjectexpectedtxt">trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsattributeTypesexpectedtxt">trunk/LayoutTests/svg/animations/attributeTypes-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsresourcesattributeTypessvg">trunk/LayoutTests/svg/animations/resources/attributeTypes.svg</a></li>
<li><a href="#trunkLayoutTestssvganimationsscripttestsattributeTypesjs">trunk/LayoutTests/svg/animations/script-tests/attributeTypes.js</a></li>
<li><a href="#trunkLayoutTestssvgcssgetComputedStylebasicexpectedtxt">trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcustommaskexcessivemallocexpectedtxt">trunk/LayoutTests/svg/custom/mask-excessive-malloc-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvghixieerror015expectedtxt">trunk/LayoutTests/svg/hixie/error/015-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGRectcpp">trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGPathDatacpp">trunk/Source/WebCore/rendering/svg/SVGPathData.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimateElementcpp">trunk/Source/WebCore/svg/SVGAnimateElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimationElementcpp">trunk/Source/WebCore/svg/SVGAnimationElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimationElementh">trunk/Source/WebCore/svg/SVGAnimationElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementh">trunk/Source/WebCore/svg/SVGElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFilterElementcpp">trunk/Source/WebCore/svg/SVGFilterElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFilterElementh">trunk/Source/WebCore/svg/SVGFilterElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGForeignObjectElementcpp">trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGForeignObjectElementh">trunk/Source/WebCore/svg/SVGForeignObjectElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGImageElementcpp">trunk/Source/WebCore/svg/SVGImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGImageElementh">trunk/Source/WebCore/svg/SVGImageElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthh">trunk/Source/WebCore/svg/SVGLength.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthContextcpp">trunk/Source/WebCore/svg/SVGLengthContext.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGLengthContexth">trunk/Source/WebCore/svg/SVGLengthContext.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMaskElementcpp">trunk/Source/WebCore/svg/SVGMaskElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGMaskElementh">trunk/Source/WebCore/svg/SVGMaskElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPatternElementcpp">trunk/Source/WebCore/svg/SVGPatternElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPatternElementh">trunk/Source/WebCore/svg/SVGPatternElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGRectElementcpp">trunk/Source/WebCore/svg/SVGRectElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGRectElementh">trunk/Source/WebCore/svg/SVGRectElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementcpp">trunk/Source/WebCore/svg/SVGSVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementh">trunk/Source/WebCore/svg/SVGSVGElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgpropertiesSVGAnimatedPropertycpp">trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgcssparseheightexpectedtxt">trunk/LayoutTests/svg/css/parse-height-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcssparseheighthtml">trunk/LayoutTests/svg/css/parse-height.html</a></li>
<li><a href="#trunkLayoutTestssvgcssparsewidthexpectedtxt">trunk/LayoutTests/svg/css/parse-width-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcssparsewidthhtml">trunk/LayoutTests/svg/css/parse-width.html</a></li>
<li><a href="#trunkLayoutTestssvgcsswidthheightpresentationattributeexpectedsvg">trunk/LayoutTests/svg/css/width-height-presentation-attribute-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvgcsswidthheightpresentationattributesvg">trunk/LayoutTests/svg/css/width-height-presentation-attribute.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/ChangeLog        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-07-18  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        Turn width/height to presentation attributes
+        https://bugs.webkit.org/show_bug.cgi?id=135046
+
+        Reviewed by Dean Jackson.
+
+        We already had a lot of tests for animating width/height as property.
+        So far they assumed that this is not possible. They simply needed to
+        be updated.
+
+        Furthermore, I added reference tests to test different inheritance
+        scenarios of CSS properties and setting them to elements.
+
+        A parsing test makes sure that the global property values inherit is
+        supported as well as CSS parsing rules for SVG attributes.
+        Negative tests test not-allowed behavior.
+
+        * platform/mac/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt:
+        * svg/animations/attributeTypes-expected.txt:
+        * svg/animations/resources/attributeTypes.svg:
+        * svg/animations/script-tests/attributeTypes.js:
+        (sample1):
+        (sample2):
+        (sample3):
+        * svg/css/getComputedStyle-basic-expected.txt:
+        * svg/css/parse-height-expected.txt: Added.
+        * svg/css/parse-height.html: Added.
+        * svg/css/parse-width-expected.txt: Added.
+        * svg/css/parse-width.html: Added.
+        * svg/css/width-height-presentation-attribute-expected.svg: Added.
+        * svg/css/width-height-presentation-attribute.svg: Added.
+        * svg/custom/mask-excessive-malloc-expected.txt:
+        * svg/hixie/error/015-expected.txt:
+
</ins><span class="cx"> 2014-07-21  Diego Pino Garcia  &lt;dpino@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         new Int32Array(new ArrayBuffer(100), 1, 1) shouldn't throw an error that says &quot;RangeError: Byte offset and length out of range of buffer&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgW3CSVG11coordsunits03bexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -38,8 +38,8 @@
</span><span class="cx">         RenderSVGText {text} at (230,68) size 158x16 contains 1 chunk(s)
</span><span class="cx">           RenderSVGInlineText {#text} at (0,0) size 158x15
</span><span class="cx">             chunk 1 text run 1 at (230.00,80.00) startOffset 0 endOffset 30 width 158.00: &quot;Relative to font x-height (ex)&quot;
</span><del>-        RenderSVGContainer {g} at (20,140) size 200x1
-          RenderSVGRect {rect} at (20,140) size 200x1 [fill={[type=SOLID] [color=#000000]}] [x=20.00] [y=80.00] [width=200.00] [height=1.00]
</del><ins>+        RenderSVGContainer {g} at (20,140) size 180x1
+          RenderSVGRect {rect} at (20,140) size 180x1 [fill={[type=SOLID] [color=#000000]}] [x=20.00] [y=80.00] [width=200.00] [height=1.00]
</ins><span class="cx">         RenderSVGText {text} at (20,86) size 93x16 contains 1 chunk(s)
</span><span class="cx">           RenderSVGInlineText {#text} at (0,0) size 93x15
</span><span class="cx">             chunk 1 text run 1 at (20.00,98.00) startOffset 0 endOffset 15 width 93.00: &quot;41.67% = 200 px&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgzoompagezoomforeignObjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/platform/mac/svg/zoom/page/zoom-foreignObject-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -16,8 +16,8 @@
</span><span class="cx">           text run at (0,0) width 56: &quot;[HTML]&quot;
</span><span class="cx">     RenderSVGRect {rect} at (0,0) size 361x289 [stroke={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=250.00] [height=200.00]
</span><span class="cx">     RenderSVGForeignObject {foreignObject} at (260,0) size 250x200
</span><del>-      RenderSVGRoot {svg} at (260,5) size 250x145
-        RenderSVGContainer {g} at (260,5) size 250x145 [transform={m=((3.00,0.26)(0.26,3.02)) t=(0.00,0.00)}]
</del><ins>+      RenderSVGRoot {svg} at (260,5) size 250x195
+        RenderSVGContainer {g} at (260,5) size 250x195 [transform={m=((3.00,0.26)(0.26,3.02)) t=(0.00,0.00)}]
</ins><span class="cx">           RenderSVGText {text} at (0,1) size 82x19 contains 1 chunk(s)
</span><span class="cx">             RenderSVGInlineText {#text} at (0,0) size 82x19
</span><span class="cx">               chunk 1 text run 1 at (0.00,16.00) startOffset 0 endOffset 14 width 81.05: &quot;This is a text&quot;
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsattributeTypesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/attributeTypes-expected.txt (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/attributeTypes-expected.txt        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/svg/animations/attributeTypes-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -11,8 +11,8 @@
</span><span class="cx"> PASS color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><del>-PASS rect2.width.animVal.value is 100
-PASS rect2.width.baseVal.value is 100
</del><ins>+PASS rect2.width.animVal.value is 10
+PASS rect2.width.baseVal.value is 10
</ins><span class="cx"> PASS color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> PASS color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><del>-PASS rect2.width.animVal.value is 100
-PASS rect2.width.baseVal.value is 100
</del><ins>+PASS rect2.width.animVal.value is 55
+PASS rect2.width.baseVal.value is 10
</ins><span class="cx"> PASS color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS rect2.width.animVal.value is 100
</span><del>-PASS rect2.width.baseVal.value is 100
</del><ins>+PASS rect2.width.baseVal.value is 10
</ins><span class="cx"> PASS color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS rect2.width.animVal.value is 100
</span><del>-PASS rect2.width.baseVal.value is 100
</del><ins>+PASS rect2.width.baseVal.value is 10
</ins><span class="cx"> PASS color.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span><span class="cx"> PASS color.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
</span><span class="cx"> PASS color.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsresourcesattributeTypessvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/resources/attributeTypes.svg (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/resources/attributeTypes.svg        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/svg/animations/resources/attributeTypes.svg        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -8,8 +8,8 @@
</span><span class="cx"> &lt;/rect&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;!-- 'width' is a XML attribute, attributeType is set to &quot;CSS&quot;. 'width' is not a presentation attribute, so this animation won't run. --&gt;
</span><del>-&lt;rect x=&quot;150&quot; width=&quot;100&quot; height=&quot;100&quot; fill=&quot;green&quot;&gt;
-    &lt;animate id=&quot;an2&quot; attributeType=&quot;CSS&quot; attributeName=&quot;width&quot; fill=&quot;freeze&quot; from=&quot;100&quot; to=&quot;10&quot; begin=&quot;0s&quot; dur=&quot;4s&quot;/&gt;
</del><ins>+&lt;rect x=&quot;150&quot; width=&quot;10&quot; height=&quot;100&quot; fill=&quot;green&quot;&gt;
+    &lt;animate id=&quot;an2&quot; attributeType=&quot;CSS&quot; attributeName=&quot;width&quot; fill=&quot;freeze&quot; from=&quot;10&quot; to=&quot;100&quot; begin=&quot;0s&quot; dur=&quot;4s&quot;/&gt;
</ins><span class="cx"> &lt;/rect&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;!-- 'fill' is a presentation attribute, mapped to CSS, attributeType is set to &quot;auto&quot;: this animation runs. --&gt;
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsscripttestsattributeTypesjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/animations/script-tests/attributeTypes.js (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/script-tests/attributeTypes.js        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/svg/animations/script-tests/attributeTypes.js        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -7,8 +7,8 @@
</span><span class="cx">     shouldBe(&quot;rect1.width.baseVal.value&quot;, &quot;10&quot;);
</span><span class="cx">     expectFillColor(rect1, 0, 128, 0);
</span><span class="cx"> 
</span><del>-    shouldBe(&quot;rect2.width.animVal.value&quot;, &quot;100&quot;);
-    shouldBe(&quot;rect2.width.baseVal.value&quot;, &quot;100&quot;);
</del><ins>+    shouldBeCloseEnough(&quot;rect2.width.animVal.value&quot;, &quot;10&quot;);
+    shouldBe(&quot;rect2.width.baseVal.value&quot;, &quot;10&quot;);
</ins><span class="cx">     expectFillColor(rect2, 0, 128, 0);
</span><span class="cx"> 
</span><span class="cx">     shouldBe(&quot;rect3.width.animVal.value&quot;, &quot;100&quot;);
</span><span class="lines">@@ -27,8 +27,8 @@
</span><span class="cx">     shouldBe(&quot;rect1.width.baseVal.value&quot;, &quot;10&quot;);
</span><span class="cx">     expectFillColor(rect1, 0, 128, 0);
</span><span class="cx"> 
</span><del>-    shouldBe(&quot;rect2.width.animVal.value&quot;, &quot;100&quot;);
-    shouldBe(&quot;rect2.width.baseVal.value&quot;, &quot;100&quot;);
</del><ins>+    shouldBeCloseEnough(&quot;rect2.width.animVal.value&quot;, &quot;55&quot;);
+    shouldBe(&quot;rect2.width.baseVal.value&quot;, &quot;10&quot;);
</ins><span class="cx">     expectFillColor(rect2, 0, 128, 0);
</span><span class="cx"> 
</span><span class="cx">     shouldBe(&quot;rect3.width.animVal.value&quot;, &quot;100&quot;);
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx">     shouldBe(&quot;rect1.width.baseVal.value&quot;, &quot;10&quot;);
</span><span class="cx">     expectFillColor(rect1, 0, 128, 0);
</span><span class="cx"> 
</span><del>-    shouldBe(&quot;rect2.width.animVal.value&quot;, &quot;100&quot;);
-    shouldBe(&quot;rect2.width.baseVal.value&quot;, &quot;100&quot;);
</del><ins>+    shouldBeCloseEnough(&quot;rect2.width.animVal.value&quot;, &quot;100&quot;);
+    shouldBe(&quot;rect2.width.baseVal.value&quot;, &quot;10&quot;);
</ins><span class="cx">     expectFillColor(rect2, 0, 128, 0);
</span><span class="cx"> 
</span><span class="cx">     shouldBe(&quot;rect3.width.animVal.value&quot;, &quot;100&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssgetComputedStylebasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx"> rect: style.getPropertyCSSValue(font-variant) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(font-weight) : normal
</span><span class="cx"> rect: style.getPropertyCSSValue(font-weight) : [object CSSPrimitiveValue]
</span><del>-rect: style.getPropertyValue(height) : auto
</del><ins>+rect: style.getPropertyValue(height) : 100px
</ins><span class="cx"> rect: style.getPropertyCSSValue(height) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(image-rendering) : auto
</span><span class="cx"> rect: style.getPropertyCSSValue(image-rendering) : [object CSSPrimitiveValue]
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx"> rect: style.getPropertyCSSValue(white-space) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(widows) : auto
</span><span class="cx"> rect: style.getPropertyCSSValue(widows) : [object CSSPrimitiveValue]
</span><del>-rect: style.getPropertyValue(width) : auto
</del><ins>+rect: style.getPropertyValue(width) : 100px
</ins><span class="cx"> rect: style.getPropertyCSSValue(width) : [object CSSPrimitiveValue]
</span><span class="cx"> rect: style.getPropertyValue(word-break) : normal
</span><span class="cx"> rect: style.getPropertyCSSValue(word-break) : [object CSSPrimitiveValue]
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssparseheightexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/parse-height-expected.txt (0 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/parse-height-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/css/parse-height-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;auto&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;  100&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;100   &quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;100   px&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;100px;&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;100px !important&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute height=&quot;{ 100px }&quot;
+CONSOLE MESSAGE: Error: Invalid negative value for &lt;rect&gt; attribute height=&quot;-100px&quot;
+Test that 'with' presentation attribute is parsed with CSS presentation rules.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS computedStyle(&quot;height&quot;, &quot;auto&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;height&quot;, &quot;  100&quot;) is &quot;100px&quot;
+PASS computedStyle(&quot;height&quot;, &quot;100   &quot;) is &quot;100px&quot;
+PASS computedStyle(&quot;height&quot;, &quot;100px&quot;) is &quot;100px&quot;
+PASS computedStyle(&quot;height&quot;, &quot;1em&quot;) is &quot;16px&quot;
+PASS computedStyle(&quot;height&quot;, &quot;1ex&quot;) is &quot;12.800000190734863px&quot;
+PASS computedStyle(&quot;height&quot;, &quot;20%&quot;) is &quot;20%&quot;
+PASS computedStyle(&quot;height&quot;, &quot;100   px&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;height&quot;, &quot;100px;&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;height&quot;, &quot;100px !important&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;height&quot;, &quot;{ 100px }&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;height&quot;, &quot;-100px&quot;) is &quot;auto&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcssparseheighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/parse-height.html (0 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/parse-height.html                                (rev 0)
+++ trunk/LayoutTests/svg/css/parse-height.html        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;style&gt;
+* { font-size: 16px; }
+svg, rect { font-family: 'Ahem'; }
+div { font-size: 8px; } 
+&lt;/style&gt;
+&lt;html&gt;
+&lt;svg id=&quot;svg&quot; width=&quot;0&quot; height=&quot;0&quot;&gt;&lt;/svg&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Test that 'with' presentation attribute is parsed with CSS presentation rules.&quot;);
+
+function computedStyle(property, value) {
+    var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+    document.getElementById('svg').appendChild(rect);
+    rect.setAttribute(property, value);
+    var computedValue = getComputedStyle(rect).getPropertyValue(property);
+    document.getElementById('svg').removeChild(rect);
+    return computedValue;
+}
+
+function testComputed(property, value, expected) {
+    shouldBeEqualToString('computedStyle(&quot;' + property + '&quot;, &quot;' + value + '&quot;)', expected);
+}
+
+function negativeTest(property, value) {
+    testComputed(property, value, &quot;auto&quot;);
+}
+
+// test mask-image
+testComputed(&quot;height&quot;, &quot;auto&quot;, &quot;auto&quot;);
+testComputed(&quot;height&quot;, &quot;  100&quot;, &quot;100px&quot;);
+testComputed(&quot;height&quot;, &quot;100   &quot;, &quot;100px&quot;);
+testComputed(&quot;height&quot;, &quot;100px&quot;, &quot;100px&quot;);
+testComputed(&quot;height&quot;, &quot;1em&quot;, &quot;16px&quot;);
+testComputed(&quot;height&quot;, &quot;1ex&quot;, &quot;12.800000190734863px&quot;);
+testComputed(&quot;height&quot;, &quot;20%&quot;, &quot;20%&quot;);
+// FIXME: Vieport units not implemented for SVG at the moment.
+// testComputed(&quot;height&quot;, &quot;1vh&quot;, &quot;7.869999885559082px&quot;);
+// testComputed(&quot;height&quot;, &quot;1vw&quot;, &quot;14.029999732971191px&quot;);
+
+// negative tests
+negativeTest(&quot;height&quot;, &quot;100   px&quot;);
+negativeTest(&quot;height&quot;, &quot;100px;&quot;);
+negativeTest(&quot;height&quot;, &quot;100px !important&quot;);
+negativeTest(&quot;height&quot;, &quot;{ 100px }&quot;);
+negativeTest(&quot;height&quot;, &quot;-100px&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcssparsewidthexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/parse-width-expected.txt (0 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/parse-width-expected.txt                                (rev 0)
+++ trunk/LayoutTests/svg/css/parse-width-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;auto&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;  100&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;100   &quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;100   px&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;100px;&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;100px !important&quot;
+CONSOLE MESSAGE: Error: Invalid value for &lt;rect&gt; attribute width=&quot;{ 100px }&quot;
+CONSOLE MESSAGE: Error: Invalid negative value for &lt;rect&gt; attribute width=&quot;-100px&quot;
+Test that 'with' presentation attribute is parsed with CSS presentation rules.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS computedStyle(&quot;width&quot;, &quot;auto&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;width&quot;, &quot;  100&quot;) is &quot;100px&quot;
+PASS computedStyle(&quot;width&quot;, &quot;100   &quot;) is &quot;100px&quot;
+PASS computedStyle(&quot;width&quot;, &quot;100px&quot;) is &quot;100px&quot;
+PASS computedStyle(&quot;width&quot;, &quot;1em&quot;) is &quot;16px&quot;
+PASS computedStyle(&quot;width&quot;, &quot;1ex&quot;) is &quot;12.800000190734863px&quot;
+PASS computedStyle(&quot;width&quot;, &quot;20%&quot;) is &quot;20%&quot;
+PASS computedStyle(&quot;width&quot;, &quot;100   px&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;width&quot;, &quot;100px;&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;width&quot;, &quot;100px !important&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;width&quot;, &quot;{ 100px }&quot;) is &quot;auto&quot;
+PASS computedStyle(&quot;width&quot;, &quot;-100px&quot;) is &quot;auto&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcssparsewidthhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/parse-width.html (0 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/parse-width.html                                (rev 0)
+++ trunk/LayoutTests/svg/css/parse-width.html        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;style&gt;
+* { font-size: 16px; }
+svg, rect { font-family: 'Ahem'; }
+div { font-size: 8px; } 
+&lt;/style&gt;
+&lt;html&gt;
+&lt;svg id=&quot;svg&quot; width=&quot;0&quot; height=&quot;0&quot;&gt;&lt;/svg&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Test that 'with' presentation attribute is parsed with CSS presentation rules.&quot;);
+
+function computedStyle(property, value) {
+    var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+    document.getElementById('svg').appendChild(rect);
+    rect.setAttribute(property, value);
+    var computedValue = getComputedStyle(rect).getPropertyValue(property);
+    document.getElementById('svg').removeChild(rect);
+    return computedValue;
+}
+
+function testComputed(property, value, expected) {
+    shouldBeEqualToString('computedStyle(&quot;' + property + '&quot;, &quot;' + value + '&quot;)', expected);
+}
+
+function negativeTest(property, value) {
+    testComputed(property, value, &quot;auto&quot;);
+}
+
+// test mask-image
+testComputed(&quot;width&quot;, &quot;auto&quot;, &quot;auto&quot;);
+testComputed(&quot;width&quot;, &quot;  100&quot;, &quot;100px&quot;);
+testComputed(&quot;width&quot;, &quot;100   &quot;, &quot;100px&quot;);
+testComputed(&quot;width&quot;, &quot;100px&quot;, &quot;100px&quot;);
+testComputed(&quot;width&quot;, &quot;1em&quot;, &quot;16px&quot;);
+testComputed(&quot;width&quot;, &quot;1ex&quot;, &quot;12.800000190734863px&quot;);
+testComputed(&quot;width&quot;, &quot;20%&quot;, &quot;20%&quot;);
+// FIXME: Vieport units not implemented for SVG at the moment.
+// testComputed(&quot;width&quot;, &quot;1vh&quot;, &quot;7.869999885559082px&quot;);
+// testComputed(&quot;width&quot;, &quot;1vw&quot;, &quot;14.029999732971191px&quot;);
+
+// negative tests
+negativeTest(&quot;width&quot;, &quot;100   px&quot;);
+negativeTest(&quot;width&quot;, &quot;100px;&quot;);
+negativeTest(&quot;width&quot;, &quot;100px !important&quot;);
+negativeTest(&quot;width&quot;, &quot;{ 100px }&quot;);
+negativeTest(&quot;width&quot;, &quot;-100px&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcsswidthheightpresentationattributeexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/width-height-presentation-attribute-expected.svg (0 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/width-height-presentation-attribute-expected.svg                                (rev 0)
+++ trunk/LayoutTests/svg/css/width-height-presentation-attribute-expected.svg        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+        &lt;rect height=&quot;200&quot; width=&quot;500&quot; fill=&quot;green&quot;/&gt;
+&lt;/svg&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgcsswidthheightpresentationattributesvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/css/width-height-presentation-attribute.svg (0 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/width-height-presentation-attribute.svg                                (rev 0)
+++ trunk/LayoutTests/svg/css/width-height-presentation-attribute.svg        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+        &lt;rect height=&quot;  100&quot; width=&quot;  100&quot; fill=&quot;green&quot;/&gt;
+        &lt;rect x=&quot;100&quot; height=&quot;100   &quot; width=&quot;100   &quot; fill=&quot;green&quot;/&gt;
+        &lt;rect x=&quot;200&quot; style=&quot;height: 100px; width: 100px;&quot; fill=&quot;green&quot;/&gt;
+        &lt;g style=&quot;height: 100px; width: 100px;&quot;&gt;
+                &lt;rect x=&quot;300&quot; style=&quot;height: inherit; width: inherit;&quot; fill=&quot;green&quot;/&gt;
+        &lt;/g&gt;
+        &lt;style&gt;
+                &lt;![CDATA[
+                        #rect, #rect2, .rect {
+                                width: 100px;
+                                height: 100px;
+                        }
+                ]]&gt;
+        &lt;/style&gt;
+        &lt;rect x=&quot;400&quot; id=&quot;rect&quot; fill=&quot;green&quot;/&gt;
+        &lt;use xlink:href=&quot;#rect&quot; y=&quot;100&quot;/&gt;
+        &lt;rect y=&quot;100&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;height: 100px; width: 100px;&quot; fill=&quot;green&quot;/&gt;
+        &lt;rect x=&quot;100&quot; y=&quot;100&quot; height=&quot;0&quot; width=&quot;0&quot; class=&quot;rect&quot; fill=&quot;green&quot;/&gt;
+        &lt;defs style=&quot;width: 1000px; height: 1000px;&quot;&gt;
+                &lt;rect id=&quot;rect2&quot; fill=&quot;green&quot;/&gt;
+                &lt;rect id=&quot;rect3&quot; fill=&quot;green&quot; style=&quot;height: inherit; width: inherit;&quot;/&gt;
+        &lt;/defs&gt;
+        &lt;use xlink:href=&quot;#rect2&quot; y=&quot;100&quot; x=&quot;200&quot;/&gt;
+        &lt;use xlink:href=&quot;#rect3&quot; x=&quot;300&quot; y=&quot;100&quot; style=&quot;height: 100px; width: 100px;&quot;/&gt;
+&lt;/svg&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustommaskexcessivemallocexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/mask-excessive-malloc-expected.txt (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/mask-excessive-malloc-expected.txt        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/svg/custom/mask-excessive-malloc-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -5,4 +5,4 @@
</span><span class="cx">     RenderSVGResourceMasker {mask} [id=&quot;mask&quot;] [maskUnits=objectBoundingBox] [maskContentUnits=userSpaceOnUse]
</span><span class="cx">       RenderSVGRect {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FFFFFF]}] [x=0.00] [y=0.00] [width=2147483648.00] [height=2147483648.00]
</span><span class="cx">     RenderSVGPath {path} at (200,200) size 100x200 [fill={[type=SOLID] [color=#0000FF]}] [data=&quot;M 200 200 L 300 200 L 300 400 L 200 400 Z&quot;]
</span><del>-      [masker=&quot;mask&quot;] RenderSVGResourceMasker {mask} at (190,180) size 2147483520x2147483520
</del><ins>+      [masker=&quot;mask&quot;] RenderSVGResourceMasker {mask} at (190,180) size 33554238x33554248
</ins></span></pre></div>
<a id="trunkLayoutTestssvghixieerror015expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/hixie/error/015-expected.txt (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/hixie/error/015-expected.txt        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/LayoutTests/svg/hixie/error/015-expected.txt        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -4,4 +4,4 @@
</span><span class="cx"> layer at (0,0) size 300x200
</span><span class="cx">   RenderSVGRoot {svg} at (0,0) size 300x200
</span><span class="cx">     RenderSVGRect {rect} at (0,0) size 300x200 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=300.00] [height=200.00]
</span><del>-    RenderSVGRect {rect} at (0,0) size 0x0 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=0.00] [height=200.00]
</del><ins>+    RenderSVGRect {rect} at (0,0) size 300x200 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=0.00] [height=200.00]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/ChangeLog        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -1,3 +1,154 @@
</span><ins>+2014-07-18  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        Turn width/height to presentation attributes
+        https://bugs.webkit.org/show_bug.cgi?id=135046
+
+        Reviewed by Dean Jackson.
+
+        The elements &lt;svg&gt;, &lt;image&gt;, &lt;pattern&gt;, &lt;mask&gt; and &lt;foreignObject&gt; have the
+        'width' and 'height' attributes. So far they can just be set by SVG DOM or
+        setAttribute. Furthermore, animations just work with SVG Animation - No support
+        for CSS Animations and CSS Transitions. We started to turn the width and height
+        attributes on SVG roots to presentation attributes already. A presentation
+        attribute is a CSS property that can also be set by DOM (or now by SVG DOM).
+
+        This patch turns all width and height attributes to presentation attributes. It
+        basically allows authors to style width and height with CSS as well. Width and
+        height can now be set with CSS style sheets and can be animated with CSS.
+
+        To some degree it made it possible to remove code duplication. However, since
+        SVG DOM requires us to use SVGLength types and since we did not turn all
+        SVG attributes to the CSS length values (and our internal Length struct) yet,
+        we still need a hybrid - a bridge between SVGLength (for SVG DOM) and Length (for
+        RenderStyle). Once we move all attributes to use the Length struct, we can make SVGLength
+        a wrapper for Length and can move more code to the render tree.
+
+        The current challenge is to synchronize SVG DOM, normal DOM and RenderStyle.
+        With this patch we handle most part in RenderStyle. SVG DOM changes are
+        synchronized to DOM and RenderStyle will call needsStyleRecalc. Furthermore,
+        SVG Animations will continue to animate the SVG DOM (and synchronize the changes
+        back to RenderStyle) if the element has a JS property for the currently animated
+        attribute.
+
+        Short example:
+
+            &lt;rect&gt;
+                &lt;animate attributeName=&quot;width&quot;&gt;
+            &lt;/rect&gt;
+
+        The &lt;rect&gt; element has the SVG DOM property 'width'. Therefore, we animate the SVG DOM
+        property and synchronize RenderStyle.
+
+            &lt;ellipse&gt;
+                &lt;animate attributeName=&quot;width&quot;&gt;
+            &lt;/ellipse&gt;
+
+        The &lt;ellipse&gt; element does NOT have the SVG DOM property 'width'. Therefore, we
+        animate the CSS property directly. With synchronizing RenderStyle in all cases, we
+        make sure that the CSS cascade works even on animating on multiple SVG hierarchy
+        levels (animation of 'width' on &lt;g&gt; and inheriting the property value on a child
+        &lt;rect&gt;).
+
+        With using presentation attributes, we also inherit the CSS property parsing for
+        SVG attributes. &lt;rect width=&quot;  100px  &quot;&gt; is possible now. (Note the trailing whitespaces.)
+        This follows a recent resolution of the SVG WG.
+
+        Since we turned width and height to presentation attributes, the layout optimization
+        selfHasRelativeLengths() in the DOM can't be used anymore. selfHasRelativeLengths() was
+        intended to solve a problem where we did not layout relatively position/sized elements
+        when the parent changes its size. However, as a side effect it did not call layout
+        for absolutely positioned/sized elements since the layout does not change. I run
+        all performance tests that we have and even wrote a test with hundreds of elements
+        that would be affected by this optimization. The differences were inside the sigma
+        of a normal test run. (Means I couldn't measure a performance difference.)
+        Therefore, it is not worth it to keep the &quot;optimization&quot; around and I will probably
+        remove it entirely for all basic shapes but &lt;path&gt; and &lt;polygon&gt; in future patches.
+
+        Tests: svg/css/parse-height.html
+               svg/css/parse-width.html
+               svg/css/width-height-presentation-attribute-expected.svg
+               svg/css/width-height-presentation-attribute.svg
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue): We never calculated the computed
+            value of width/height for SVG elements and returned auto instead. This is based
+            on a rule of CSS 2 and needs to be fixed in CSS3.
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::ApplyPropertyLength::applyValue): Length always incorporates the zoom level.
+            In SVG we still apply the zoom after all operations by scaling the context. We need
+            to take this in account for Length and don't apply zoom on SVG inline elements.
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::useSVGZoomRulesForLength):
+            See above.
+        * css/StyleResolver.h:
+        * rendering/svg/RenderSVGRect.cpp:
+        (WebCore::RenderSVGRect::updateShapeFromElement): Do not call width() and height() on
+            SVG DOM but use the values of RenderStyle instead.
+        * rendering/svg/SVGPathData.cpp:
+        (WebCore::updatePathFromRectElement): Ditto.
+        * svg/SVGAnimateElement.cpp:
+        (WebCore::SVGAnimateElement::resetAnimatedType): We need to differ between CSS properties
+            with and without SVG DOM on the current element. In the later case we animate the 
+            SVG DOM and need to synch RenderStyle.
+        (WebCore::SVGAnimateElement::clearAnimatedType): Ditto.
+        (WebCore::SVGAnimateElement::applyResultsToTarget): Ditto.
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): This checks if the CSS property
+            has to be synched with SVG DOM.
+        (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
+        * svg/SVGAnimationElement.h:
+        * svg/SVGElement.cpp:
+        (WebCore::populateAttributeNameToCSSPropertyIDMap): Add width and heigth to the CSS property
+            list for presentation attributes.
+        (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): CSS properties with
+            SVG DOM synchronization need to be treated differently. Collect them in a separate map.
+        (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Caller for the map.
+        (WebCore::SVGElement::animatedPropertyTypeForAttribute): We need to check both maps here:
+            CSS properties and CSS properties with SVG DOM synch.
+        (WebCore::SVGElement::isAnimatableCSSProperty): Ditto.
+        (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Just return true if the property name
+            is in the map of properties with SVG DOM for the current element.
+        * svg/SVGElement.h:
+        (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle): Call needsStyleRecalc.
+        * svg/SVGFilterElement.cpp: Make width/height presentation attribute.
+        (WebCore::SVGFilterElement::svgAttributeChanged):
+        (WebCore::SVGFilterElement::selfHasRelativeLengths): Deleted.
+        * svg/SVGFilterElement.h: Ditto.
+        * svg/SVGForeignObjectElement.cpp:
+        (WebCore::SVGForeignObjectElement::svgAttributeChanged):
+        (WebCore::SVGForeignObjectElement::selfHasRelativeLengths): Deleted.
+        * svg/SVGForeignObjectElement.h:
+        * svg/SVGImageElement.cpp: Ditto.
+        (WebCore::SVGImageElement::svgAttributeChanged):
+        (WebCore::SVGImageElement::isPresentationAttribute): Deleted.
+        (WebCore::SVGImageElement::collectStyleForPresentationAttribute): Deleted.
+        (WebCore::SVGImageElement::selfHasRelativeLengths): Deleted.
+        * svg/SVGImageElement.h:
+        * svg/SVGLength.h: Transform an Length value to an absolute value by taking the SVG viewport
+            into account. (An SVG viewport is not the same as the CSS viewport.)
+        * svg/SVGLengthContext.cpp: Ditto.
+        (WebCore::SVGLengthContext::valueForLength):
+        * svg/SVGLengthContext.h:
+        * svg/SVGMaskElement.cpp: Make width/height presentation attribute.
+        (WebCore::SVGMaskElement::svgAttributeChanged):
+        (WebCore::SVGMaskElement::selfHasRelativeLengths): Deleted.
+        * svg/SVGMaskElement.h:
+        * svg/SVGPatternElement.cpp: Ditto.
+        (WebCore::SVGPatternElement::svgAttributeChanged):
+        (WebCore::SVGPatternElement::selfHasRelativeLengths): Deleted.
+        * svg/SVGPatternElement.h:
+        * svg/SVGRectElement.cpp: Ditto.
+        (WebCore::SVGRectElement::svgAttributeChanged):
+        (WebCore::SVGRectElement::selfHasRelativeLengths): Deleted.
+        * svg/SVGRectElement.h:
+        * svg/SVGSVGElement.cpp: Ditto.
+        (WebCore::SVGSVGElement::svgAttributeChanged): Clean up redundant layout calls.
+        (WebCore::SVGSVGElement::isPresentationAttribute): Deleted.
+        (WebCore::SVGSVGElement::collectStyleForPresentationAttribute): Deleted.
+        * svg/SVGSVGElement.h:
+        * svg/properties/SVGAnimatedProperty.cpp: Synchronize SVG DOM with DOM.
+        (WebCore::SVGAnimatedProperty::commitChange):
+
</ins><span class="cx"> 2014-07-22  Adrian Perez de Castro  &lt;aperez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GStreamer] [GTK] WebKit does not build with GStreamer 1.4
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -2117,7 +2117,7 @@
</span><span class="cx">             return CSSGridTemplateAreasValue::create(style-&gt;namedGridArea(), style-&gt;namedGridAreaRowCount(), style-&gt;namedGridAreaColumnCount());
</span><span class="cx"> #endif /* ENABLE(CSS_GRID_LAYOUT) */
</span><span class="cx">         case CSSPropertyHeight:
</span><del>-            if (renderer) {
</del><ins>+            if (renderer &amp;&amp; !renderer-&gt;isRenderSVGModelObject()) {
</ins><span class="cx">                 // According to http://www.w3.org/TR/CSS2/visudet.html#the-height-property,
</span><span class="cx">                 // the &quot;height&quot; property does not apply for non-replaced inline elements.
</span><span class="cx">                 if (!renderer-&gt;isReplaced() &amp;&amp; renderer-&gt;isInline())
</span><span class="lines">@@ -2421,7 +2421,7 @@
</span><span class="cx">                 return cssValuePool().createIdentifierValue(CSSValueAuto);
</span><span class="cx">             return cssValuePool().createValue(style-&gt;widows(), CSSPrimitiveValue::CSS_NUMBER);
</span><span class="cx">         case CSSPropertyWidth:
</span><del>-            if (renderer) {
</del><ins>+            if (renderer &amp;&amp; !renderer-&gt;isRenderSVGModelObject()) {
</ins><span class="cx">                 // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-property,
</span><span class="cx">                 // the &quot;width&quot; property does not apply for non-replaced inline elements.
</span><span class="cx">                 if (!renderer-&gt;isReplaced() &amp;&amp; renderer-&gt;isInline())
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -384,16 +384,19 @@
</span><span class="cx">                 setValue(styleResolver-&gt;style(), Length(FitContent));
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        CSSToLengthConversionData conversionData = styleResolver-&gt;useSVGZoomRulesForLength() ?
+            styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)
+            : styleResolver-&gt;state().cssToLengthConversionData();
</ins><span class="cx">         if (autoEnabled &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueAuto)
</span><span class="cx">             setValue(styleResolver-&gt;style(), Length());
</span><span class="cx">         else if (primitiveValue-&gt;isLength()) {
</span><del>-            Length length = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;state().cssToLengthConversionData());
</del><ins>+            Length length = primitiveValue-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx">             length.setHasQuirk(primitiveValue-&gt;isQuirkValue());
</span><span class="cx">             setValue(styleResolver-&gt;style(), length);
</span><span class="cx">         } else if (primitiveValue-&gt;isPercentage())
</span><span class="cx">             setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;getDoubleValue(), Percent));
</span><span class="cx">         else if (primitiveValue-&gt;isCalculatedPercentageWithLength())
</span><del>-            setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;state().cssToLengthConversionData())));
</del><ins>+            setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(conversionData)));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler()
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -104,9 +104,9 @@
</span><span class="cx"> #include &quot;RuleSet.h&quot;
</span><span class="cx"> #include &quot;SVGDocument.h&quot;
</span><span class="cx"> #include &quot;SVGDocumentExtensions.h&quot;
</span><del>-#include &quot;SVGElement.h&quot;
</del><span class="cx"> #include &quot;SVGFontFaceElement.h&quot;
</span><span class="cx"> #include &quot;SVGNames.h&quot;
</span><ins>+#include &quot;SVGSVGElement.h&quot;
</ins><span class="cx"> #include &quot;SVGURIReference.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -1861,6 +1861,12 @@
</span><span class="cx">     return m_state.element() &amp;&amp; m_state.element()-&gt;isSVGElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// Scale with/height properties on inline SVG root.
+bool StyleResolver::useSVGZoomRulesForLength()
+{
+    return m_state.element() &amp;&amp; m_state.element()-&gt;isSVGElement() &amp;&amp; !(isSVGSVGElement(m_state.element()) &amp;&amp; m_state.element()-&gt;parentNode());
+}
+
</ins><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx"> static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&amp; namedGridAreas, NamedGridLinesMap&amp; namedGridLines, GridTrackSizingDirection direction)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/css/StyleResolver.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -206,6 +206,7 @@
</span><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     bool useSVGZoomRules();
</span><ins>+    bool useSVGZoomRulesForLength();
</ins><span class="cx"> 
</span><span class="cx">     static bool colorFromPrimitiveValueIsDerivedFromElement(CSSPrimitiveValue*);
</span><span class="cx">     Color colorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink = false) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGRectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     m_outerStrokeRect = FloatRect();
</span><span class="cx"> 
</span><span class="cx">     SVGLengthContext lengthContext(&amp;rectElement());
</span><del>-    FloatSize boundingBoxSize(rectElement().width().value(lengthContext), rectElement().height().value(lengthContext));
</del><ins>+    FloatSize boundingBoxSize(lengthContext.valueForLength(style().width(), LengthModeWidth), lengthContext.valueForLength(style().height(), LengthModeHeight));
</ins><span class="cx"> 
</span><span class="cx">     // Element is invalid if either dimension is negative.
</span><span class="cx">     if (boundingBoxSize.width() &lt; 0 || boundingBoxSize.height() &lt; 0)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGPathDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGPathData.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGPathData.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/rendering/svg/SVGPathData.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -21,8 +21,11 @@
</span><span class="cx"> #include &quot;SVGPathData.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Path.h&quot;
</span><ins>+#include &quot;RenderElement.h&quot;
+#include &quot;RenderStyle.h&quot;
</ins><span class="cx"> #include &quot;SVGCircleElement.h&quot;
</span><span class="cx"> #include &quot;SVGEllipseElement.h&quot;
</span><ins>+#include &quot;SVGLengthContext.h&quot;
</ins><span class="cx"> #include &quot;SVGLineElement.h&quot;
</span><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;SVGPathElement.h&quot;
</span><span class="lines">@@ -104,12 +107,16 @@
</span><span class="cx"> static void updatePathFromRectElement(SVGElement* element, Path&amp; path)
</span><span class="cx"> {
</span><span class="cx">     SVGRectElement* rect = toSVGRectElement(element);
</span><ins>+    RenderElement* renderer = rect-&gt;renderer();
+    if (!renderer)
+        return;
</ins><span class="cx"> 
</span><ins>+    RenderStyle&amp; style = renderer-&gt;style();
</ins><span class="cx">     SVGLengthContext lengthContext(element);
</span><del>-    float width = rect-&gt;width().value(lengthContext);
</del><ins>+    float width = lengthContext.valueForLength(style.width(), LengthModeWidth);
</ins><span class="cx">     if (width &lt;= 0)
</span><span class="cx">         return;
</span><del>-    float height = rect-&gt;height().value(lengthContext);
</del><ins>+    float height = lengthContext.valueForLength(style.height(), LengthModeHeight);
</ins><span class="cx">     if (height &lt;= 0)
</span><span class="cx">         return;
</span><span class="cx">     float x = rect-&gt;x().value(lengthContext);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimateElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimateElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimateElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGAnimateElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx">     if (shouldApply == DontApplyAnimation)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (shouldApply == ApplyXMLAnimation) {
</del><ins>+    if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
</ins><span class="cx">         // SVG DOM animVal animation code-path.
</span><span class="cx">         m_animatedProperties = animator-&gt;findAnimatedPropertiesForAttributeName(targetElement, attributeName);
</span><span class="cx">         ASSERT(!m_animatedProperties.isEmpty());
</span><span class="lines">@@ -334,6 +334,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName());
+    if (shouldApply == ApplyXMLandCSSAnimation)
+        removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
+
</ins><span class="cx">     // SVG DOM animVal animation code-path.
</span><span class="cx">     if (m_animator) {
</span><span class="cx">         m_animator-&gt;stopAnimValAnimation(m_animatedProperties);
</span><span class="lines">@@ -354,18 +358,25 @@
</span><span class="cx">     if (!m_animatedType)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    SVGElement* targetElement = this-&gt;targetElement();
+    const QualifiedName&amp; attributeName = this-&gt;attributeName();
</ins><span class="cx">     if (m_animatedProperties.isEmpty()) {
</span><span class="cx">         // CSS properties animation code-path.
</span><span class="cx">         // Convert the result of the animation to a String and apply it as CSS property on the target &amp; all instances.
</span><del>-        applyCSSPropertyToTargetAndInstances(targetElement(), attributeName(), m_animatedType-&gt;valueAsString());
</del><ins>+        applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType-&gt;valueAsString());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // We do update the style and the animation property independent of each other.
+    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
+    if (shouldApply == ApplyXMLandCSSAnimation)
+        applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType-&gt;valueAsString());
+
</ins><span class="cx">     // SVG DOM animVal animation code-path.
</span><span class="cx">     // At this point the SVG DOM values are already changed, unlike for CSS.
</span><span class="cx">     // We only have to trigger update notifications here.
</span><span class="cx">     m_animator-&gt;animValDidChange(m_animatedProperties);
</span><del>-    notifyTargetAndInstancesAboutAnimValChange(targetElement(), attributeName());
</del><ins>+    notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SVGAnimateElement::animatedPropertyTypeSupportsAddition() const
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimationElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -353,8 +353,13 @@
</span><span class="cx">     return value == sum &amp;&amp; animationMode() != ToAnimation;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement*, const QualifiedName&amp; attributeName)
</del><ins>+bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* element, const QualifiedName&amp; attributeName)
</ins><span class="cx"> {
</span><ins>+    // FIXME: Must be isSVGTextPositioningElement(element) instead.
+    if (isSVGTextElement(element)
+        &amp;&amp; (attributeName == SVGNames::xAttr || attributeName == SVGNames::yAttr))
+        return false;
+
</ins><span class="cx">     return SVGElement::isAnimatableCSSProperty(attributeName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -364,9 +369,13 @@
</span><span class="cx">         return DontApplyAnimation;
</span><span class="cx"> 
</span><span class="cx">     // Always animate CSS properties, using the ApplyCSSAnimation code path, regardless of the attributeType value.
</span><del>-    if (isTargetAttributeCSSProperty(targetElement, attributeName))
</del><ins>+    if (isTargetAttributeCSSProperty(targetElement, attributeName)) {
+        if (targetElement-&gt;isPresentationAttributeWithSVGDOM(attributeName))
+            return ApplyXMLandCSSAnimation;
</ins><span class="cx">         return ApplyCSSAnimation;
</span><ins>+    }
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">     // If attributeType=&quot;CSS&quot; and attributeName doesn't point to a CSS property, ignore the animation.
</span><span class="cx">     if (attributeType() == AttributeTypeCSS)
</span><span class="cx">         return DontApplyAnimation;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimationElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimationElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimationElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -87,7 +87,8 @@
</span><span class="cx">     enum ShouldApplyAnimation {
</span><span class="cx">         DontApplyAnimation,
</span><span class="cx">         ApplyCSSAnimation,
</span><del>-        ApplyXMLAnimation
</del><ins>+        ApplyXMLAnimation,
+        ApplyXMLandCSSAnimation // For presentation attributes with SVG DOM properties.
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     ShouldApplyAnimation shouldApplyAnimation(SVGElement* targetElement, const QualifiedName&amp; attributeName);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx">         &amp;glyph_orientation_horizontalAttr,
</span><span class="cx">         &amp;glyph_orientation_verticalAttr,
</span><span class="cx">         &amp;image_renderingAttr,
</span><ins>+        &amp;SVGNames::heightAttr,
</ins><span class="cx">         &amp;kerningAttr,
</span><span class="cx">         &amp;letter_spacingAttr,
</span><span class="cx">         &amp;lighting_colorAttr,
</span><span class="lines">@@ -140,6 +141,7 @@
</span><span class="cx">         &amp;unicode_bidiAttr,
</span><span class="cx">         &amp;vector_effectAttr,
</span><span class="cx">         &amp;visibilityAttr,
</span><ins>+        &amp;SVGNames::widthAttr,
</ins><span class="cx">         &amp;word_spacingAttr,
</span><span class="cx">         &amp;writing_modeAttr,
</span><span class="cx">     };
</span><span class="lines">@@ -232,6 +234,30 @@
</span><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NEVER_INLINE void populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap(HashMap&lt;QualifiedName::QualifiedNameImpl*, AnimatedPropertyType&gt;&amp; map)
+{
+    struct TableEntry {
+        const QualifiedName&amp; attributeName;
+        AnimatedPropertyType type;
+    };
+
+    static const TableEntry table[] = {
+        { SVGNames::heightAttr, AnimatedLength },
+        { SVGNames::widthAttr, AnimatedLength },
+    };
+
+    for (unsigned i = 0; i &lt; WTF_ARRAY_LENGTH(table); ++i)
+        map.add(table[i].attributeName.impl(), table[i].type);
+}
+
+static inline HashMap&lt;QualifiedName::QualifiedNameImpl*, AnimatedPropertyType&gt;&amp; cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap()
+{
+    static NeverDestroyed&lt;HashMap&lt;QualifiedName::QualifiedNameImpl*, AnimatedPropertyType&gt;&gt; map;
+    if (map.get().isEmpty())
+        populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap(map);
+    return map;
+}
+
</ins><span class="cx"> SVGElement::SVGElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="cx">     : StyledElement(tagName, document, CreateSVGElement)
</span><span class="cx"> {
</span><span class="lines">@@ -508,8 +534,15 @@
</span><span class="cx"> 
</span><span class="cx">     auto&amp; map = attributeNameToAnimatedPropertyTypeMap();
</span><span class="cx">     auto it = map.find(attributeName.impl());
</span><del>-    if (it != map.end())
</del><ins>+    if (it != map.end()) {
</ins><span class="cx">         propertyTypes.append(it-&gt;value);
</span><ins>+        return;
+    }
+
+    auto&amp; cssPropertyWithSVGDOMMap = cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap();
+    auto svgPropertyIterator = cssPropertyWithSVGDOMMap.find(attributeName.impl());
+    if (svgPropertyIterator != cssPropertyWithSVGDOMMap.end())
+        propertyTypes.append(svgPropertyIterator-&gt;value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SVGElement::haveLoadedRequiredResources()
</span><span class="lines">@@ -965,9 +998,17 @@
</span><span class="cx"> 
</span><span class="cx"> bool SVGElement::isAnimatableCSSProperty(const QualifiedName&amp; attributeName)
</span><span class="cx"> {
</span><del>-    return attributeNameToAnimatedPropertyTypeMap().contains(attributeName.impl());
</del><ins>+    return attributeNameToAnimatedPropertyTypeMap().contains(attributeName.impl())
+        || cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap().contains(attributeName.impl());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool SVGElement::isPresentationAttributeWithSVGDOM(const QualifiedName&amp; attributeName)
+{
+    Vector&lt;AnimatedPropertyType&gt; propertyTypes;
+    localAttributeToPropertyMap().animatedPropertyTypeForAttribute(attributeName, propertyTypes);
+    return !propertyTypes.isEmpty();
+}
+
</ins><span class="cx"> bool SVGElement::isPresentationAttribute(const QualifiedName&amp; name) const
</span><span class="cx"> {
</span><span class="cx">     if (cssPropertyIdForSVGAttributeName(name) &gt; 0)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String title() const override;
</span><span class="cx">     static bool isAnimatableCSSProperty(const QualifiedName&amp;);
</span><ins>+    bool isPresentationAttributeWithSVGDOM(const QualifiedName&amp;);
</ins><span class="cx">     bool isKnownAttribute(const QualifiedName&amp;);
</span><span class="cx">     PassRefPtr&lt;CSSValue&gt; getPresentationAttribute(const String&amp; name);
</span><span class="cx">     virtual bool supportsMarkers() const { return false; }
</span><span class="lines">@@ -86,7 +87,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void svgAttributeChanged(const QualifiedName&amp;);
</span><span class="cx"> 
</span><del>-    virtual void animatedPropertyTypeForAttribute(const QualifiedName&amp;, Vector&lt;AnimatedPropertyType&gt;&amp;);
</del><ins>+    void animatedPropertyTypeForAttribute(const QualifiedName&amp;, Vector&lt;AnimatedPropertyType&gt;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false);
</span><span class="cx">     void sendSVGLoadEventIfPossibleAsynchronously();
</span><span class="lines">@@ -96,7 +97,12 @@
</span><span class="cx">     virtual AffineTransform* supplementalTransform() { return 0; }
</span><span class="cx"> 
</span><span class="cx">     void invalidateSVGAttributes() { ensureUniqueElementData().setAnimatedSVGAttributesAreDirty(true); }
</span><del>-    void invalidateSVGPresentationAttributeStyle() { ensureUniqueElementData().setPresentationAttributeStyleIsDirty(true); }
</del><ins>+    void invalidateSVGPresentationAttributeStyle()
+    {
+        ensureUniqueElementData().setPresentationAttributeStyleIsDirty(true);
+        // Trigger style recalculation for &quot;elements as resource&quot; (e.g. referenced by feImage).
+        setNeedsStyleRecalc(InlineStyleChange);
+    }
</ins><span class="cx"> 
</span><span class="cx">     const HashSet&lt;SVGElementInstance*&gt;&amp; instancesForElement() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFilterElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFilterElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFilterElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGFilterElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -167,11 +167,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SVGElementInstance::InvalidationGuard invalidationGuard(this);
</span><del>-    
</del><ins>+
+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr) {
+        invalidateSVGPresentationAttributeStyle();
+        return;
+    }
+
</ins><span class="cx">     if (attrName == SVGNames::xAttr
</span><del>-        || attrName == SVGNames::yAttr
-        || attrName == SVGNames::widthAttr
-        || attrName == SVGNames::heightAttr)
</del><ins>+        || attrName == SVGNames::yAttr)
</ins><span class="cx">         updateRelativeLengthsInformation();
</span><span class="cx"> 
</span><span class="cx">     if (RenderObject* object = renderer())
</span><span class="lines">@@ -233,14 +237,6 @@
</span><span class="cx">     return allowedChildElementTags.get().contains&lt;SVGAttributeHashTranslator&gt;(svgElement.tagQName());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGFilterElement::selfHasRelativeLengths() const
-{
-    return x().isRelative()
-        || y().isRelative()
-        || width().isRelative()
-        || height().isRelative();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFilterElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFilterElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFilterElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGFilterElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx">     virtual bool childShouldCreateRenderer(const Node&amp;) const override;
</span><span class="cx"> 
</span><del>-    virtual bool selfHasRelativeLengths() const override;
</del><ins>+    virtual bool selfHasRelativeLengths() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     static const AtomicString&amp; filterResXIdentifier();
</span><span class="cx">     static const AtomicString&amp; filterResYIdentifier();
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGForeignObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -112,13 +112,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SVGElementInstance::InvalidationGuard invalidationGuard(this);
</span><del>-    
-    bool isLengthAttribute = attrName == SVGNames::xAttr
-                          || attrName == SVGNames::yAttr
-                          || attrName == SVGNames::widthAttr
-                          || attrName == SVGNames::heightAttr;
</del><span class="cx"> 
</span><del>-    if (isLengthAttribute)
</del><ins>+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr) {
+        invalidateSVGPresentationAttributeStyle();
+        return;
+    }
+
+    if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
</ins><span class="cx">         updateRelativeLengthsInformation();
</span><span class="cx"> 
</span><span class="cx">     if (auto renderer = this-&gt;renderer())
</span><span class="lines">@@ -158,12 +159,4 @@
</span><span class="cx">     return SVGGraphicsElement::rendererIsNeeded(style);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGForeignObjectElement::selfHasRelativeLengths() const
-{
-    return x().isRelative()
-        || y().isRelative()
-        || width().isRelative()
-        || height().isRelative();
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGForeignObjectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGForeignObjectElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGForeignObjectElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGForeignObjectElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     virtual bool childShouldCreateRenderer(const Node&amp;) const override;
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx"> 
</span><del>-    virtual bool selfHasRelativeLengths() const override;
</del><ins>+    virtual bool selfHasRelativeLengths() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGForeignObjectElement)
</span><span class="cx">         DECLARE_ANIMATED_LENGTH(X, x)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGImageElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGImageElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGImageElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -87,23 +87,6 @@
</span><span class="cx">     return supportedAttributes.get().contains&lt;SVGAttributeHashTranslator&gt;(attrName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGImageElement::isPresentationAttribute(const QualifiedName&amp; name) const
-{
-    if (name == SVGNames::widthAttr || name == SVGNames::heightAttr)
-        return true;
-    return SVGGraphicsElement::isPresentationAttribute(name);
-}
-
-void SVGImageElement::collectStyleForPresentationAttribute(const QualifiedName&amp; name, const AtomicString&amp; value, MutableStyleProperties&amp; style)
-{
-    if (!isSupportedAttribute(name))
-        SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
-    else if (name == SVGNames::widthAttr)
-        addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
-    else if (name == SVGNames::heightAttr)
-        addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
-}
-
</del><span class="cx"> void SVGImageElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><span class="cx">     SVGParsingError parseError = NoError;
</span><span class="lines">@@ -139,7 +122,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SVGElementInstance::InvalidationGuard invalidationGuard(this);
</span><del>-    
</del><ins>+
+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr) {
+        invalidateSVGPresentationAttributeStyle();
+        return;
+    }
+
</ins><span class="cx">     bool isLengthAttribute = attrName == SVGNames::xAttr
</span><span class="cx">                           || attrName == SVGNames::yAttr
</span><span class="cx">                           || attrName == SVGNames::widthAttr
</span><span class="lines">@@ -173,14 +162,6 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGImageElement::selfHasRelativeLengths() const
-{
-    return x().isRelative()
-        || y().isRelative()
-        || width().isRelative()
-        || height().isRelative();
-}
-
</del><span class="cx"> RenderPtr&lt;RenderElement&gt; SVGImageElement::createElementRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><span class="cx">     return createRenderer&lt;RenderSVGImage&gt;(*this, WTF::move(style));
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGImageElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGImageElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGImageElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -44,8 +44,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool isSupportedAttribute(const QualifiedName&amp;);
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><del>-    virtual bool isPresentationAttribute(const QualifiedName&amp;) const override;
-    virtual void collectStyleForPresentationAttribute(const QualifiedName&amp;, const AtomicString&amp;, MutableStyleProperties&amp;) override;
</del><span class="cx">     virtual void svgAttributeChanged(const QualifiedName&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void didAttachRenderers() override;
</span><span class="lines">@@ -58,7 +56,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool haveLoadedRequiredResources() override;
</span><span class="cx"> 
</span><del>-    virtual bool selfHasRelativeLengths() const override;
</del><ins>+    virtual bool selfHasRelativeLengths() const override { return true; }
</ins><span class="cx">     virtual void didMoveToNewDocument(Document* oldDocument) override;
</span><span class="cx"> 
</span><span class="cx">     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGImageElement)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLength.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLength.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGLength.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">         SVG_LENGTHTYPE_PC = LengthTypePC
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    // FIXME: Once all SVGLength users use Length internally, we make this a wrapper for Length.
</ins><span class="cx">     SVGLength(SVGLengthMode = LengthModeOther, const String&amp; valueAsString = String());
</span><span class="cx">     SVGLength(const SVGLengthContext&amp;, float, SVGLengthMode = LengthModeOther, SVGLengthType = LengthTypeNumber);
</span><span class="cx">     SVGLength(const SVGLength&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGLengthContext.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;FontMetrics.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;LengthFunctions.h&quot;
</ins><span class="cx"> #include &quot;RenderSVGRoot.h&quot;
</span><span class="cx"> #include &quot;RenderSVGViewportContainer.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="lines">@@ -85,6 +86,27 @@
</span><span class="cx">     return x.valueAsPercentage();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+float SVGLengthContext::valueForLength(const Length&amp; length, SVGLengthMode mode)
+{
+    if (length.isPercent())
+        return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
+    if (length.isAuto())
+        return 0;
+
+    FloatSize viewportSize;
+    determineViewport(viewportSize);
+
+    switch (mode) {
+    case LengthModeWidth:
+        return floatValueForLength(length, viewportSize.width());
+    case LengthModeHeight:
+        return floatValueForLength(length, viewportSize.height());
+    case LengthModeOther:
+        return floatValueForLength(length, sqrtf(viewportSize.diagonalLengthSquared() / 2));
+    };
+    return 0;
+}
+
</ins><span class="cx"> float SVGLengthContext::convertValueToUserUnits(float value, SVGLengthMode mode, SVGLengthType fromUnit, ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><span class="cx">     // If the SVGLengthContext carries a custom viewport, force resolving against it.
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGLengthContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGLengthContext.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGLengthContext.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGLengthContext.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> class SVGElement;
</span><span class="cx"> class SVGLength;
</span><ins>+struct Length;
</ins><span class="cx"> 
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx"> 
</span><span class="lines">@@ -64,6 +65,7 @@
</span><span class="cx">     static FloatPoint resolvePoint(const SVGElement*, SVGUnitTypes::SVGUnitType, const SVGLength&amp; x, const SVGLength&amp; y);
</span><span class="cx">     static float resolveLength(const SVGElement*, SVGUnitTypes::SVGUnitType, const SVGLength&amp;);
</span><span class="cx"> 
</span><ins>+    float valueForLength(const Length&amp;, SVGLengthMode = LengthModeOther);
</ins><span class="cx">     float convertValueToUserUnits(float, SVGLengthMode, SVGLengthType fromUnit, ExceptionCode&amp;) const;
</span><span class="cx">     float convertValueFromUserUnits(float, SVGLengthMode, SVGLengthType toUnit, ExceptionCode&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMaskElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMaskElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMaskElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGMaskElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -134,11 +134,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SVGElementInstance::InvalidationGuard invalidationGuard(this);
</span><del>-    
</del><ins>+
+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr) {
+        invalidateSVGPresentationAttributeStyle();
+        return;
+    }
+
</ins><span class="cx">     if (attrName == SVGNames::xAttr
</span><del>-        || attrName == SVGNames::yAttr
-        || attrName == SVGNames::widthAttr
-        || attrName == SVGNames::heightAttr)
</del><ins>+        || attrName == SVGNames::yAttr)
</ins><span class="cx">         updateRelativeLengthsInformation();
</span><span class="cx"> 
</span><span class="cx">     if (RenderObject* object = renderer())
</span><span class="lines">@@ -161,12 +165,4 @@
</span><span class="cx">     return createRenderer&lt;RenderSVGResourceMasker&gt;(*this, WTF::move(style));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGMaskElement::selfHasRelativeLengths() const
-{
-    return x().isRelative()
-        || y().isRelative()
-        || width().isRelative()
-        || height().isRelative();
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGMaskElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGMaskElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGMaskElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGMaskElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx"> 
</span><del>-    virtual bool selfHasRelativeLengths() const override;
</del><ins>+    virtual bool selfHasRelativeLengths() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement)
</span><span class="cx">         DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPatternElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPatternElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPatternElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGPatternElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -159,11 +159,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SVGElementInstance::InvalidationGuard invalidationGuard(this);
</span><del>-    
</del><ins>+
+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr) {
+        invalidateSVGPresentationAttributeStyle();
+        return;
+    }
+
</ins><span class="cx">     if (attrName == SVGNames::xAttr
</span><del>-        || attrName == SVGNames::yAttr
-        || attrName == SVGNames::widthAttr
-        || attrName == SVGNames::heightAttr)
</del><ins>+        || attrName == SVGNames::yAttr)
</ins><span class="cx">         updateRelativeLengthsInformation();
</span><span class="cx"> 
</span><span class="cx">     if (RenderObject* object = renderer())
</span><span class="lines">@@ -252,12 +256,4 @@
</span><span class="cx">     return matrix;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGPatternElement::selfHasRelativeLengths() const
-{
-    return x().isRelative()
-        || y().isRelative()
-        || width().isRelative()
-        || height().isRelative();
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPatternElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPatternElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPatternElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGPatternElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx"> 
</span><del>-    virtual bool selfHasRelativeLengths() const override;
</del><ins>+    virtual bool selfHasRelativeLengths() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement)
</span><span class="cx">         DECLARE_ANIMATED_LENGTH(X, x)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGRectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGRectElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGRectElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGRectElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -120,11 +120,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     SVGElementInstance::InvalidationGuard invalidationGuard(this);
</span><del>-    
</del><ins>+
+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr) {
+        invalidateSVGPresentationAttributeStyle();
+        return;
+    }
+
</ins><span class="cx">     bool isLengthAttribute = attrName == SVGNames::xAttr
</span><span class="cx">                           || attrName == SVGNames::yAttr
</span><del>-                          || attrName == SVGNames::widthAttr
-                          || attrName == SVGNames::heightAttr
</del><span class="cx">                           || attrName == SVGNames::rxAttr
</span><span class="cx">                           || attrName == SVGNames::ryAttr;
</span><span class="cx"> 
</span><span class="lines">@@ -149,16 +153,6 @@
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGRectElement::selfHasRelativeLengths() const
-{
-    return x().isRelative()
-        || y().isRelative()
-        || width().isRelative()
-        || height().isRelative()
-        || rx().isRelative()
-        || ry().isRelative();
-}
-
</del><span class="cx"> RenderPtr&lt;RenderElement&gt; SVGRectElement::createElementRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><span class="cx">     return createRenderer&lt;RenderSVGRect&gt;(*this, WTF::move(style));
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGRectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGRectElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGRectElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGRectElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><span class="cx">     virtual void svgAttributeChanged(const QualifiedName&amp;) override;
</span><span class="cx"> 
</span><del>-    virtual bool selfHasRelativeLengths() const override;
</del><ins>+    virtual bool selfHasRelativeLengths() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -270,49 +270,15 @@
</span><span class="cx">     reportAttributeParsingError(parseError, name, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SVGSVGElement::isPresentationAttribute(const QualifiedName&amp; name) const
-{
-    if (isOutermostSVGSVGElement() &amp;&amp; (name == SVGNames::widthAttr || name == SVGNames::heightAttr))
-        return true;
-    return SVGGraphicsElement::isPresentationAttribute(name);
-}
-
-void SVGSVGElement::collectStyleForPresentationAttribute(const QualifiedName&amp; name, const AtomicString&amp; value, MutableStyleProperties&amp; style)
-{
-    if (isOutermostSVGSVGElement() &amp;&amp; (name == SVGNames::widthAttr || name == SVGNames::heightAttr)) {
-        if (name == SVGNames::widthAttr)
-            addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
-        else if (name == SVGNames::heightAttr)
-            addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
-    } else
-        SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
-}
-
</del><span class="cx"> void SVGSVGElement::svgAttributeChanged(const QualifiedName&amp; attrName)
</span><span class="cx"> {
</span><span class="cx">     bool updateRelativeLengthsOrViewBox = false;
</span><del>-    bool widthChanged = attrName == SVGNames::widthAttr;
-    bool heightChanged = attrName == SVGNames::heightAttr;
-    if (widthChanged || heightChanged
</del><ins>+    if (attrName == SVGNames::widthAttr
+        || attrName == SVGNames::heightAttr
</ins><span class="cx">         || attrName == SVGNames::xAttr
</span><span class="cx">         || attrName == SVGNames::yAttr) {
</span><ins>+        invalidateSVGPresentationAttributeStyle();
</ins><span class="cx">         updateRelativeLengthsOrViewBox = true;
</span><del>-        updateRelativeLengthsInformation();
-
-        // At the SVG/HTML boundary (aka RenderSVGRoot), the width and
-        // height attributes can affect the replaced size so we need
-        // to mark it for updating.
-        if (widthChanged || heightChanged) {
-            // FIXME: This is a hack to synchronize changes from SVG DOM earlier in the
-            // run. We need these changes in the style calculation process earlier than
-            // usual.
-            synchronizeAllAttributes();
-            RenderObject* renderObject = renderer();
-            if (renderObject &amp;&amp; renderObject-&gt;isSVGRoot()) {
-                invalidateSVGPresentationAttributeStyle();
-                setNeedsStyleRecalc();
-            }
-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (SVGFitToViewBox::isKnownAttribute(attrName)) {
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.h (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.h        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/SVGSVGElement.h        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -133,8 +133,6 @@
</span><span class="cx">     virtual void didMoveToNewDocument(Document* oldDocument) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) override;
</span><del>-    virtual bool isPresentationAttribute(const QualifiedName&amp;) const override;
-    virtual void collectStyleForPresentationAttribute(const QualifiedName&amp;, const AtomicString&amp;, MutableStyleProperties&amp;) override;
</del><span class="cx"> 
</span><span class="cx">     virtual bool rendererIsNeeded(const RenderStyle&amp;) override;
</span><span class="cx">     virtual RenderPtr&lt;RenderElement&gt; createElementRenderer(PassRef&lt;RenderStyle&gt;) override;
</span></span></pre></div>
<a id="trunkSourceWebCoresvgpropertiesSVGAnimatedPropertycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp (171340 => 171341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp        2014-07-22 09:48:29 UTC (rev 171340)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp        2014-07-22 13:27:38 UTC (rev 171341)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx">     ASSERT(!m_contextElement-&gt;m_deletionHasBegun);
</span><span class="cx">     m_contextElement-&gt;invalidateSVGAttributes();
</span><span class="cx">     m_contextElement-&gt;svgAttributeChanged(m_attributeName);
</span><ins>+    // Needed to synchronize with CSSOM for presentation attributes with SVG DOM.
+    m_contextElement-&gt;synchronizeAnimatedSVGAttribute(m_attributeName);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache()
</span></span></pre>
</div>
</div>

</body>
</html>