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

Side by Side Diff: third_party/WebKit/Source/core/style/SVGComputedStyle.h

Issue 2322343003: Add support for <basic-shape> to 'clip-path' on SVG elements (Closed)
Patch Set: Update SPv2 expectations Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>
4 Copyright (C) 2005, 2006 Apple Computer, Inc. 4 Copyright (C) 2005, 2006 Apple Computer, Inc.
5 Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 static String initialStrokePaintUri() { return String(); } 80 static String initialStrokePaintUri() { return String(); }
81 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); 81 static PassRefPtr<SVGDashArray> initialStrokeDashArray();
82 static Length initialStrokeDashOffset() { return Length(Fixed); } 82 static Length initialStrokeDashOffset() { return Length(Fixed); }
83 static float initialStrokeMiterLimit() { return 4; } 83 static float initialStrokeMiterLimit() { return 4; }
84 static UnzoomedLength initialStrokeWidth() { return UnzoomedLength(Length(1, Fixed)); } 84 static UnzoomedLength initialStrokeWidth() { return UnzoomedLength(Length(1, Fixed)); }
85 static float initialStopOpacity() { return 1; } 85 static float initialStopOpacity() { return 1; }
86 static Color initialStopColor() { return Color(0, 0, 0); } 86 static Color initialStopColor() { return Color(0, 0, 0); }
87 static float initialFloodOpacity() { return 1; } 87 static float initialFloodOpacity() { return 1; }
88 static Color initialFloodColor() { return Color(0, 0, 0); } 88 static Color initialFloodColor() { return Color(0, 0, 0); }
89 static Color initialLightingColor() { return Color(255, 255, 255); } 89 static Color initialLightingColor() { return Color(255, 255, 255); }
90 static const AtomicString& initialClipperResource() { return nullAtom; } 90 static ClipPathOperation* initialClipPath() { return nullptr; }
91 static const AtomicString& initialMaskerResource() { return nullAtom; } 91 static const AtomicString& initialMaskerResource() { return nullAtom; }
92 static const AtomicString& initialMarkerStartResource() { return nullAtom; } 92 static const AtomicString& initialMarkerStartResource() { return nullAtom; }
93 static const AtomicString& initialMarkerMidResource() { return nullAtom; } 93 static const AtomicString& initialMarkerMidResource() { return nullAtom; }
94 static const AtomicString& initialMarkerEndResource() { return nullAtom; } 94 static const AtomicString& initialMarkerEndResource() { return nullAtom; }
95 static EMaskType initialMaskType() { return MT_LUMINANCE; } 95 static EMaskType initialMaskType() { return MT_LUMINANCE; }
96 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; } 96 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; }
97 static StylePath* initialD() { return nullptr; } 97 static StylePath* initialD() { return nullptr; }
98 static Length initialCx() { return Length(Fixed); } 98 static Length initialCx() { return Length(Fixed); }
99 static Length initialCy() { return Length(Fixed); } 99 static Length initialCy() { return Length(Fixed); }
100 static Length initialX() { return Length(Fixed); } 100 static Length initialX() { return Length(Fixed); }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 misc.access()->lightingColor = obj; 266 misc.access()->lightingColor = obj;
267 } 267 }
268 268
269 void setBaselineShiftValue(const Length& baselineShiftValue) 269 void setBaselineShiftValue(const Length& baselineShiftValue)
270 { 270 {
271 if (!(misc->baselineShiftValue == baselineShiftValue)) 271 if (!(misc->baselineShiftValue == baselineShiftValue))
272 misc.access()->baselineShiftValue = baselineShiftValue; 272 misc.access()->baselineShiftValue = baselineShiftValue;
273 } 273 }
274 274
275 // Setters for non-inherited resources 275 // Setters for non-inherited resources
276 void setClipperResource(const AtomicString& obj) 276 void setClipPath(PassRefPtr<ClipPathOperation> operation)
277 { 277 {
278 if (!(resources->clipper == obj)) 278 if (resources->clipPath != operation)
279 resources.access()->clipper = obj; 279 resources.access()->clipPath = operation;
280 } 280 }
281 281
282 void setMaskerResource(const AtomicString& obj) 282 void setMaskerResource(const AtomicString& obj)
283 { 283 {
284 if (!(resources->masker == obj)) 284 if (!(resources->masker == obj))
285 resources.access()->masker = obj; 285 resources.access()->masker = obj;
286 } 286 }
287 287
288 // Setters for inherited resources 288 // Setters for inherited resources
289 void setMarkerStartResource(const AtomicString& obj) 289 void setMarkerStartResource(const AtomicString& obj)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 const Color& lightingColor() const { return misc->lightingColor; } 338 const Color& lightingColor() const { return misc->lightingColor; }
339 const Length& baselineShiftValue() const { return misc->baselineShiftValue; } 339 const Length& baselineShiftValue() const { return misc->baselineShiftValue; }
340 StylePath* d() const { return geometry->d.get(); } 340 StylePath* d() const { return geometry->d.get(); }
341 const Length& cx() const { return geometry->cx; } 341 const Length& cx() const { return geometry->cx; }
342 const Length& cy() const { return geometry->cy; } 342 const Length& cy() const { return geometry->cy; }
343 const Length& x() const { return geometry->x; } 343 const Length& x() const { return geometry->x; }
344 const Length& y() const { return geometry->y; } 344 const Length& y() const { return geometry->y; }
345 const Length& r() const { return geometry->r; } 345 const Length& r() const { return geometry->r; }
346 const Length& rx() const { return geometry->rx; } 346 const Length& rx() const { return geometry->rx; }
347 const Length& ry() const { return geometry->ry; } 347 const Length& ry() const { return geometry->ry; }
348 const AtomicString& clipperResource() const { return resources->clipper; } 348 ClipPathOperation* clipPath() const { return resources->clipPath.get(); }
349 const AtomicString& maskerResource() const { return resources->masker; } 349 const AtomicString& maskerResource() const { return resources->masker; }
350 const AtomicString& markerStartResource() const { return inheritedResources- >markerStart; } 350 const AtomicString& markerStartResource() const { return inheritedResources- >markerStart; }
351 const AtomicString& markerMidResource() const { return inheritedResources->m arkerMid; } 351 const AtomicString& markerMidResource() const { return inheritedResources->m arkerMid; }
352 const AtomicString& markerEndResource() const { return inheritedResources->m arkerEnd; } 352 const AtomicString& markerEndResource() const { return inheritedResources->m arkerEnd; }
353 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas kType; } 353 EMaskType maskType() const { return (EMaskType) svg_noninherited_flags.f.mas kType; }
354 EPaintOrder paintOrder() const { return (EPaintOrder) svg_inherited_flags.pa intOrder; } 354 EPaintOrder paintOrder() const { return (EPaintOrder) svg_inherited_flags.pa intOrder; }
355 EPaintOrderType paintOrderType(unsigned index) const; 355 EPaintOrderType paintOrderType(unsigned index) const;
356 356
357 const SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedL inkPaintType; } 357 const SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedL inkPaintType; }
358 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai ntColor; } 358 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPai ntColor; }
(...skipping 12 matching lines...) Expand all
371 371
372 bool isStrokeColorCurrentColor() const 372 bool isStrokeColorCurrentColor() const
373 { 373 {
374 return strokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR 374 return strokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR
375 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR 375 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_CURRENTCOLOR
376 || strokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR 376 || strokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR
377 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR; 377 || visitedLinkStrokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR;
378 } 378 }
379 379
380 // convenience 380 // convenience
381 bool hasClipper() const { return !clipperResource().isEmpty(); }
382 bool hasMasker() const { return !maskerResource().isEmpty(); } 381 bool hasMasker() const { return !maskerResource().isEmpty(); }
383 bool hasMarkers() const { return !markerStartResource().isEmpty() || !marker MidResource().isEmpty() || !markerEndResource().isEmpty(); } 382 bool hasMarkers() const { return !markerStartResource().isEmpty() || !marker MidResource().isEmpty() || !markerEndResource().isEmpty(); }
384 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; } 383 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; }
385 bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero( ); } 384 bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero( ); }
386 bool hasSquareCapStyle() const { return capStyle() == SquareCap; } 385 bool hasSquareCapStyle() const { return capStyle() == SquareCap; }
387 bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; } 386 bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; }
388 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; } 387 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; }
389 388
390 protected: 389 protected:
391 // inherit 390 // inherit
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 svg_noninherited_flags.f.baselineShift = initialBaselineShift(); 481 svg_noninherited_flags.f.baselineShift = initialBaselineShift();
483 svg_noninherited_flags.f.vectorEffect = initialVectorEffect(); 482 svg_noninherited_flags.f.vectorEffect = initialVectorEffect();
484 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); 483 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering();
485 svg_noninherited_flags.f.maskType = initialMaskType(); 484 svg_noninherited_flags.f.maskType = initialMaskType();
486 } 485 }
487 }; 486 };
488 487
489 } // namespace blink 488 } // namespace blink
490 489
491 #endif // SVGComputedStyle_h 490 #endif // SVGComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGPaintContext.cpp ('k') | third_party/WebKit/Source/core/style/SVGComputedStyleDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698