Changeset 112022 in webkit


Ignore:
Timestamp:
Mar 24, 2012 9:08:06 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

ForeignObject content is zoomed two times
https://bugs.webkit.org/show_bug.cgi?id=76282

Patch by Florin Malita <fmalita@google.com> on 2012-03-24
Reviewed by Nikolas Zimmermann.

Source/WebCore:

Test: svg/zoom/page/zoom-foreign-content.svg

Reset the effective zoom property for FO-nested content to avoid
having the zoom factor applied multiple times (zooming is handled by
the top level SVG root element).

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::adjustRenderStyle):

LayoutTests:

  • platform/chromium-linux/svg/zoom/page/zoom-foreignObject-expected.png:
  • platform/chromium-linux/svg/zoom/text/zoom-foreignObject-expected.png:
  • platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt:
  • platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt:

Rebaseline cr-linux expectations.

  • platform/chromium/test_expectations.txt:
  • platform/mac/test_expectations.txt:

Updated zoom-foreignObject.svg expectations, pending rebaseline.

  • svg/zoom/page/zoom-foreign-content-expected.png: Added.
  • svg/zoom/page/zoom-foreign-content-expected.txt: Added.
  • svg/zoom/page/zoom-foreign-content.svg: Added.
  • svg/zoom/page/zoom-foreignObject.svg:
  • svg/zoom/text/zoom-foreignObject.svg:

Updated test to cover SVG FO text.

Location:
trunk
Files:
3 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112021 r112022  
     12012-03-24  Florin Malita  <fmalita@google.com>
     2
     3        ForeignObject content is zoomed two times
     4        https://bugs.webkit.org/show_bug.cgi?id=76282
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        * platform/chromium-linux/svg/zoom/page/zoom-foreignObject-expected.png:
     9        * platform/chromium-linux/svg/zoom/text/zoom-foreignObject-expected.png:
     10        * platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt:
     11        * platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt:
     12        Rebaseline cr-linux expectations.
     13
     14        * platform/chromium/test_expectations.txt:
     15        * platform/mac/test_expectations.txt:
     16        Updated zoom-foreignObject.svg expectations, pending rebaseline.
     17
     18        * svg/zoom/page/zoom-foreign-content-expected.png: Added.
     19        * svg/zoom/page/zoom-foreign-content-expected.txt: Added.
     20        * svg/zoom/page/zoom-foreign-content.svg: Added.
     21
     22        * svg/zoom/page/zoom-foreignObject.svg:
     23        * svg/zoom/text/zoom-foreignObject.svg:
     24        Updated test to cover SVG FO text.
     25
    1262012-03-24  Chris Fleizach  <cfleizach@apple.com>
    227
  • trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt

    r103407 r112022  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (13,13) size 787x587
    5     RenderSVGForeignObject {foreignObject} at (10,10) size 580x380
    6       RenderBlock {xhtml:div} at (0,0) size 580x20
    7         RenderText {#text} at (0,0) size 74x19
    8           text run at (0,0) width 74: "This is a test"
    9       RenderBlock (anonymous) at (0,20) size 580x20
     4  RenderSVGRoot {svg} at (0,0) size 800x600
     5    RenderSVGForeignObject {foreignObject} at (0,0) size 250x200
     6      RenderBlock {xhtml:div} at (0,0) size 250x20
     7        RenderText {#text} at (0,0) size 75x19
     8          text run at (0,0) width 75: "This is a text"
     9      RenderBlock (anonymous) at (0,20) size 250x20
    1010        RenderInline {xhtml:a} at (0,0) size 62x19 [color=#0000EE]
    1111          RenderText {#text} at (0,0) size 62x19
    1212            text run at (0,0) width 62: "and a link."
    1313        RenderBR {xhtml:br} at (62,0) size 0x19
    14     RenderSVGRect {rect} at (13,13) size 787x550 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
     14      RenderBlock {xhtml:div} at (0,40) size 250x20
     15        RenderText {#text} at (0,0) size 53x19
     16          text run at (0,0) width 53: "[HTML]"
     17    RenderSVGRect {rect} at (0,0) size 361x289 [stroke={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=250.00] [height=200.00]
     18    RenderSVGForeignObject {foreignObject} at (260,0) size 250x200
     19      RenderSVGRoot {svg} at (260,3) size 250x200
     20        RenderSVGContainer {g} at (260,3) size 250x200 [transform={m=((3.00,0.26)(0.26,3.02)) t=(0.00,0.00)}]
     21          RenderSVGText {text} at (0,1) size 81x19 contains 1 chunk(s)
     22            RenderSVGInlineText {#text} at (0,0) size 81x19
     23              chunk 1 text run 1 at (0.00,16.00) startOffset 0 endOffset 14 width 80.06: "This is a text"
     24          RenderSVGContainer {a} at (265,60) size 201x75
     25            RenderSVGText {text} at (0,20) size 65x19 contains 1 chunk(s)
     26              RenderSVGInlineText {#text} at (0,0) size 65x19
     27                chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 11 width 64.51: "and a link."
     28          RenderSVGText {text} at (0,41) size 43x19 contains 1 chunk(s)
     29            RenderSVGInlineText {#text} at (0,0) size 43x19
     30              chunk 1 text run 1 at (0.00,56.00) startOffset 0 endOffset 5 width 42.67: "[SVG]"
     31      RenderText {#text} at (0,0) size 0x0
     32    RenderSVGRect {rect} at (373,0) size 363x289 [stroke={[type=SOLID] [color=#008000]}] [x=260.00] [y=0.00] [width=250.00] [height=200.00]
    1533    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
  • trunk/LayoutTests/platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt

    r103407 r112022  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 800x600
    4   RenderSVGRoot {svg} at (9,9) size 791x591
    5     RenderSVGForeignObject {foreignObject} at (10,10) size 580x380
    6       RenderBlock {xhtml:div} at (0,0) size 580x20
    7         RenderText {#text} at (0,0) size 74x19
    8           text run at (0,0) width 74: "This is a test"
    9       RenderBlock (anonymous) at (0,20) size 580x20
     4  RenderSVGRoot {svg} at (0,0) size 800x600
     5    RenderSVGForeignObject {foreignObject} at (0,0) size 250x200
     6      RenderBlock {xhtml:div} at (0,0) size 250x20
     7        RenderText {#text} at (0,0) size 75x19
     8          text run at (0,0) width 75: "This is a text"
     9      RenderBlock (anonymous) at (0,20) size 250x20
    1010        RenderInline {xhtml:a} at (0,0) size 62x19 [color=#0000EE]
    1111          RenderText {#text} at (0,0) size 62x19
    1212            text run at (0,0) width 62: "and a link."
    1313        RenderBR {xhtml:br} at (62,0) size 0x19
    14     RenderSVGRect {rect} at (9,9) size 582x382 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
     14      RenderBlock {xhtml:div} at (0,40) size 250x20
     15        RenderText {#text} at (0,0) size 53x19
     16          text run at (0,0) width 53: "[HTML]"
     17    RenderSVGRect {rect} at (0,0) size 251x201 [stroke={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=250.00] [height=200.00]
     18    RenderSVGForeignObject {foreignObject} at (260,0) size 250x200
     19      RenderSVGRoot {svg} at (260,3) size 250x200
     20        RenderSVGContainer {g} at (260,3) size 250x200 [transform={m=((3.00,0.26)(0.26,3.02)) t=(0.00,0.00)}]
     21          RenderSVGText {text} at (0,1) size 81x19 contains 1 chunk(s)
     22            RenderSVGInlineText {#text} at (0,0) size 81x19
     23              chunk 1 text run 1 at (0.00,16.00) startOffset 0 endOffset 14 width 80.06: "This is a text"
     24          RenderSVGContainer {a} at (265,60) size 201x75
     25            RenderSVGText {text} at (0,20) size 65x19 contains 1 chunk(s)
     26              RenderSVGInlineText {#text} at (0,0) size 65x19
     27                chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 11 width 64.51: "and a link."
     28          RenderSVGText {text} at (0,41) size 43x19 contains 1 chunk(s)
     29            RenderSVGInlineText {#text} at (0,0) size 43x19
     30              chunk 1 text run 1 at (0.00,56.00) startOffset 0 endOffset 5 width 42.67: "[SVG]"
     31      RenderText {#text} at (0,0) size 0x0
     32    RenderSVGRect {rect} at (259,0) size 252x201 [stroke={[type=SOLID] [color=#008000]}] [x=260.00] [y=0.00] [width=250.00] [height=200.00]
    1533    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r111990 r112022  
    12991299
    13001300
     1301// Updated tests need Win & Mac rebaselining after landing 76282
     1302BUGWK76282 WIN MAC : svg/zoom/page/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
     1303BUGWK76282 WIN MAC : svg/zoom/text/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
    13011304
    13021305
  • trunk/LayoutTests/platform/mac/test_expectations.txt

    r111910 r112022  
    210210BUGWK69210: fast/inline/continuation-outlines-with-layers.html = TEXT
    211211BUGWK69210: fast/repaint/transform-absolute-in-positioned-container.html = TEXT
     212
     213// Need rebaselining after 76282
     214BUGWK76282 : svg/zoom/page/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
     215BUGWK76282 : svg/zoom/text/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
    212216
    213217// Those tests need a text baseline after lazily allocating layers.
  • trunk/LayoutTests/svg/zoom/page/zoom-foreignObject.svg

    r107057 r112022  
    33     xmlns:xlink="http://www.w3.org/1999/xlink"
    44     xmlns:xhtml="http://www.w3.org/1999/xhtml">
    5 <foreignObject x="10" y="10" width="580" height="380" transform="scale(5) skewY(5) skewX(5)">
    6 <xhtml:div>This is a test</xhtml:div>
    7 <xhtml:a href="http://www.example.com/">and a link.</xhtml:a><xhtml:br/>
     5
     6<!-- HTML FO text -->
     7<foreignObject width="250" height="200" transform="scale(3) skewY(5) skewX(5)">
     8  <xhtml:div>This is a text</xhtml:div>
     9  <xhtml:a href="http://www.example.com/">and a link.</xhtml:a><xhtml:br/>
     10  <xhtml:div>[HTML]</xhtml:div>
    811</foreignObject>
    9 <rect x="10" y="10" width="580" height="380" stroke="green" fill="none" />
     12<rect width="250" height="200" stroke="green" fill="none" />
     13
     14<!-- SVG FO text -->
     15<foreignObject x="260" width="250" height="200">
     16  <svg xmlns="http://www.w3.org/2000/svg">
     17    <g transform="scale(3) skewY(5) skewX(5)">
     18      <text y="16">This is a text</text>
     19      <a xlink:href="http://www.example.com/">
     20        <text y="35" fill="blue" text-decoration="underline">and a link.</text>
     21      </a>
     22      <text y="56">[SVG]</text>
     23    </g>
     24  </svg>
     25</foreignObject>
     26<rect x="260" width="250" height="200" stroke="green" fill="none" />
    1027
    1128<defs>
  • trunk/LayoutTests/svg/zoom/text/zoom-foreignObject.svg

    r107057 r112022  
    33     xmlns:xlink="http://www.w3.org/1999/xlink"
    44     xmlns:xhtml="http://www.w3.org/1999/xhtml">
    5 <foreignObject x="10" y="10" width="580" height="380" transform="scale(5) skewY(5) skewX(5)">
    6 <xhtml:div>This is a test</xhtml:div>
    7 <xhtml:a href="http://www.example.com/">and a link.</xhtml:a><xhtml:br/>
     5
     6<!-- HTML FO text -->
     7<foreignObject width="250" height="200" transform="scale(3) skewY(5) skewX(5)">
     8  <xhtml:div>This is a text</xhtml:div>
     9  <xhtml:a href="http://www.example.com/">and a link.</xhtml:a><xhtml:br/>
     10  <xhtml:div>[HTML]</xhtml:div>
    811</foreignObject>
    9 <rect x="10" y="10" width="580" height="380" stroke="green" fill="none" />
     12<rect width="250" height="200" stroke="green" fill="none" />
     13
     14<!-- SVG FO text -->
     15<foreignObject x="260" width="250" height="200">
     16  <svg xmlns="http://www.w3.org/2000/svg">
     17    <g transform="scale(3) skewY(5) skewX(5)">
     18      <text y="16">This is a text</text>
     19      <a xlink:href="http://www.example.com/">
     20        <text y="35" fill="blue" text-decoration="underline">and a link.</text>
     21      </a>
     22      <text y="56">[SVG]</text>
     23    </g>
     24  </svg>
     25</foreignObject>
     26<rect x="260" width="250" height="200" stroke="green" fill="none" />
    1027
    1128<defs>
  • trunk/Source/WebCore/ChangeLog

    r112021 r112022  
     12012-03-24  Florin Malita  <fmalita@google.com>
     2
     3        ForeignObject content is zoomed two times
     4        https://bugs.webkit.org/show_bug.cgi?id=76282
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Test: svg/zoom/page/zoom-foreign-content.svg
     9
     10        Reset the effective zoom property for FO-nested content to avoid
     11        having the zoom factor applied multiple times (zooming is handled by
     12        the top level SVG root element).
     13
     14        * css/CSSStyleSelector.cpp:
     15        (WebCore::CSSStyleSelector::adjustRenderStyle):
     16
    1172012-03-24  Chris Fleizach  <cfleizach@apple.com>
    218
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r111867 r112022  
    20772077        if (!(e->hasTagName(SVGNames::svgTag) && e->parentNode() && !e->parentNode()->isSVGElement()))
    20782078            style->setPosition(RenderStyle::initialPosition());
     2079
     2080        // RenderSVGRoot handles zooming for the whole SVG subtree, so foreignObject content should
     2081        // not be scaled again.
     2082        if (e->hasTagName(SVGNames::foreignObjectTag))
     2083            style->setEffectiveZoom(RenderStyle::initialZoom());
    20792084    }
    20802085#endif
Note: See TracChangeset for help on using the changeset viewer.