Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: Source/core/rendering/svg/SVGRenderSupport.cpp

Issue 21042009: [SVG2] Merge SVGStyledElement into SVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 19 matching lines...) Expand all
30 #include "core/rendering/RenderGeometryMap.h" 30 #include "core/rendering/RenderGeometryMap.h"
31 #include "core/rendering/RenderLayer.h" 31 #include "core/rendering/RenderLayer.h"
32 #include "core/rendering/svg/RenderSVGResourceClipper.h" 32 #include "core/rendering/svg/RenderSVGResourceClipper.h"
33 #include "core/rendering/svg/RenderSVGResourceFilter.h" 33 #include "core/rendering/svg/RenderSVGResourceFilter.h"
34 #include "core/rendering/svg/RenderSVGResourceMasker.h" 34 #include "core/rendering/svg/RenderSVGResourceMasker.h"
35 #include "core/rendering/svg/RenderSVGRoot.h" 35 #include "core/rendering/svg/RenderSVGRoot.h"
36 #include "core/rendering/svg/RenderSVGText.h" 36 #include "core/rendering/svg/RenderSVGText.h"
37 #include "core/rendering/svg/RenderSVGViewportContainer.h" 37 #include "core/rendering/svg/RenderSVGViewportContainer.h"
38 #include "core/rendering/svg/SVGResources.h" 38 #include "core/rendering/svg/SVGResources.h"
39 #include "core/rendering/svg/SVGResourcesCache.h" 39 #include "core/rendering/svg/SVGResourcesCache.h"
40 #include "core/svg/SVGStyledElement.h" 40 #include "core/svg/SVGElement.h"
41 #include "wtf/UnusedParam.h" 41 #include "wtf/UnusedParam.h"
42 42
43 namespace WebCore { 43 namespace WebCore {
44 44
45 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o bject, const RenderLayerModelObject* repaintContainer) 45 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o bject, const RenderLayerModelObject* repaintContainer)
46 { 46 {
47 // Return early for any cases where we don't actually paint 47 // Return early for any cases where we don't actually paint
48 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent()) 48 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h asVisibleContent())
49 return LayoutRect(); 49 return LayoutRect();
50 50
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 if (transformChanged) { 218 if (transformChanged) {
219 // If the transform changed we need to update the text metrics (note : this also happens for layoutSizeChanged=true). 219 // If the transform changed we need to update the text metrics (note : this also happens for layoutSizeChanged=true).
220 if (child->isSVGText()) 220 if (child->isSVGText())
221 toRenderSVGText(child)->setNeedsTextMetricsUpdate(); 221 toRenderSVGText(child)->setNeedsTextMetricsUpdate();
222 needsLayout = true; 222 needsLayout = true;
223 } 223 }
224 224
225 if (layoutSizeChanged) { 225 if (layoutSizeChanged) {
226 // When selfNeedsLayout is false and the layout size changed, we hav e to check whether this child uses relative lengths 226 // When selfNeedsLayout is false and the layout size changed, we hav e to check whether this child uses relative lengths
227 if (SVGElement* element = child->node()->isSVGElement() ? toSVGEleme nt(child->node()) : 0) { 227 if (SVGElement* element = child->node()->isSVGElement() ? toSVGEleme nt(child->node()) : 0) {
228 if (element->isSVGStyledElement() && toSVGStyledElement(element) ->hasRelativeLengths()) { 228 if (element->hasRelativeLengths()) {
229 // When the layout size changed and when using relative valu es tell the RenderSVGShape to update its shape object 229 // When the layout size changed and when using relative valu es tell the RenderSVGShape to update its shape object
230 if (child->isSVGShape()) 230 if (child->isSVGShape())
231 toRenderSVGShape(child)->setNeedsShapeUpdate(); 231 toRenderSVGShape(child)->setNeedsShapeUpdate();
232 else if (child->isSVGText()) { 232 else if (child->isSVGText()) {
233 toRenderSVGText(child)->setNeedsTextMetricsUpdate(); 233 toRenderSVGText(child)->setNeedsTextMetricsUpdate();
234 toRenderSVGText(child)->setNeedsPositioningValuesUpdate( ); 234 toRenderSVGText(child)->setNeedsPositioningValuesUpdate( );
235 } 235 }
236 236
237 needsLayout = true; 237 needsLayout = true;
238 } 238 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 DashArray dashArray; 383 DashArray dashArray;
384 const Vector<SVGLength>::const_iterator end = dashes.end(); 384 const Vector<SVGLength>::const_iterator end = dashes.end();
385 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it) 385 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it)
386 dashArray.append((*it).value(lengthContext)); 386 dashArray.append((*it).value(lengthContext));
387 387
388 strokeData->setLineDash(dashArray, svgStyle->strokeDashOffset().value(length Context)); 388 strokeData->setLineDash(dashArray, svgStyle->strokeDashOffset().value(length Context));
389 } 389 }
390 390
391 } 391 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGViewportContainer.cpp ('k') | Source/core/rendering/svg/SVGResources.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698