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

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

Issue 1439793003: SVG: Promote d to a property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CSSPropertyParser Created 5 years 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 static Color initialFloodColor() { return Color(0, 0, 0); } 83 static Color initialFloodColor() { return Color(0, 0, 0); }
84 static Color initialLightingColor() { return Color(255, 255, 255); } 84 static Color initialLightingColor() { return Color(255, 255, 255); }
85 static const AtomicString& initialClipperResource() { return nullAtom; } 85 static const AtomicString& initialClipperResource() { return nullAtom; }
86 static const AtomicString& initialFilterResource() { return nullAtom; } 86 static const AtomicString& initialFilterResource() { return nullAtom; }
87 static const AtomicString& initialMaskerResource() { return nullAtom; } 87 static const AtomicString& initialMaskerResource() { return nullAtom; }
88 static const AtomicString& initialMarkerStartResource() { return nullAtom; } 88 static const AtomicString& initialMarkerStartResource() { return nullAtom; }
89 static const AtomicString& initialMarkerMidResource() { return nullAtom; } 89 static const AtomicString& initialMarkerMidResource() { return nullAtom; }
90 static const AtomicString& initialMarkerEndResource() { return nullAtom; } 90 static const AtomicString& initialMarkerEndResource() { return nullAtom; }
91 static EMaskType initialMaskType() { return MT_LUMINANCE; } 91 static EMaskType initialMaskType() { return MT_LUMINANCE; }
92 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; } 92 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; }
93 static const SVGPathByteStream* initialD() { return nullptr; }
fs 2015/11/26 12:51:40 It feels like having a "template" - empty path obj
Eric Willigers 2015/12/10 23:52:52 I like the template empty path object, but who sho
fs 2015/12/11 13:01:58 It looks like you handled this in the way at least
93 static Length initialCx() { return Length(Fixed); } 94 static Length initialCx() { return Length(Fixed); }
94 static Length initialCy() { return Length(Fixed); } 95 static Length initialCy() { return Length(Fixed); }
95 static Length initialX() { return Length(Fixed); } 96 static Length initialX() { return Length(Fixed); }
96 static Length initialY() { return Length(Fixed); } 97 static Length initialY() { return Length(Fixed); }
97 static Length initialR() { return Length(Fixed); } 98 static Length initialR() { return Length(Fixed); }
98 static Length initialRx() { return Length(Fixed); } 99 static Length initialRx() { return Length(Fixed); }
99 static Length initialRy() { return Length(Fixed); } 100 static Length initialRy() { return Length(Fixed); }
100 101
101 // SVG CSS Property setters 102 // SVG CSS Property setters
102 void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f .alignmentBaseline = val; } 103 void setAlignmentBaseline(EAlignmentBaseline val) { svg_noninherited_flags.f .alignmentBaseline = val; }
103 void setDominantBaseline(EDominantBaseline val) { svg_inherited_flags.domina ntBaseline = val; } 104 void setDominantBaseline(EDominantBaseline val) { svg_inherited_flags.domina ntBaseline = val; }
104 void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f.baselin eShift = val; } 105 void setBaselineShift(EBaselineShift val) { svg_noninherited_flags.f.baselin eShift = val; }
105 void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f.vectorEff ect = val; } 106 void setVectorEffect(EVectorEffect val) { svg_noninherited_flags.f.vectorEff ect = val; }
106 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f .bufferedRendering = val; } 107 void setBufferedRendering(EBufferedRendering val) { svg_noninherited_flags.f .bufferedRendering = val; }
107 void setCapStyle(LineCap val) { svg_inherited_flags.capStyle = val; } 108 void setCapStyle(LineCap val) { svg_inherited_flags.capStyle = val; }
108 void setClipRule(WindRule val) { svg_inherited_flags.clipRule = val; } 109 void setClipRule(WindRule val) { svg_inherited_flags.clipRule = val; }
109 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags.co lorInterpolation = val; } 110 void setColorInterpolation(EColorInterpolation val) { svg_inherited_flags.co lorInterpolation = val; }
110 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f lags.colorInterpolationFilters = val; } 111 void setColorInterpolationFilters(EColorInterpolation val) { svg_inherited_f lags.colorInterpolationFilters = val; }
111 void setColorRendering(EColorRendering val) { svg_inherited_flags.colorRende ring = val; } 112 void setColorRendering(EColorRendering val) { svg_inherited_flags.colorRende ring = val; }
112 void setFillRule(WindRule val) { svg_inherited_flags.fillRule = val; } 113 void setFillRule(WindRule val) { svg_inherited_flags.fillRule = val; }
113 void setJoinStyle(LineJoin val) { svg_inherited_flags.joinStyle = val; } 114 void setJoinStyle(LineJoin val) { svg_inherited_flags.joinStyle = val; }
114 void setShapeRendering(EShapeRendering val) { svg_inherited_flags.shapeRende ring = val; } 115 void setShapeRendering(EShapeRendering val) { svg_inherited_flags.shapeRende ring = val; }
115 void setTextAnchor(ETextAnchor val) { svg_inherited_flags.textAnchor = val; } 116 void setTextAnchor(ETextAnchor val) { svg_inherited_flags.textAnchor = val; }
116 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; } 117 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; }
117 void setPaintOrder(EPaintOrder val) { svg_inherited_flags.paintOrder = (int) val; } 118 void setPaintOrder(EPaintOrder val) { svg_inherited_flags.paintOrder = (int) val; }
119 void setD(const SVGPathByteStream* d)
120 {
121 if (d) {
122 if (!layout->d || !(*layout->d == *d))
123 layout.access()->d = d->copy();
124 } else if (layout->d) {
125 layout.access()->d->clear();
126 }
127 }
118 void setCx(const Length& obj) 128 void setCx(const Length& obj)
119 { 129 {
120 if (!(layout->cx == obj)) 130 if (!(layout->cx == obj))
121 layout.access()->cx = obj; 131 layout.access()->cx = obj;
122 } 132 }
123 void setCy(const Length& obj) 133 void setCy(const Length& obj)
124 { 134 {
125 if (!(layout->cy == obj)) 135 if (!(layout->cy == obj))
126 layout.access()->cy = obj; 136 layout.access()->cy = obj;
127 } 137 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); } 336 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); }
327 float strokeMiterLimit() const { return stroke->miterLimit; } 337 float strokeMiterLimit() const { return stroke->miterLimit; }
328 const UnzoomedLength& strokeWidth() const { return stroke->width; } 338 const UnzoomedLength& strokeWidth() const { return stroke->width; }
329 const Length& strokeDashOffset() const { return stroke->dashOffset; } 339 const Length& strokeDashOffset() const { return stroke->dashOffset; }
330 float stopOpacity() const { return stops->opacity; } 340 float stopOpacity() const { return stops->opacity; }
331 const Color& stopColor() const { return stops->color; } 341 const Color& stopColor() const { return stops->color; }
332 float floodOpacity() const { return misc->floodOpacity; } 342 float floodOpacity() const { return misc->floodOpacity; }
333 const Color& floodColor() const { return misc->floodColor; } 343 const Color& floodColor() const { return misc->floodColor; }
334 const Color& lightingColor() const { return misc->lightingColor; } 344 const Color& lightingColor() const { return misc->lightingColor; }
335 const Length& baselineShiftValue() const { return misc->baselineShiftValue; } 345 const Length& baselineShiftValue() const { return misc->baselineShiftValue; }
346 const SVGPathByteStream* d() const { return layout->d.get(); }
336 const Length& cx() const { return layout->cx; } 347 const Length& cx() const { return layout->cx; }
337 const Length& cy() const { return layout->cy; } 348 const Length& cy() const { return layout->cy; }
338 const Length& x() const { return layout->x; } 349 const Length& x() const { return layout->x; }
339 const Length& y() const { return layout->y; } 350 const Length& y() const { return layout->y; }
340 const Length& r() const { return layout->r; } 351 const Length& r() const { return layout->r; }
341 const Length& rx() const { return layout->rx; } 352 const Length& rx() const { return layout->rx; }
342 const Length& ry() const { return layout->ry; } 353 const Length& ry() const { return layout->ry; }
343 const AtomicString& clipperResource() const { return resources->clipper; } 354 const AtomicString& clipperResource() const { return resources->clipper; }
344 const AtomicString& filterResource() const { return resources->filter; } 355 const AtomicString& filterResource() const { return resources->filter; }
345 const AtomicString& maskerResource() const { return resources->masker; } 356 const AtomicString& maskerResource() const { return resources->masker; }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 svg_noninherited_flags.f.baselineShift = initialBaselineShift(); 474 svg_noninherited_flags.f.baselineShift = initialBaselineShift();
464 svg_noninherited_flags.f.vectorEffect = initialVectorEffect(); 475 svg_noninherited_flags.f.vectorEffect = initialVectorEffect();
465 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); 476 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering();
466 svg_noninherited_flags.f.maskType = initialMaskType(); 477 svg_noninherited_flags.f.maskType = initialMaskType();
467 } 478 }
468 }; 479 };
469 480
470 } // namespace blink 481 } // namespace blink
471 482
472 #endif // SVGComputedStyle_h 483 #endif // SVGComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698