Changeset 54551 in webkit


Ignore:
Timestamp:
Feb 9, 2010 8:08:18 AM (14 years ago)
Author:
Nikolas Zimmermann
Message:

2010-02-09 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze.

No scroll bars are displayed for standalone SVG image
https://bugs.webkit.org/show_bug.cgi?id=11225

Height and width defined for svg element are not honored
https://bugs.webkit.org/show_bug.cgi?id=24033

SVG file does not pan and has no scroll bars
https://bugs.webkit.org/show_bug.cgi?id=24448

Adapt to SVG 1.1 errata to change the overflow handling:
Replace "svg { overflow: hidden }" by "svg:not(:root) { overflow: hidden }" to allow standalone SVG documents to contain scrolllbars.
Agreed by SVG WG to make this the default behaviour, already implemented by Opera & FireFox (partial support).

Add new tests in svg/overflow covering all special SVG css overflow handling rules on inner/outer svg elements.

Tests: svg/overflow/overflow-on-inner-svg-element-defaults.svg

svg/overflow/overflow-on-inner-svg-element.svg
svg/overflow/overflow-on-outermost-svg-element-defaults.svg
svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1.svg
svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2.svg
svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3.svg
svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto.xhtml
svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml
svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden.xhtml
svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll.xhtml
svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible.xhtml

  • css/svg.css: Change default <svg> overflow rule to only apply to inner <svg> elements.
  • page/FrameView.cpp: (WebCore::FrameView::layout): Only apply overflow rules for non-standalone SVG documents.
  • rendering/RenderSVGRoot.cpp: Remove all calls to isOverflowHidden - it's always the case for the outermost SVG element, see spec + errata. (WebCore::RenderSVGRoot::paint): Always clip to initial viewport size. (WebCore::RenderSVGRoot::computeRectForRepaint): Ditto. (WebCore::RenderSVGRoot::nodeAtPoint): Simplify.
  • rendering/RenderSVGViewportContainer.cpp: (WebCore::RenderSVGViewportContainer::applyViewportClip): Use isOverflowHidden() instead of a manual oveflow query and clip in float precision.
  • rendering/SVGRenderSupport.cpp: (WebCore::SVGRenderBase::isOverflowHidden): Simplify implementation, assure the function is not called anymore for RenderSVGRoot objects.
Location:
trunk
Files:
46 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r54544 r54551  
     12010-02-09  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        No scroll bars are displayed for standalone SVG image
     6        https://bugs.webkit.org/show_bug.cgi?id=11225
     7
     8        Height and width defined for svg element are not honored
     9        https://bugs.webkit.org/show_bug.cgi?id=24033
     10
     11        SVG file does not pan and has no scroll bars
     12        https://bugs.webkit.org/show_bug.cgi?id=24448
     13
     14        Modify some tests to account that overflow is now properly handled. Add new results for several overflow tests.
     15
     16        * platform/mac/svg/custom/baseval-animval-equality-expected.txt:
     17        * platform/mac/svg/custom/focus-ring-expected.txt:
     18        * platform/mac/svg/custom/foreignObject-crash-on-hover-expected.txt:
     19        * platform/mac/svg/custom/path-bad-data-expected.txt:
     20        * platform/mac/svg/overflow: Added.
     21        * platform/mac/svg/overflow/overflow-on-inner-svg-element-defaults-expected.checksum: Added.
     22        * platform/mac/svg/overflow/overflow-on-inner-svg-element-defaults-expected.png: Added.
     23        * platform/mac/svg/overflow/overflow-on-inner-svg-element-defaults-expected.txt: Added.
     24        * platform/mac/svg/overflow/overflow-on-inner-svg-element-expected.checksum: Added.
     25        * platform/mac/svg/overflow/overflow-on-inner-svg-element-expected.png: Added.
     26        * platform/mac/svg/overflow/overflow-on-inner-svg-element-expected.txt: Added.
     27        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.checksum: Added.
     28        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.png: Added.
     29        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-defaults-expected.txt: Added.
     30        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1-expected.checksum: Added.
     31        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1-expected.png: Added.
     32        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1-expected.txt: Added.
     33        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.checksum: Added.
     34        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.png: Added.
     35        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2-expected.txt: Added.
     36        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.checksum: Added.
     37        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.png: Added.
     38        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3-expected.txt: Added.
     39        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto-expected.checksum: Added.
     40        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto-expected.png: Added.
     41        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto-expected.txt: Added.
     42        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.checksum: Added.
     43        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.png: Added.
     44        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults-expected.txt: Added.
     45        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden-expected.checksum: Added.
     46        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden-expected.png: Added.
     47        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden-expected.txt: Added.
     48        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll-expected.checksum: Added.
     49        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll-expected.png: Added.
     50        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll-expected.txt: Added.
     51        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible-expected.checksum: Added.
     52        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible-expected.png: Added.
     53        * platform/mac/svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible-expected.txt: Added.
     54        * platform/mac/svg/text/text-gradient-positioning-expected.checksum:
     55        * platform/mac/svg/text/text-gradient-positioning-expected.png:
     56        * platform/mac/svg/text/text-gradient-positioning-expected.txt:
     57        * svg/custom/focus-ring.svg: Shrink viewport size to avoid displaying scrollbars.
     58        * svg/custom/foreignObject-crash-on-hover.xml: Ditto.
     59        * svg/custom/path-bad-data.svg: Ditto.
     60        * svg/overflow: Added.
     61        * svg/overflow/overflow-on-inner-svg-element-defaults.svg: Added.
     62        * svg/overflow/overflow-on-inner-svg-element.svg: Added.
     63        * svg/overflow/overflow-on-outermost-svg-element-defaults.svg: Added.
     64        * svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1.svg: Added.
     65        * svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2.svg: Added.
     66        * svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3.svg: Added.
     67        * svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto.xhtml: Added.
     68        * svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml: Added.
     69        * svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden.xhtml: Added.
     70        * svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll.xhtml: Added.
     71        * svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible.xhtml: Added.
     72        * svg/text/text-gradient-positioning.svg: Shrink viewport size to avoid displaying scrollbars.
     73
    1742010-02-09  Yuzo Fujishima  <yuzo@google.com>
    275
  • trunk/LayoutTests/platform/mac/svg/custom/baseval-animval-equality-expected.txt

    r54483 r54551  
    33layer at (0,0) size 600x400
    44  RenderSVGRoot {svg} at (0,0) size 600x400
    5     RenderForeignObject {foreignObject} at (0,0) size 800x198
    6       RenderBlock {html} at (0,0) size 800x198
    7         RenderBlock {div} at (0,0) size 800x198
    8           RenderBlock (anonymous) at (0,0) size 800x18
     5    RenderForeignObject {foreignObject} at (0,0) size 785x198
     6      RenderBlock {html} at (0,0) size 785x198
     7        RenderBlock {div} at (0,0) size 785x198
     8          RenderBlock (anonymous) at (0,0) size 785x18
    99            RenderText {#text} at (0,0) size 560x18
    1010              text run at (0,0) width 560: "This tests to make sure that baseVal and animVal are tied when animation is not enabled:"
    11           RenderBlock {div} at (0,18) size 800x18
     11          RenderBlock {div} at (0,18) size 785x18
    1212            RenderText {#text} at (0,0) size 152x18
    1313              text run at (0,0) width 152: "svg.x.baseVal.value = 0"
    14           RenderBlock {div} at (0,36) size 800x18
     14          RenderBlock {div} at (0,36) size 785x18
    1515            RenderText {#text} at (0,0) size 155x18
    1616              text run at (0,0) width 155: "svg.x.animVal.value = 0"
    17           RenderBlock {div} at (0,54) size 800x18
     17          RenderBlock {div} at (0,54) size 785x18
    1818            RenderText {#text} at (0,0) size 205x18
    1919              text run at (0,0) width 205: "setting svg.x.baseVal.value = 10"
    20           RenderBlock {div} at (0,72) size 800x18
     20          RenderBlock {div} at (0,72) size 785x18
    2121            RenderText {#text} at (0,0) size 160x18
    2222              text run at (0,0) width 160: "svg.x.baseVal.value = 10"
    23           RenderBlock {div} at (0,90) size 800x18
     23          RenderBlock {div} at (0,90) size 785x18
    2424            RenderText {#text} at (0,0) size 163x18
    2525              text run at (0,0) width 163: "svg.x.animVal.value = 10"
    26           RenderBlock {div} at (0,108) size 800x18
     26          RenderBlock {div} at (0,108) size 785x18
    2727            RenderText {#text} at (0,0) size 122x18
    2828              text run at (0,0) width 122: "SUCCESS (1 of 2)"
    29           RenderBlock {div} at (0,126) size 800x18
     29          RenderBlock {div} at (0,126) size 785x18
    3030            RenderText {#text} at (0,0) size 200x18
    3131              text run at (0,0) width 200: "setting svg.x.animVal.value = 5"
    32           RenderBlock {div} at (0,144) size 800x18
     32          RenderBlock {div} at (0,144) size 785x18
    3333            RenderText {#text} at (0,0) size 152x18
    3434              text run at (0,0) width 152: "svg.x.baseVal.value = 5"
    35           RenderBlock {div} at (0,162) size 800x18
     35          RenderBlock {div} at (0,162) size 785x18
    3636            RenderText {#text} at (0,0) size 155x18
    3737              text run at (0,0) width 155: "svg.x.animVal.value = 5"
    38           RenderBlock {div} at (0,180) size 800x18
     38          RenderBlock {div} at (0,180) size 785x18
    3939            RenderText {#text} at (0,0) size 122x18
    4040              text run at (0,0) width 122: "SUCCESS (2 of 2)"
  • trunk/LayoutTests/platform/mac/svg/custom/focus-ring-expected.txt

    r54483 r54551  
    11KCanvasResource {id="clip" [type=CLIPPER] [clip data=[[winding=NON-ZERO] [path=M0.00,0.00 L100.00,0.00 L100.00,100.00 L0.00,100.00 Z]]]}
    2 layer at (0,0) size 800x1000
     2layer at (0,0) size 800x600
    33  RenderView at (0,0) size 800x600
    4 layer at (0,0) size 800x1000
    5   RenderSVGRoot {svg} at (0,0) size 800x1000
     4layer at (0,0) size 800x600
     5  RenderSVGRoot {svg} at (0,0) size 800x600
    66    RenderPath {circle} at (15,10) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [data="M115.00,60.00 L114.90,63.14 L114.61,66.27 L114.11,69.37 L113.43,72.43 L112.55,75.45 L111.49,78.41 L110.24,81.29 L108.82,84.09 L107.22,86.79 L105.45,89.39 L103.53,91.87 L101.45,94.23 L99.23,96.45 L96.87,98.53 L94.39,100.45 L91.79,102.22 L89.09,103.82 L86.29,105.24 L83.41,106.49 L80.45,107.55 L77.43,108.43 L74.37,109.11 L71.27,109.61 L68.14,109.90 L65.00,110.00 L61.86,109.90 L58.73,109.61 L55.63,109.11 L52.57,108.43 L49.55,107.55 L46.59,106.49 L43.71,105.24 L40.91,103.82 L38.21,102.22 L35.61,100.45 L33.13,98.53 L30.77,96.45 L28.55,94.23 L26.47,91.87 L24.55,89.39 L22.78,86.79 L21.18,84.09 L19.76,81.29 L18.51,78.41 L17.45,75.45 L16.57,72.43 L15.89,69.37 L15.39,66.27 L15.10,63.14 L15.00,60.00 L15.10,56.86 L15.39,53.73 L15.89,50.63 L16.57,47.57 L17.45,44.55 L18.51,41.59 L19.76,38.71 L21.18,35.91 L22.78,33.21 L24.55,30.61 L26.47,28.13 L28.55,25.77 L30.77,23.55 L33.13,21.47 L35.61,19.55 L38.21,17.78 L40.91,16.18 L43.71,14.76 L46.59,13.51 L49.55,12.45 L52.57,11.57 L55.63,10.89 L58.73,10.39 L61.86,10.10 L65.00,10.00 L68.14,10.10 L71.27,10.39 L74.37,10.89 L77.43,11.57 L80.45,12.45 L83.41,13.51 L86.29,14.76 L89.09,16.18 L91.79,17.78 L94.39,19.55 L96.87,21.47 L99.23,23.55 L101.45,25.77 L103.53,28.13 L105.45,30.61 L107.22,33.21 L108.82,35.91 L110.24,38.71 L111.49,41.59 L112.55,44.55 L113.43,47.57 L114.11,50.63 L114.61,53.73 L114.90,56.86 Z"]
    77    RenderPath {path} at (140,10) size 100x100 [fill={[type=SOLID] [color=#FFA500]}] [data="M140.00,10.00 L190.00,110.00 L240.00,60.00 L220.00,60.00 L200.00,30.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/custom/foreignObject-crash-on-hover-expected.txt

    r54483 r54551  
    1 layer at (0,0) size 800x800
     1layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x800
    4   RenderSVGRoot {svg} at (0,0) size 800x800
     3layer at (0,0) size 800x600
     4  RenderSVGRoot {svg} at (0,0) size 800x600
    55    RenderSVGContainer {g} at (49,49) size 302x302 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,50.00)}]
    66      RenderPath {polygon} at (49,49) size 302x302 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#ADD8E6]}] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]
  • trunk/LayoutTests/platform/mac/svg/custom/path-bad-data-expected.txt

    r54483 r54551  
    77CONSOLE MESSAGE: line 15: Error: Problem parsing d="M 0"
    88CONSOLE MESSAGE: line 16: Error: Problem parsing d="M 0 0 0"
    9 layer at (0,0) size 800x755
     9layer at (0,0) size 800x600
    1010  RenderView at (0,0) size 800x600
    11 layer at (0,0) size 755x755
    12   RenderSVGRoot {svg} at (0,0) size 755x755
     11layer at (0,0) size 800x600
     12  RenderSVGRoot {svg} at (0,0) size 800x600
    1313    RenderPath {path} at (0,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L200.00,0.00 L200.00,200.00 L0.00,200.00"]
    1414    RenderPath {path} at (0,0) size 0x0 [stroke={[type=SOLID] [color=#FF0000]}] [fill={[type=SOLID] [color=#FF0000]}] [data=""]
  • trunk/LayoutTests/platform/mac/svg/text/text-gradient-positioning-expected.checksum

    r42966 r54551  
    1 5c0c51950ad3e846aec9734d2e36e766
     1772fa354840f50d49bc6d9c715228fcb
  • trunk/LayoutTests/platform/mac/svg/text/text-gradient-positioning-expected.txt

    r54483 r54551  
    11KRenderingPaintServer {id="gradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (1.00,#FF0000)]] [bounding box mode=0] [transform={m=((1.23,0.00)(0.00,1.26)) t=(-38.87,-39.26)}] [start=(120.03,161.07)] [end=(497.52,184.77)]}
    2 layer at (0,0) size 850x600
     2layer at (0,0) size 800x600
    33  RenderView at (0,0) size 800x600
    4 layer at (0,0) size 850x200
    5   RenderSVGRoot {svg} at (0,0) size 850x200
     4layer at (0,0) size 800x200
     5  RenderSVGRoot {svg} at (0,0) size 800x200
    66    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    77      RenderSVGHiddenContainer {linearGradient} at (0,0) size 0x0
    88        RenderSVGGradientStop {stop} at (0,0) size 0x0
    99        RenderSVGGradientStop {stop} at (0,0) size 0x0
    10     RenderSVGContainer {g} at (0,54) size 826x59
    11       RenderSVGText {text} at (0,100) size 826x59 contains 1 chunk(s)
    12         RenderSVGInlineText {#text} at (0,-46) size 826x59
    13           chunk 1 text run 1 at (0.00,100.00) startOffset 0 endOffset 37 width 826.00: "This should be GREEN and appear once."
    14     RenderSVGContainer {use} at (0,54) size 826x59
    15       RenderSVGContainer {g} at (0,54) size 826x59
    16         RenderSVGText {text} at (0,100) size 826x59 contains 1 chunk(s)
    17           RenderSVGInlineText {#text} at (0,-46) size 826x59
    18             chunk 1 text run 1 at (0.00,100.00) startOffset 0 endOffset 37 width 826.00: "This should be GREEN and appear once."
     10    RenderSVGContainer {g} at (0,64) size 660x46
     11      RenderSVGText {text} at (0,100) size 660x46 contains 1 chunk(s)
     12        RenderSVGInlineText {#text} at (0,-36) size 660x46
     13          chunk 1 text run 1 at (0.00,100.00) startOffset 0 endOffset 37 width 660.00: "This should be GREEN and appear once."
     14    RenderSVGContainer {use} at (0,64) size 660x46
     15      RenderSVGContainer {g} at (0,64) size 660x46
     16        RenderSVGText {text} at (0,100) size 660x46 contains 1 chunk(s)
     17          RenderSVGInlineText {#text} at (0,-36) size 660x46
     18            chunk 1 text run 1 at (0.00,100.00) startOffset 0 endOffset 37 width 660.00: "This should be GREEN and appear once."
  • trunk/LayoutTests/svg/custom/focus-ring.svg

    r26424 r54551  
    1 <svg width="800" height="1000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
     1<svg width="800" height="600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    22  <style>
    33    .ring {
  • trunk/LayoutTests/svg/custom/foreignObject-crash-on-hover.xml

    r28962 r54551  
    55     xmlns:xlink="http://www.w3.org/1999/xlink"
    66     xmlns:html="http://www.w3.org/1999/xhtml"
    7      height="800" width="800">
     7     height="600" width="800">
    88  <g transform="translate(50,50)">
    99    <polygon points="0,0 300,0 300,300 0,300" style="fill:lightblue; stroke:red;"/>
  • trunk/LayoutTests/svg/custom/path-bad-data.svg

    r18489 r54551  
    33"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
    44<svg
    5    width="200mm"
    6    height="200mm"
     5   width="800"
     6   height="600"
    77   xmlns="http://www.w3.org/2000/svg">
    88   <path fill="green" d="M 0 0 L 200 0 L 200 200 L 0 200"/>
  • trunk/LayoutTests/svg/text/text-gradient-positioning.svg

    r42966 r54551  
    1 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="850" height="200">
     1<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="200">
    22  <defs>
    33         <linearGradient gradientTransform="matrix(1.23267, 0, 0, 1.25718, -38.8716, -39.2565)" gradientUnits="userSpaceOnUse" id="gradient" x1="120.02892" x2="497.52158" y1="161.06746" y2="184.7655">
     
    77  </defs>
    88  <g fill="url(#gradient)">
    9     <text id="text" y="100" font-size="50px">This should be GREEN and appear once.</text>
     9    <text id="text" y="100" font-size="40px">This should be GREEN and appear once.</text>
    1010  </g>
    1111  <use xlink:href="#text" fill="green"/>
  • trunk/WebCore/ChangeLog

    r54542 r54551  
     12010-02-09  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        No scroll bars are displayed for standalone SVG image
     6        https://bugs.webkit.org/show_bug.cgi?id=11225
     7
     8        Height and width defined for svg element are not honored
     9        https://bugs.webkit.org/show_bug.cgi?id=24033
     10
     11        SVG file does not pan and has no scroll bars
     12        https://bugs.webkit.org/show_bug.cgi?id=24448
     13
     14        Adapt to SVG 1.1 errata to change the overflow handling:
     15        Replace "svg { overflow: hidden }"  by "svg:not(:root) { overflow: hidden }" to allow standalone SVG documents to contain scrolllbars.
     16        Agreed by SVG WG to make this the default behaviour, already implemented by Opera & FireFox (partial support).
     17
     18        Add new tests in svg/overflow covering all special SVG css overflow handling rules on inner/outer svg elements.
     19
     20        Tests: svg/overflow/overflow-on-inner-svg-element-defaults.svg
     21               svg/overflow/overflow-on-inner-svg-element.svg
     22               svg/overflow/overflow-on-outermost-svg-element-defaults.svg
     23               svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-1.svg
     24               svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-2.svg
     25               svg/overflow/overflow-on-outermost-svg-element-ignore-attribute-3.svg
     26               svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto.xhtml
     27               svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml
     28               svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden.xhtml
     29               svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll.xhtml
     30               svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible.xhtml
     31
     32        * css/svg.css: Change default <svg> overflow rule to only apply to inner <svg> elements.
     33        * page/FrameView.cpp:
     34        (WebCore::FrameView::layout): Only apply overflow rules for non-standalone SVG documents.
     35        * rendering/RenderSVGRoot.cpp: Remove all calls to isOverflowHidden - it's always the case for the outermost SVG element, see spec + errata.
     36        (WebCore::RenderSVGRoot::paint): Always clip to initial viewport size.
     37        (WebCore::RenderSVGRoot::computeRectForRepaint): Ditto.
     38        (WebCore::RenderSVGRoot::nodeAtPoint): Simplify.
     39        * rendering/RenderSVGViewportContainer.cpp:
     40        (WebCore::RenderSVGViewportContainer::applyViewportClip): Use isOverflowHidden() instead of a manual oveflow query and clip in float precision.
     41        * rendering/SVGRenderSupport.cpp:
     42        (WebCore::SVGRenderBase::isOverflowHidden): Simplify implementation, assure the function is not called anymore for RenderSVGRoot objects.
     43
    1442010-02-09  Kwang Yul Seo  <skyul@company100.net>
    245
  • trunk/WebCore/css/svg.css

    r26821 r54551  
    3333    outermost 'svg' element is ignored for the purposes of visual rendering and the initial clipping path is set
    3434    to the bounds of the initial viewport.
     35
     36    When an outermost 'svg' element is embedded inline within a parent XML grammar which uses CSS layout
     37    [CSS2-LAYOUT] or XSL formatting [XSL], if the 'overflow' property has the value hidden or scroll, then
     38    the user agent will establish an initial clipping path equal to the bounds of the initial viewport; otherwise,
     39    the initial clipping path is set according to the clipping rules as defined in [CSS2-overflow].
     40
     41    Opera/Firefox & WebKit agreed on NOT setting "overflow: hidden" for the outermost svg element - SVG 1.1 Errata
     42    contains these changes as well as all future SVG specifications: see http://lists.w3.org/Archives/Public/public-svg-wg/2008JulSep/0347.html
    3543*/
    36 svg:root {
    37     overflow: hidden !important
     44
     45svg:not(:root), symbol, image, marker, pattern, foreignObject {
     46    overflow: hidden
    3847}
    3948
     
    4150    width: 100%;
    4251    height: 100%;
    43 }
    44 
    45 svg, symbol, marker, pattern {
    46     overflow: hidden
    4752}
    4853
  • trunk/WebCore/page/FrameView.cpp

    r54440 r54551  
    619619                if (!m_firstLayout && (m_size.width() != layoutWidth() || m_size.height() != layoutHeight()))
    620620                    rootRenderer->setChildNeedsLayout(true);
    621             }
    622 #endif
     621            } else
     622                applyOverflowToViewport(rootRenderer, hMode, vMode);
     623#else
    623624            applyOverflowToViewport(rootRenderer, hMode, vMode);
     625#endif
    624626        }
    625627#ifdef INSTRUMENT_LAYOUT_SCHEDULING
  • trunk/WebCore/rendering/RenderSVGRoot.cpp

    r54503 r54551  
    141141    childPaintInfo.context->save();
    142142
    143     // In SVG special rules need to be applied that differ from the CSS overflow handling,
    144     // see comments in svg.css for spec references, explaining this behaviour
    145     if (SVGRenderBase::isOverflowHidden(this))
    146         childPaintInfo.context->clip(overflowClipRect(borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y()));
     143    // Apply initial viewport clip - not affected by overflow handling
     144    childPaintInfo.context->clip(overflowClipRect(borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y()));
    147145
    148146    // Convert from container offsets (html renderers) to a relative transform (svg renderers).
     
    256254    repaintRect = localToBorderBoxTransform().mapRect(repaintRect);
    257255
    258     // In SVG special rules need to be applied that differ from the CSS overflow handling,
    259     // see comments in svg.css for spec references, explaining this behaviour
    260     if (SVGRenderBase::isOverflowHidden(this))
    261         repaintRect.intersect(enclosingIntRect(FloatRect(FloatPoint(), m_viewportSize)));
     256    // Apply initial viewport clip - not affected by overflow settings   
     257    repaintRect.intersect(enclosingIntRect(FloatRect(FloatPoint(), m_viewportSize)));
    262258
    263259    style()->svgStyle()->inflateForShadow(repaintRect);
     
    284280
    285281    // Note: For now, we're ignoring hits to border and padding for <svg>
    286     if (SVGRenderBase::isOverflowHidden(this)) {
    287         IntPoint pointInContentBox = pointInBorderBox - borderOriginToContentBox();
    288         if (!contentBoxRect().contains(pointInContentBox))
    289             return false;
    290     }
     282    IntPoint pointInContentBox = pointInBorderBox - borderOriginToContentBox();
     283    if (!contentBoxRect().contains(pointInContentBox))
     284        return false;
    291285
    292286    IntPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
  • trunk/WebCore/rendering/RenderSVGViewportContainer.cpp

    r54503 r54551  
    6464void RenderSVGViewportContainer::applyViewportClip(PaintInfo& paintInfo)
    6565{
    66     if (style()->overflowX() != OVISIBLE)
    67         paintInfo.context->clip(enclosingIntRect(m_viewport)); // FIXME: Eventually we'll want float-precision clipping
     66    if (SVGRenderBase::isOverflowHidden(this))
     67        paintInfo.context->clip(m_viewport);
    6868}
    6969
  • trunk/WebCore/rendering/SVGRenderSupport.cpp

    r54503 r54551  
    261261bool SVGRenderBase::isOverflowHidden(const RenderObject* object)
    262262{
    263     if (object->style()->overflowX() == OHIDDEN) {
    264         // SVG doesn't support independent x/y overflow
    265         ASSERT(object->style()->overflowY() == OHIDDEN);
    266         return true;
    267     }
    268 
    269     return false;
     263    // SVG doesn't support independent x/y overflow
     264    ASSERT(object->style()->overflowX() == object->style()->overflowY());
     265
     266    // OSCROLL is never set for SVG - see CSSStyleSelector::adjustRenderStyle
     267    ASSERT(object->style()->overflowX() != OSCROLL);
     268
     269    // RenderSVGRoot should never query for overflow state - it should always clip itself to the initial viewport size.
     270    ASSERT(!object->isRoot());
     271
     272    return object->style()->overflowX() == OHIDDEN;
    270273}
    271274
Note: See TracChangeset for help on using the changeset viewer.