Changeset 101062 in webkit


Ignore:
Timestamp:
Nov 23, 2011 3:34:37 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

First step towards http://webkit.org/b/70025

Allow -webkit-transform to be have effect to SVG elements.
Currently, the CSS transform takes precedence over the SVG transform attribute

Allow SVG elements to be transformed using webkit-transform
https://bugs.webkit.org/show_bug.cgi?id=71309

Patch by Raul Hudea <rhudea@adobe.com> on 2011-11-23
Reviewed by Nikolas Zimmermann.

Source/WebCore:

Tests: svg/clip-path/clip-path-css-transform-1.svg

svg/clip-path/clip-path-css-transform-2.svg
svg/custom/clip-path-with-css-transform-1.svg
svg/custom/clip-path-with-css-transform-2.svg
svg/custom/pointer-events-image-css-transform.svg
svg/custom/pointer-events-text-css-transform.svg
svg/dom/css-transforms.xhtml
svg/dynamic-updates/SVG-dynamic-css-transform.html
svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting.html
svg/transforms/svg-css-transforms-clip-path.xhtml
svg/transforms/svg-css-transforms.xhtml

  • manual-tests/svg-animation-css-transform.html: Added.
  • manual-tests/svg-css-animate-compound.html: Added.
  • manual-tests/svg-css-transition-compound.html: Added.
  • rendering/svg/RenderSVGModelObject.cpp:

(WebCore::RenderSVGModelObject::styleWillChange):

Set the updateTransform flag on SVG elements whenever a CSS transform is present on the style

  • svg/SVGStyledTransformableElement.cpp:

(WebCore::SVGStyledTransformableElement::animatedLocalTransform):

Use the RenderStyle's transform (if it exists) over the SVG's transform

  • svg/SVGTextElement.cpp:

(WebCore::SVGTextElement::animatedLocalTransform):

Use the RenderStyle's transform (if it exists) over the SVG's transform

LayoutTests:

  • platform/chromium/test_expectations.txt:
  • platform/mac/svg/clip-path/clip-path-css-transform-1-expected.png: Added.
  • platform/mac/svg/clip-path/clip-path-css-transform-1-expected.txt: Added.
  • platform/mac/svg/clip-path/clip-path-css-transform-2-expected.png: Added.
  • platform/mac/svg/clip-path/clip-path-css-transform-2-expected.txt: Added.
  • platform/mac/svg/custom/clip-path-with-css-transform-1-expected.png: Added.
  • platform/mac/svg/custom/clip-path-with-css-transform-1-expected.txt: Added.
  • platform/mac/svg/custom/clip-path-with-css-transform-2-expected.png: Added.
  • platform/mac/svg/custom/clip-path-with-css-transform-2-expected.txt: Added.
  • platform/mac/svg/custom/pointer-events-image-css-transform-expected.png: Added.
  • platform/mac/svg/custom/pointer-events-image-css-transform-expected.txt: Added.
  • platform/mac/svg/custom/pointer-events-text-css-transform-expected.png: Added.
  • platform/mac/svg/custom/pointer-events-text-css-transform-expected.txt: Added.
  • platform/mac/svg/dom/css-transforms-expected.png: Added.
  • platform/mac/svg/dynamic-updates/SVG-dynamic-css-transform-expected.png: Added.
  • platform/mac/svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting-expected.png: Added.
  • platform/mac/svg/transforms/svg-css-transforms-clip-path-expected.png: Added.
  • platform/mac/svg/transforms/svg-css-transforms-clip-path-expected.txt: Added.
  • platform/mac/svg/transforms/svg-css-transforms-expected.png: Added.
  • platform/mac/svg/transforms/svg-css-transforms-expected.txt: Added.
  • svg/clip-path/clip-path-css-transform-1.svg: Added.
  • svg/clip-path/clip-path-css-transform-2.svg: Added.
  • svg/custom/clip-path-with-css-transform-1.svg: Added.
  • svg/custom/clip-path-with-css-transform-2.svg: Added.
  • svg/custom/pointer-events-image-css-transform.svg: Added.
  • svg/custom/pointer-events-text-css-transform.svg: Added.
  • svg/dom/css-transforms-expected.txt: Added.
  • svg/dom/css-transforms.xhtml: Added.
  • svg/dynamic-updates/SVG-dynamic-css-transform-expected.txt: Added.
  • svg/dynamic-updates/SVG-dynamic-css-transform.html: Added.
  • svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting-expected.txt: Added.
  • svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting.html: Added.
  • svg/dynamic-updates/script-tests/SVGClipPathElement-css-transform-influences-hitTesting.js: Added.

(executeBackgroundTest):
(executeTest):

  • svg/transforms/svg-css-transforms-clip-path.xhtml: Added.
  • svg/transforms/svg-css-transforms.xhtml: Added.
Location:
trunk
Files:
38 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101060 r101062  
     12011-11-23  Raul Hudea  <rhudea@adobe.com>
     2
     3        First step towards http://webkit.org/b/70025
     4
     5        Allow -webkit-transform to be have effect to SVG elements.
     6        Currently, the CSS transform takes precedence over the SVG transform attribute
     7
     8        Allow SVG elements to be transformed using webkit-transform
     9        https://bugs.webkit.org/show_bug.cgi?id=71309
     10
     11        Reviewed by Nikolas Zimmermann.
     12
     13        * platform/chromium/test_expectations.txt:
     14        * platform/mac/svg/clip-path/clip-path-css-transform-1-expected.png: Added.
     15        * platform/mac/svg/clip-path/clip-path-css-transform-1-expected.txt: Added.
     16        * platform/mac/svg/clip-path/clip-path-css-transform-2-expected.png: Added.
     17        * platform/mac/svg/clip-path/clip-path-css-transform-2-expected.txt: Added.
     18        * platform/mac/svg/custom/clip-path-with-css-transform-1-expected.png: Added.
     19        * platform/mac/svg/custom/clip-path-with-css-transform-1-expected.txt: Added.
     20        * platform/mac/svg/custom/clip-path-with-css-transform-2-expected.png: Added.
     21        * platform/mac/svg/custom/clip-path-with-css-transform-2-expected.txt: Added.
     22        * platform/mac/svg/custom/pointer-events-image-css-transform-expected.png: Added.
     23        * platform/mac/svg/custom/pointer-events-image-css-transform-expected.txt: Added.
     24        * platform/mac/svg/custom/pointer-events-text-css-transform-expected.png: Added.
     25        * platform/mac/svg/custom/pointer-events-text-css-transform-expected.txt: Added.
     26        * platform/mac/svg/dom/css-transforms-expected.png: Added.
     27        * platform/mac/svg/dynamic-updates/SVG-dynamic-css-transform-expected.png: Added.
     28        * platform/mac/svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting-expected.png: Added.
     29        * platform/mac/svg/transforms/svg-css-transforms-clip-path-expected.png: Added.
     30        * platform/mac/svg/transforms/svg-css-transforms-clip-path-expected.txt: Added.
     31        * platform/mac/svg/transforms/svg-css-transforms-expected.png: Added.
     32        * platform/mac/svg/transforms/svg-css-transforms-expected.txt: Added.
     33        * svg/clip-path/clip-path-css-transform-1.svg: Added.
     34        * svg/clip-path/clip-path-css-transform-2.svg: Added.
     35        * svg/custom/clip-path-with-css-transform-1.svg: Added.
     36        * svg/custom/clip-path-with-css-transform-2.svg: Added.
     37        * svg/custom/pointer-events-image-css-transform.svg: Added.
     38        * svg/custom/pointer-events-text-css-transform.svg: Added.
     39        * svg/dom/css-transforms-expected.txt: Added.
     40        * svg/dom/css-transforms.xhtml: Added.
     41        * svg/dynamic-updates/SVG-dynamic-css-transform-expected.txt: Added.
     42        * svg/dynamic-updates/SVG-dynamic-css-transform.html: Added.
     43        * svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting-expected.txt: Added.
     44        * svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting.html: Added.
     45        * svg/dynamic-updates/script-tests/SVGClipPathElement-css-transform-influences-hitTesting.js: Added.
     46        (executeBackgroundTest):
     47        (executeTest):
     48        * svg/transforms/svg-css-transforms-clip-path.xhtml: Added.
     49        * svg/transforms/svg-css-transforms.xhtml: Added.
     50
    1512011-10-08  Martin Robinson  <mrobinson@igalia.com>
    252
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r101032 r101062  
    34513451BUGWK68436 SNOWLEOPARD CPU : svg/W3C-SVG-1.1/paths-data-12-t.svg = IMAGE+TEXT
    34523452
     3453// New tests that needs rebaseling for chromium ports
     3454BUGWK71309 : svg/clip-path/clip-path-css-transform-1.svg = IMAGE
     3455BUGWK71309 : svg/clip-path/clip-path-css-transform-2.svg = IMAGE
     3456BUGWK71309 : svg/custom/clip-path-with-css-transform-1.svg = IMAGE
     3457BUGWK71309 : svg/custom/clip-path-with-css-transform-2.svg = IMAGE
     3458BUGWK71309 : svg/custom/pointer-events-image-css-transform.svg = IMAGE
     3459BUGWK71309 : svg/custom/pointer-events-text-css-transform.svg = IMAGE
     3460BUGWK71309 : svg/dynamic-updates/SVG-dynamic-css-transform.html = IMAGE
     3461BUGWK71309 : svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting.html = IMAGE
     3462BUGWK71309 : svg/dom/css-transforms.xhtml = IMAGE
     3463BUGWK71309 : svg/transforms/svg-css-transforms-clip-path.xhtml = IMAGE
     3464BUGWK71309 : svg/transforms/svg-css-transforms.xhtml = IMAGE
     3465
    34533466// Tests that are known to exhibit TEXT failures on Mac10.5 with Skia (CPU and/or GPU) graphics.
    34543467BUGWK68437 LEOPARD CPU : canvas/philip/tests/2d.text.draw.fontface.notinpage.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r101061 r101062  
     12011-11-23  Raul Hudea  <rhudea@adobe.com>
     2
     3        First step towards http://webkit.org/b/70025
     4
     5        Allow -webkit-transform to be have effect to SVG elements.
     6        Currently, the CSS transform takes precedence over the SVG transform attribute
     7
     8        Allow SVG elements to be transformed using webkit-transform
     9        https://bugs.webkit.org/show_bug.cgi?id=71309
     10
     11        Reviewed by Nikolas Zimmermann.
     12
     13        Tests: svg/clip-path/clip-path-css-transform-1.svg
     14               svg/clip-path/clip-path-css-transform-2.svg
     15               svg/custom/clip-path-with-css-transform-1.svg
     16               svg/custom/clip-path-with-css-transform-2.svg
     17               svg/custom/pointer-events-image-css-transform.svg
     18               svg/custom/pointer-events-text-css-transform.svg
     19               svg/dom/css-transforms.xhtml
     20               svg/dynamic-updates/SVG-dynamic-css-transform.html
     21               svg/dynamic-updates/SVGClipPathElement-css-transform-influences-hitTesting.html
     22               svg/transforms/svg-css-transforms-clip-path.xhtml
     23               svg/transforms/svg-css-transforms.xhtml
     24
     25        * manual-tests/svg-animation-css-transform.html: Added.
     26        * manual-tests/svg-css-animate-compound.html: Added.
     27        * manual-tests/svg-css-transition-compound.html: Added.
     28        * rendering/svg/RenderSVGModelObject.cpp:
     29        (WebCore::RenderSVGModelObject::styleWillChange):
     30
     31        Set the updateTransform flag on SVG elements whenever a CSS transform is present on the style
     32
     33        * svg/SVGStyledTransformableElement.cpp:
     34        (WebCore::SVGStyledTransformableElement::animatedLocalTransform):
     35
     36        Use the RenderStyle's transform (if it exists) over the SVG's transform
     37
     38        * svg/SVGTextElement.cpp:
     39        (WebCore::SVGTextElement::animatedLocalTransform):
     40
     41        Use the RenderStyle's transform (if it exists) over the SVG's transform
     42
    1432011-11-23  Rafael Weinstein  <rafaelw@chromium.org>
    244
  • trunk/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp

    r100225 r101062  
    9292void RenderSVGModelObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
    9393{
    94     if (diff == StyleDifferenceLayout)
     94    if (diff == StyleDifferenceLayout) {
    9595        setNeedsBoundariesUpdate();
     96        if (newStyle->hasTransform())
     97            setNeedsTransformUpdate();
     98    }
    9699    RenderObject::styleWillChange(diff, newStyle);
    97100}
  • trunk/Source/WebCore/svg/SVGStyledTransformableElement.cpp

    r99833 r101062  
    6565{
    6666    AffineTransform matrix;
    67     transform().concatenate(matrix);
     67    RenderStyle* style = renderer()->style();
     68
     69    // if CSS property was set, use that, otherwise fallback to attribute (if set)
     70    if (style->hasTransform()) {
     71        TransformationMatrix t;
     72        // For now, the transform-origin is not taken into account
     73        // Also, any percentage values will not be taken into account
     74        style->applyTransform(t, IntSize(0, 0), RenderStyle::ExcludeTransformOrigin);
     75        // Flatten any 3D transform
     76        matrix = t.toAffineTransform();
     77    } else
     78        transform().concatenate(matrix);
     79
    6880    if (m_supplementalTransform)
    6981        return *m_supplementalTransform * matrix;
  • trunk/Source/WebCore/svg/SVGTextElement.cpp

    r96307 r101062  
    112112{
    113113    AffineTransform matrix;
    114     transform().concatenate(matrix);
     114    RenderStyle* style = renderer()->style();
     115
     116    // if CSS property was set, use that, otherwise fallback to attribute (if set)
     117    if (style->hasTransform()) {
     118        TransformationMatrix t;
     119        // For now, the transform-origin is not taken into account
     120        // Also, any percentage values will not be taken into account
     121        style->applyTransform(t, IntSize(0, 0), RenderStyle::ExcludeTransformOrigin);
     122        // Flatten any 3D transform
     123        matrix = t.toAffineTransform();
     124    } else
     125        transform().concatenate(matrix);
     126
    115127    if (m_supplementalTransform)
    116128        return *m_supplementalTransform * matrix;
Note: See TracChangeset for help on using the changeset viewer.