Changeset 53103 in webkit
- Timestamp:
- Jan 11, 2010 2:56:09 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r53102 r53103 1 2010-01-11 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 New tests for https://bugs.webkit.org/show_bug.cgi?id=33491 6 REGRESSION: Many SVG -webkit-shadow tests are currently failing (in 7 the pixel tests) 8 -and- 9 <rdar://problem/7501200> 10 11 I would like to note that this change fixes some existing layout 12 tests as well. 13 14 * platform/mac/svg/css/shadow-with-large-radius-expected.checksum: Added. 15 * platform/mac/svg/css/shadow-with-large-radius-expected.png: Added. 16 * platform/mac/svg/css/shadow-with-large-radius-expected.txt: Added. 17 * platform/mac/svg/css/shadow-with-negative-offset-expected.checksum: Added. 18 * platform/mac/svg/css/shadow-with-negative-offset-expected.png: Added. 19 * platform/mac/svg/css/shadow-with-negative-offset-expected.txt: Added. 20 * platform/mac/svg/css/stars-with-shadow-expected.checksum: 21 * platform/mac/svg/css/stars-with-shadow-expected.png: 22 * svg/css/shadow-with-large-radius.svg: Added. 23 * svg/css/shadow-with-negative-offset.svg: Added. 24 25 1 26 2010-01-11 Eric Seidel <eric@webkit.org> 2 27 -
trunk/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum
r51800 r53103 1 201684955d552b1a57f8bced9aaa6e4e 1 de73673c1e37edf6d9f7f141bdf10bd0 -
trunk/WebCore/ChangeLog
r53100 r53103 1 2010-01-11 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Fix for https://bugs.webkit.org/show_bug.cgi?id=33491 REGRESSION: 6 Many SVG -webkit-shadow tests are currently failing (in the pixel 7 tests) 8 -and- 9 <rdar://problem/7501200> 10 11 The real fix here is to call inflateForShadow() on the repaintRect 12 in prepareToRenderSVGContent(). But in order to do that, I had to 13 move inflateForShadow() to a different class since functions in 14 SVGRenderBase cannot call each other. inflateForShadow() now exists 15 in SVGRenderStyle which I think makes some sense because a similar 16 function that returns a box shadow's extent exists on RenderStyle. 17 18 Now call inflateForShadow() through the SVGRenderStyle. 19 * rendering/RenderForeignObject.cpp: 20 (WebCore::RenderForeignObject::computeRectForRepaint): 21 * rendering/RenderSVGImage.cpp: 22 (WebCore::RenderSVGImage::computeRectForRepaint): 23 * rendering/RenderSVGModelObject.cpp: 24 (WebCore::RenderSVGModelObject::computeRectForRepaint): 25 * rendering/RenderSVGRoot.cpp: 26 (WebCore::RenderSVGRoot::computeRectForRepaint): 27 * rendering/RenderSVGText.cpp: 28 (WebCore::RenderSVGText::computeRectForRepaint): 29 30 No longer implement inflateForShadow() here. 31 * rendering/SVGRenderSupport.cpp: 32 (WebCore::SVGRenderBase::prepareToRenderSVGContent): Call new 33 inflateForShadow() through the SVGRenderStyle 34 * rendering/SVGRenderSupport.h: 35 36 Implementation of inflateForShadow() now lives here. 37 * rendering/style/SVGRenderStyle.cpp: 38 (WebCore::getSVGShadowExtent): 39 (WebCore::SVGRenderStyle::inflateForShadow): 40 * rendering/style/SVGRenderStyle.h: 41 1 42 2010-01-11 Alexander Pavlov <apavlov@chromium.org> 2 43 -
trunk/WebCore/rendering/RenderForeignObject.cpp
r53017 r53103 85 85 { 86 86 rect = localToParentTransform().mapRect(rect); 87 inflateForShadow(style(),rect);87 style()->svgStyle()->inflateForShadow(rect); 88 88 RenderBlock::computeRectForRepaint(repaintContainer, rect, fixed); 89 89 } -
trunk/WebCore/rendering/RenderSVGImage.cpp
r53017 r53103 176 176 void RenderSVGImage::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) 177 177 { 178 inflateForShadow(style(),repaintRect);178 style()->svgStyle()->inflateForShadow(repaintRect); 179 179 SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed); 180 180 } -
trunk/WebCore/rendering/RenderSVGModelObject.cpp
r53017 r53103 57 57 void RenderSVGModelObject::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) 58 58 { 59 inflateForShadow(style(),repaintRect);59 style()->svgStyle()->inflateForShadow(repaintRect); 60 60 SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed); 61 61 } -
trunk/WebCore/rendering/RenderSVGRoot.cpp
r53017 r53103 266 266 // and then call RenderBox's method to handle all the normal CSS Box model bits 267 267 repaintRect = localToBorderBoxTransform().mapRect(repaintRect); 268 inflateForShadow(style(),repaintRect);268 style()->svgStyle()->inflateForShadow(repaintRect); 269 269 RenderBox::computeRectForRepaint(repaintContainer, repaintRect, fixed); 270 270 } -
trunk/WebCore/rendering/RenderSVGText.cpp
r53017 r53103 60 60 void RenderSVGText::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) 61 61 { 62 inflateForShadow(style(),repaintRect);62 style()->svgStyle()->inflateForShadow(repaintRect); 63 63 SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed); 64 64 } -
trunk/WebCore/rendering/SVGRenderSupport.cpp
r53017 r53103 41 41 #include <wtf/UnusedParam.h> 42 42 43 using namespace std;44 45 43 namespace WebCore { 46 44 … … 62 60 } 63 61 64 static void getSVGShadowExtent(ShadowData* shadow, int& top, int& right, int& bottom, int& left)65 {66 top = 0;67 right = 0;68 bottom = 0;69 left = 0;70 71 int blurAndSpread = shadow->blur + shadow->spread;72 73 top = min(top, shadow->y - blurAndSpread);74 right = max(right, shadow->x + blurAndSpread);75 bottom = max(bottom, shadow->y + blurAndSpread);76 left = min(left, shadow->x - blurAndSpread);77 }78 79 void SVGRenderBase::inflateForShadow(RenderStyle* style, IntRect& repaintRect) const80 {81 ASSERT(style);82 if (!style)83 return;84 85 ShadowData* shadow = style->svgStyle()->shadow();86 if (!shadow)87 return;88 89 int shadowTop;90 int shadowRight;91 int shadowBottom;92 int shadowLeft;93 getSVGShadowExtent(shadow, shadowTop, shadowRight, shadowBottom, shadowLeft);94 95 int overflowLeft = repaintRect.x() + shadowLeft;96 int overflowRight = repaintRect.right() + shadowRight;97 int overflowTop = repaintRect.y() + shadowTop;98 int overflowBottom = repaintRect.bottom() + shadowBottom;99 100 repaintRect.setX(overflowLeft);101 repaintRect.setY(overflowTop);102 repaintRect.setWidth(overflowRight - overflowLeft);103 repaintRect.setHeight(overflowBottom - overflowTop);104 }105 106 62 void SVGRenderBase::computeRectForRepaint(RenderObject* object, RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed) 107 63 { … … 145 101 146 102 if (ShadowData* shadow = svgStyle->shadow()) { 147 int xShift = shadow->x < 0 ? shadow->x : 0; 148 int yShift = shadow->y < 0 ? shadow->y :0; 149 int widthShift = shadow->x < 0 ? 0 : shadow->x; 150 int heightShift = shadow->y < 0 ? 0 : shadow->y; 151 FloatRect shadowRect = FloatRect(repaintRect.x() + xShift, repaintRect.y() + yShift, 152 repaintRect.width() + widthShift, repaintRect.height() + heightShift); 153 paintInfo.context->clip(enclosingIntRect(shadowRect)); 103 IntRect shadowRect = enclosingIntRect(repaintRect); 104 svgStyle->inflateForShadow(shadowRect); 105 paintInfo.context->clip(shadowRect); 154 106 paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color, style->colorSpace()); 155 107 paintInfo.context->beginTransparencyLayer(1.0f); -
trunk/WebCore/rendering/SVGRenderSupport.h
r53017 r53103 57 57 FloatRect maskerBoundingBoxForRenderer(const RenderObject*) const; 58 58 59 virtual void inflateForShadow(RenderStyle*, IntRect&) const;60 61 59 protected: 62 60 static IntRect clippedOverflowRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer); -
trunk/WebCore/rendering/style/SVGRenderStyle.cpp
r50583 r53103 31 31 #include "CSSPrimitiveValue.h" 32 32 #include "CSSValueList.h" 33 #include "IntRect.h" 33 34 #include "NodeRenderStyle.h" 34 35 #include "RenderObject.h" 35 36 #include "RenderStyle.h" 36 37 #include "SVGStyledElement.h" 38 39 using namespace std; 37 40 38 41 namespace WebCore { … … 142 145 } 143 146 147 148 static void getSVGShadowExtent(ShadowData* shadow, int& top, int& right, int& bottom, int& left) 149 { 150 top = 0; 151 right = 0; 152 bottom = 0; 153 left = 0; 154 155 int blurAndSpread = shadow->blur + shadow->spread; 156 157 top = min(top, shadow->y - blurAndSpread); 158 right = max(right, shadow->x + blurAndSpread); 159 bottom = max(bottom, shadow->y + blurAndSpread); 160 left = min(left, shadow->x - blurAndSpread); 161 } 162 163 void SVGRenderStyle::inflateForShadow(IntRect& repaintRect) const 164 { 165 ShadowData* svgShadow = shadow(); 166 if (!svgShadow) 167 return; 168 169 int shadowTop; 170 int shadowRight; 171 int shadowBottom; 172 int shadowLeft; 173 getSVGShadowExtent(svgShadow, shadowTop, shadowRight, shadowBottom, shadowLeft); 174 175 int overflowLeft = repaintRect.x() + shadowLeft; 176 int overflowRight = repaintRect.right() + shadowRight; 177 int overflowTop = repaintRect.y() + shadowTop; 178 int overflowBottom = repaintRect.bottom() + shadowBottom; 179 180 repaintRect.setX(overflowLeft); 181 repaintRect.setY(overflowTop); 182 repaintRect.setWidth(overflowRight - overflowLeft); 183 repaintRect.setHeight(overflowBottom - overflowTop); 184 } 185 144 186 } 145 187 -
trunk/WebCore/rendering/style/SVGRenderStyle.h
r50583 r53103 37 37 class RenderObject; 38 38 class RenderStyle; 39 class IntRect; 39 40 40 41 class SVGRenderStyle : public RefCounted<SVGRenderStyle> { … … 46 47 bool inheritedNotEqual(const SVGRenderStyle*) const; 47 48 void inheritFrom(const SVGRenderStyle*); 49 50 void inflateForShadow(IntRect&) const; 48 51 49 52 bool operator==(const SVGRenderStyle&) const;
Note: See TracChangeset
for help on using the changeset viewer.