Changeset 168674 in webkit


Ignore:
Timestamp:
May 12, 2014 11:04:58 PM (10 years ago)
Author:
krit@webkit.org
Message:

SVG root element accepts background color but fails to repaint it
https://bugs.webkit.org/show_bug.cgi?id=63153

Reviewed by Dean Jackson.

Source/WebCore:
This is back ported from Blink. Don't know the exact commit though.
The patch checks if the SVGSVGElement is an outermost root element.
If it is, mark the whole element for repaint.

Test: svg/custom/svg-root-background.html

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::calculateHasBoxDecorations):
(WebCore::RenderBoxModelObject::updateFromStyle):

  • rendering/RenderBoxModelObject.h:
  • rendering/svg/RenderSVGRoot.cpp:

(WebCore::RenderSVGRoot::RenderSVGRoot):
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::paintReplaced):
(WebCore::RenderSVGRoot::clippedOverflowRectForRepaint):

This is a simple optimization by taking the necessary parts
from RenderReplaced and SVGRenderSupport.

  • rendering/svg/RenderSVGRoot.h:

LayoutTests:
Check that background color updates if the size of an outermost
root SVG element changes.

  • svg/custom/svg-root-background-expected.png: Added.
  • svg/custom/svg-root-background-expected.txt: Added.
  • svg/custom/svg-root-background.html: Added.
Location:
trunk
Files:
6 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168669 r168674  
     12014-05-12  Dirk Schulze  <krit@webkit.org>
     2
     3        SVG root element accepts background color but fails to repaint it
     4        https://bugs.webkit.org/show_bug.cgi?id=63153
     5
     6        Reviewed by Dean Jackson.
     7
     8        Check that background color updates if the size of an outermost
     9        root SVG element changes.
     10
     11        * svg/custom/svg-root-background-expected.png: Added.
     12        * svg/custom/svg-root-background-expected.txt: Added.
     13        * svg/custom/svg-root-background.html: Added.
     14
    1152014-05-12  Jeffrey Pfau  <jpfau@apple.com>
    216
  • trunk/LayoutTests/platform/mac/http/tests/misc/slow-loading-image-in-pattern-expected.txt

    r103407 r168674  
    1515    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    1616      RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
    17         RenderSVGImage {image} at (13,53) size 403x303
    18     RenderSVGRect {rect} at (13,53) size 400x300 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
     17        RenderSVGImage {image} at (10,50) size 406x306
     18    RenderSVGRect {rect} at (10,50) size 406x306 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=400.00] [height=300.00]
  • trunk/LayoutTests/platform/mac/svg/custom/circle-move-invalidation-expected.txt

    r112667 r168674  
    55    RenderBody {body} at (8,8) size 784x340
    66      RenderBlock (anonymous) at (0,0) size 784x306
    7         RenderSVGRoot {svg} at (195,195) size 78x78
    8           RenderSVGEllipse {circle} at (196,196) size 76x76 [fill={[type=SOLID] [color=#FF0000]}] [cx=300.00] [cy=300.00] [r=50.00]
     7        RenderSVGRoot {svg} at (8,8) size 302x306
     8          RenderSVGEllipse {circle} at (8,8) size 302x306 [fill={[type=SOLID] [color=#FF0000]}] [cx=300.00] [cy=300.00] [r=50.00]
    99        RenderText {#text} at (302,288) size 4x18
    1010          text run at (302,288) width 4: " "
  • trunk/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-expected.txt

    r161884 r168674  
    44  RenderBlock {html} at (0,0) size 800x410
    55    RenderBody {body} at (0,0) size 800x410
    6       RenderSVGRoot {svg} at (45,33) size 361x373
    7         RenderSVGContainer {g} at (303,303) size 100x100
    8           RenderSVGEllipse {circle} at (303,303) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=350.00] [cy=350.00] [r=50.00]
     6      RenderSVGRoot {svg} at (0,0) size 406x410
     7        RenderSVGContainer {g} at (0,0) size 406x410
     8          RenderSVGEllipse {circle} at (0,0) size 406x410 [fill={[type=SOLID] [color=#008000]}] [cx=350.00] [cy=350.00] [r=50.00]
    99        RenderSVGText {text} at (48,36) size 304x18 contains 1 chunk(s)
    1010          RenderSVGInlineText {#text} at (0,0) size 303x18
  • trunk/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-container-standalone-expected.txt

    r161884 r168674  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 406x406
    4   RenderSVGRoot {svg} at (45,33) size 361x373
    5     RenderSVGContainer {g} at (303,303) size 100x100
    6       RenderSVGEllipse {circle} at (303,303) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=350.00] [cy=350.00] [r=50.00]
     4  RenderSVGRoot {svg} at (0,0) size 406x406
     5    RenderSVGContainer {g} at (0,0) size 406x406
     6      RenderSVGEllipse {circle} at (0,0) size 406x406 [fill={[type=SOLID] [color=#008000]}] [cx=350.00] [cy=350.00] [r=50.00]
    77    RenderSVGText {text} at (48,36) size 304x18 contains 1 chunk(s)
    88      RenderSVGInlineText {#text} at (0,0) size 303x18
  • trunk/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-expected.txt

    r112667 r168674  
    44  RenderBlock {html} at (0,0) size 800x410
    55    RenderBody {body} at (0,0) size 800x410
    6       RenderSVGRoot {svg} at (90,33) size 226x223
    7         RenderSVGEllipse {circle} at (150,150) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=197.00] [cy=197.00] [r=50.00]
     6      RenderSVGRoot {svg} at (0,0) size 406x410
     7        RenderSVGEllipse {circle} at (0,0) size 406x410 [fill={[type=SOLID] [color=#008000]}] [cx=197.00] [cy=197.00] [r=50.00]
    88        RenderSVGText {text} at (93,36) size 214x18 contains 1 chunk(s)
    99          RenderSVGInlineText {#text} at (0,0) size 214x18
  • trunk/LayoutTests/platform/mac/svg/custom/mouse-move-on-svg-root-standalone-expected.txt

    r112667 r168674  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 406x406
    4   RenderSVGRoot {svg} at (90,33) size 226x223
    5     RenderSVGEllipse {circle} at (150,150) size 100x100 [fill={[type=SOLID] [color=#008000]}] [cx=197.00] [cy=197.00] [r=50.00]
     4  RenderSVGRoot {svg} at (0,0) size 406x406
     5    RenderSVGEllipse {circle} at (0,0) size 406x406 [fill={[type=SOLID] [color=#008000]}] [cx=197.00] [cy=197.00] [r=50.00]
    66    RenderSVGText {text} at (93,36) size 214x18 contains 1 chunk(s)
    77      RenderSVGInlineText {#text} at (0,0) size 214x18
  • trunk/LayoutTests/platform/mac/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt

    r104356 r168674  
    88      RenderBR {br} at (762,0) size 0x18
    99      RenderBR {br} at (0,18) size 0x18
    10       RenderSVGRoot {svg} at (8,44) size 202x203
    11         RenderSVGContainer {g} at (9,45) size 200x200
    12           RenderSVGRect {rect} at (9,145) size 100x50 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=100.00] [width=100.00] [height=50.00]
    13           RenderSVGRect {rect} at (109,45) size 100x50 [fill={[type=SOLID] [color=#FF0000]}] [x=100.00] [y=0.00] [width=100.00] [height=50.00]
    14           RenderSVGRect {rect} at (9,145) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=100.00] [width=100.00] [height=100.00]
    15           RenderSVGRect {rect} at (109,45) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=100.00] [y=0.00] [width=100.00] [height=100.00]
     10      RenderSVGRoot {svg} at (8,44) size 202x306
     11        RenderSVGContainer {g} at (8,44) size 202x306
     12          RenderSVGRect {rect} at (8,44) size 202x306 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=100.00] [width=100.00] [height=50.00]
     13          RenderSVGRect {rect} at (8,44) size 202x306 [fill={[type=SOLID] [color=#FF0000]}] [x=100.00] [y=0.00] [width=100.00] [height=50.00]
     14          RenderSVGRect {rect} at (8,44) size 202x306 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=100.00] [width=100.00] [height=100.00]
     15          RenderSVGRect {rect} at (8,44) size 202x306 [fill={[type=PATTERN] [id="pattern"]}] [x=100.00] [y=0.00] [width=100.00] [height=100.00]
    1616      RenderText {#text} at (202,324) size 4x18
    1717        text run at (202,324) width 4: " "
    18       RenderSVGRoot {svg} at (214,44) size 202x287
     18      RenderSVGRoot {svg} at (214,44) size 202x306
    1919        RenderSVGText {text} at (5,266) size 81x18 contains 1 chunk(s)
    2020          RenderSVGInlineText {#text} at (0,0) size 81x18
    2121            chunk 1 text run 1 at (5.00,280.00) startOffset 0 endOffset 11 width 81.00: "+Transforms"
    22         RenderSVGContainer {g} at (215,145) size 100x100 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,100.00)}]
    23           RenderSVGRect {rect} at (215,145) size 100x50 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00]
    24           RenderSVGRect {rect} at (215,145) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    25         RenderSVGContainer {g} at (315,45) size 100x100 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,0.00)}]
    26           RenderSVGRect {rect} at (315,45) size 100x50 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00]
    27           RenderSVGRect {rect} at (315,45) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     22        RenderSVGContainer {g} at (214,44) size 202x306 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,100.00)}]
     23          RenderSVGRect {rect} at (214,44) size 202x306 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00]
     24          RenderSVGRect {rect} at (214,44) size 202x306 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     25        RenderSVGContainer {g} at (214,44) size 202x306 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,0.00)}]
     26          RenderSVGRect {rect} at (214,44) size 202x306 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00]
     27          RenderSVGRect {rect} at (214,44) size 202x306 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    2828        RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    2929          RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
    30             RenderSVGRect {rect} at (215,45) size 100x25 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=25.00]
    31             RenderSVGRect {rect} at (215,70) size 100x25 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=25.00] [width=100.00] [height=25.00]
     30            RenderSVGRect {rect} at (214,44) size 202x306 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=25.00]
     31            RenderSVGRect {rect} at (214,44) size 202x306 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=25.00] [width=100.00] [height=25.00]
    3232      RenderText {#text} at (408,324) size 4x18
    3333        text run at (408,324) width 4: " "
    3434      RenderText {#text} at (0,0) size 0x0
    3535layer at (420,44) size 202x302
    36   RenderSVGRoot {svg} at (420,44) size 202x287
     36  RenderSVGRoot {svg} at (420,44) size 202x306
    3737    RenderSVGText {text} at (5,266) size 169x18 contains 1 chunk(s)
    3838      RenderSVGInlineText {#text} at (0,0) size 169x18
    3939        chunk 1 text run 1 at (5.00,280.00) startOffset 0 endOffset 24 width 169.00: "+Accelerated Compositing"
    40     RenderSVGContainer {g} at (421,45) size 200x200
    41       RenderSVGRect {rect} at (421,145) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=100.00] [width=100.00] [height=100.00]
    42       RenderSVGRect {rect} at (521,45) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=100.00] [y=0.00] [width=100.00] [height=100.00]
     40    RenderSVGContainer {g} at (420,44) size 202x306
     41      RenderSVGRect {rect} at (420,44) size 202x306 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=100.00] [width=100.00] [height=100.00]
     42      RenderSVGRect {rect} at (420,44) size 202x306 [fill={[type=PATTERN] [id="pattern"]}] [x=100.00] [y=0.00] [width=100.00] [height=100.00]
  • trunk/LayoutTests/platform/mac/svg/custom/svg-float-border-padding-expected.txt

    r103407 r168674  
    1212          text run at (0,0) width 354: "There should be a red, white and blue pattern below this"
    1313      RenderSVGRoot {svg} at (18,86) size 140x140
    14         RenderSVGRect {rect} at (38,106) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     14        RenderSVGRect {rect} at (18,86) size 140x140 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    1515      RenderBlock {p} at (0,228) size 784x18
    1616        RenderText {#text} at (0,0) size 353x18
  • trunk/LayoutTests/platform/mac/svg/hixie/mixed/010-expected.txt

    r103407 r168674  
    88          text run at (0,0) width 238: "There should be a green block below."
    99      RenderBlock (anonymous) at (0,34) size 784x104
    10         RenderSVGRoot {svg} at (8,50) size 300x100
    11           RenderSVGRect {rect} at (8,50) size 300x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=300.00] [height=100.00]
    12           RenderSVGRect {rect} at (8,50) size 300x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=300.00] [height=100.00]
     10        RenderSVGRoot {svg} at (8,50) size 300x104
     11          RenderSVGRect {rect} at (8,50) size 300x104 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=300.00] [height=100.00]
     12          RenderSVGRect {rect} at (8,50) size 300x104 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=300.00] [height=100.00]
    1313        RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/svg/text/small-fonts-in-html5-expected.txt

    r161884 r168674  
    88          text run at (0,0) width 471: "Small fonts in HTML5/inline SVG"
    99      RenderBlock (anonymous) at (0,58) size 784x507
    10         RenderSVGRoot {svg} at (157,259) size 104x31
    11           RenderSVGContainer {g} at (159,261) size 100x27 [transform={m=((400.00,0.00)(0.00,400.00)) t=(0.00,0.00)}]
     10        RenderSVGRoot {svg} at (8,79) size 502x507
     11          RenderSVGContainer {g} at (8,79) size 502x507 [transform={m=((400.00,0.00)(0.00,400.00)) t=(0.00,0.00)}]
    1212            RenderSVGText {text} at (0,0) size 1x1 contains 1 chunk(s)
    1313              RenderSVGInlineText {#text} at (0,0) size 1x1
  • trunk/LayoutTests/platform/mac/svg/zoom/text/zoom-svg-float-border-padding-expected.txt

    r161884 r168674  
    1313          text run at (0,0) width 524: "There should be a red, white and blue pattern below this"
    1414      RenderSVGRoot {svg} at (18,142) size 140x141
    15         RenderSVGRect {rect} at (38,162) size 100x101 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     15        RenderSVGRect {rect} at (18,142) size 140x141 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    1616      RenderBlock {p} at (0,284) size 769x27
    1717        RenderText {#text} at (0,0) size 523x26
  • trunk/LayoutTests/svg/animations/animate-viewport-overflow-2-expected.txt

    r168543 r168674  
    66    RenderBody {BODY} at (8,8) size 784x100
    77      RenderBlock {DIV} at (0,0) size 100x100
    8         RenderSVGRoot {svg} at (8,208) size 100x100
    9           RenderSVGRect {rect} at (8,208) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=200.00] [width=100.00] [height=100.00]
     8        RenderSVGRoot {svg} at (8,8) size 100x300
     9          RenderSVGRect {rect} at (8,8) size 100x300 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=200.00] [width=100.00] [height=100.00]
    1010        RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/svg/animations/animate-viewport-overflow-expected.txt

    r168543 r168674  
    66    RenderBody {BODY} at (8,8) size 784x200
    77      RenderBlock {DIV} at (0,0) size 100x100
    8         RenderSVGRoot {svg} at (8,208) size 100x100
    9           RenderSVGRect {rect} at (8,208) size 100x100 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=200.00] [width=100.00] [height=100.00]
     8        RenderSVGRoot {svg} at (8,8) size 100x300
     9          RenderSVGRect {rect} at (8,8) size 100x300 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=200.00] [width=100.00] [height=100.00]
    1010        RenderText {#text} at (0,0) size 0x0
    1111      RenderBlock {DIV} at (0,100) size 100x100
  • trunk/LayoutTests/svg/custom/gradient-stroke-width-expected.txt

    r130599 r168674  
    22  RenderView at (0,0) size 800x600
    33layer at (0,0) size 200x500
    4   RenderSVGRoot {svg} at (32,32) size 123x123
     4  RenderSVGRoot {svg} at (0,0) size 200x500
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceLinearGradient {linearGradient} [id="black2white"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(1,0)]
     
    1212      RenderSVGResourceRadialGradient {radialGradient} [id="red-radial-grad"] [gradientUnits=objectBoundingBox] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50] [focalRadius=0.00]
    1313      RenderSVGResourceLinearGradient {linearGradient} [id="border-grad"] [gradientUnits=objectBoundingBox] [start=(0.05,0.95)] [end=(0.95,0.05)]
    14     RenderSVGEllipse {circle} at (45,45) size 110x110 [stroke={[type=LINEAR-GRADIENT] [id="border-grad"] [stroke width=10.00]}] [fill={[type=RADIAL-GRADIENT] [id="red-radial-grad"]}] [cx=100.00] [cy=100.00] [r=50.00]
    15     RenderSVGEllipse {circle} at (32,32) size 30x30 [stroke={[type=LINEAR-GRADIENT] [id="border-grad"] [stroke width=10.00]}] [fill={[type=RADIAL-GRADIENT] [id="red-radial-grad"]}] [cx=47.00] [cy=47.00] [r=10.00]
     14    RenderSVGEllipse {circle} at (0,0) size 200x500 [stroke={[type=LINEAR-GRADIENT] [id="border-grad"] [stroke width=10.00]}] [fill={[type=RADIAL-GRADIENT] [id="red-radial-grad"]}] [cx=100.00] [cy=100.00] [r=50.00]
     15    RenderSVGEllipse {circle} at (0,0) size 200x500 [stroke={[type=LINEAR-GRADIENT] [id="border-grad"] [stroke width=10.00]}] [fill={[type=RADIAL-GRADIENT] [id="red-radial-grad"]}] [cx=47.00] [cy=47.00] [r=10.00]
  • trunk/LayoutTests/svg/custom/repaint-moving-svg-and-div-expected.txt

    r107241 r168674  
    66layer at (250,350) size 150x150
    77  RenderSVGRoot {svg} at (250,350) size 150x150
    8     RenderSVGRect {rect} at (275,375) size 100x100 [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     8    RenderSVGRect {rect} at (250,350) size 150x150 [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    99layer at (550,350) size 150x150
    1010  RenderBlock (positioned) {div} at (550,350) size 150x150 [border: (5px solid #FF0000) (20px solid #FFFF00) (10px solid #008000) (15px solid #0000FF)]
  • trunk/LayoutTests/svg/custom/viewport-update2-expected.txt

    r149088 r168674  
    44  RenderSVGRoot {svg} at (0,0) size 110x110
    55    RenderSVGRect {rect} at (0,0) size 110x110 [fill={[type=SOLID] [color=#FF0000]}] [x=-100.00] [y=-100.00] [width=300.00] [height=300.00]
    6     RenderSVGRect {rect} at (5,5) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
     6    RenderSVGRect {rect} at (0,0) size 110x110 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
  • trunk/Source/WebCore/ChangeLog

    r168670 r168674  
     12014-05-12  Dirk Schulze  <krit@webkit.org>
     2
     3        SVG root element accepts background color but fails to repaint it
     4        https://bugs.webkit.org/show_bug.cgi?id=63153
     5
     6        Reviewed by Dean Jackson.
     7
     8        This is back ported from Blink. Don't know the exact commit though.
     9        The patch checks if the SVGSVGElement is an outermost root element.
     10        If it is, mark the whole element for repaint.
     11
     12        Test: svg/custom/svg-root-background.html
     13
     14        * rendering/RenderBoxModelObject.cpp:
     15        (WebCore::RenderBoxModelObject::calculateHasBoxDecorations):
     16        (WebCore::RenderBoxModelObject::updateFromStyle):
     17        * rendering/RenderBoxModelObject.h:
     18        * rendering/svg/RenderSVGRoot.cpp:
     19        (WebCore::RenderSVGRoot::RenderSVGRoot):
     20        (WebCore::RenderSVGRoot::layout):
     21        (WebCore::RenderSVGRoot::paintReplaced):
     22        (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint):
     23            This is a simple optimization by taking the necessary parts
     24            from RenderReplaced and SVGRenderSupport.
     25        * rendering/svg/RenderSVGRoot.h:
     26
    1272014-05-12  Simon Fraser  <simon.fraser@apple.com>
    228
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r168448 r168674  
    191191}
    192192
     193bool RenderBoxModelObject::hasBoxDecorationStyle() const
     194{
     195    return hasBackground() || style().hasBorder() || style().hasAppearance() || style().boxShadow();
     196}
     197
    193198void RenderBoxModelObject::updateFromStyle()
    194199{
     
    198203    // we only check for bits that could possibly be set to true.
    199204    const RenderStyle& styleToUse = style();
    200     setHasBoxDecorations(hasBackground() || styleToUse.hasBorder() || styleToUse.hasAppearance() || styleToUse.boxShadow());
     205    setHasBoxDecorations(hasBoxDecorationStyle());
    201206    setInline(styleToUse.isDisplayInlineType());
    202207    setPositionState(styleToUse.position());
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.h

    r168380 r168674  
    251251    LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const;
    252252
     253    bool hasBoxDecorationStyle() const;
    253254    void calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer*, const LayoutRect& paintRect, BackgroundImageGeometry&, RenderElement* = 0) const;
    254255    bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const;
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r168645 r168674  
    3333#include "Page.h"
    3434#include "RenderIterator.h"
     35#include "RenderLayer.h"
    3536#include "RenderNamedFlowFragment.h"
    3637#include "RenderSVGResource.h"
     
    5960    , m_needsBoundariesOrTransformUpdate(true)
    6061    , m_hasSVGShadow(false)
     62    , m_hasBoxDecorations(false)
    6163{
    6264}
     
    204206
    205207    updateLayerTransform();
     208    m_hasBoxDecorations = isRoot() ? hasBoxDecorationStyle() : hasBoxDecorations();
     209    invalidateBackgroundObscurationStatus();
    206210
    207211    repainter.repaintAfterLayout();
     
    358362    if (shouldApplyViewportClip())
    359363        repaintRect.intersect(pixelSnappedBorderBoxRect());
     364
     365    if (m_hasBoxDecorations || hasRenderOverflow()) {
     366        // The selectionRect can project outside of the overflowRect, so take their union
     367        // for repainting to avoid selection painting glitches.
     368        LayoutRect decoratedRepaintRect = unionRect(localSelectionRect(false), visualOverflowRect());
     369        repaintRect.unite(decoratedRepaintRect);
     370    }
    360371
    361372    LayoutRect rect = enclosingIntRect(repaintRect);
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.h

    r168543 r168674  
    120120    bool m_needsBoundariesOrTransformUpdate : 1;
    121121    bool m_hasSVGShadow : 1;
     122    bool m_hasBoxDecorations : 1;
    122123};
    123124
Note: See TracChangeset for help on using the changeset viewer.