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

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

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 years, 9 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 bool operator==(const SVGComputedStyle&) const; 58 bool operator==(const SVGComputedStyle&) const;
59 bool operator!=(const SVGComputedStyle& o) const { return !(*this == o); } 59 bool operator!=(const SVGComputedStyle& o) const { return !(*this == o); }
60 60
61 // Initial values for all the properties 61 // Initial values for all the properties
62 static EAlignmentBaseline initialAlignmentBaseline() { return AB_AUTO; } 62 static EAlignmentBaseline initialAlignmentBaseline() { return AB_AUTO; }
63 static EDominantBaseline initialDominantBaseline() { return DB_AUTO; } 63 static EDominantBaseline initialDominantBaseline() { return DB_AUTO; }
64 static EBaselineShift initialBaselineShift() { return BS_LENGTH; } 64 static EBaselineShift initialBaselineShift() { return BS_LENGTH; }
65 static Length initialBaselineShiftValue() { return Length(Fixed); } 65 static Length initialBaselineShiftValue() { return Length(Fixed); }
66 static EVectorEffect initialVectorEffect() { return VE_NONE; } 66 static EVectorEffect initialVectorEffect() { return VE_NONE; }
67 static EBufferedRendering initialBufferedRendering() { return BR_AUTO; } 67 static EBufferedRendering initialBufferedRendering() { return BR_AUTO; }
68 static LineCap initialCapStyle() { return ButtCap; }
69 static WindRule initialClipRule() { return RULE_NONZERO; } 68 static WindRule initialClipRule() { return RULE_NONZERO; }
70 static EColorInterpolation initialColorInterpolation() { return CI_SRGB; } 69 static EColorInterpolation initialColorInterpolation() { return CI_SRGB; }
71 static EColorInterpolation initialColorInterpolationFilters() { 70 static EColorInterpolation initialColorInterpolationFilters() {
72 return CI_LINEARRGB; 71 return CI_LINEARRGB;
73 } 72 }
74 static EColorRendering initialColorRendering() { return CR_AUTO; } 73 static EColorRendering initialColorRendering() { return CR_AUTO; }
75 static WindRule initialFillRule() { return RULE_NONZERO; } 74 static WindRule initialFillRule() { return RULE_NONZERO; }
76 static LineJoin initialJoinStyle() { return MiterJoin; }
77 static EShapeRendering initialShapeRendering() { return SR_AUTO; } 75 static EShapeRendering initialShapeRendering() { return SR_AUTO; }
78 static ETextAnchor initialTextAnchor() { return TA_START; } 76 static ETextAnchor initialTextAnchor() { return TA_START; }
79 static float initialFillOpacity() { return 1; } 77 static float initialFillOpacity() { return 1; }
80 static SVGPaintType initialFillPaintType() { return SVG_PAINTTYPE_RGBCOLOR; } 78 static SVGPaintType initialFillPaintType() { return SVG_PAINTTYPE_RGBCOLOR; }
81 static Color initialFillPaintColor() { return Color::black; } 79 static Color initialFillPaintColor() { return Color::black; }
82 static String initialFillPaintUri() { return String(); } 80 static String initialFillPaintUri() { return String(); }
83 static float initialStrokeOpacity() { return 1; } 81 static float initialStrokeOpacity() { return 1; }
84 static SVGPaintType initialStrokePaintType() { return SVG_PAINTTYPE_NONE; } 82 static SVGPaintType initialStrokePaintType() { return SVG_PAINTTYPE_NONE; }
85 static Color initialStrokePaintColor() { return Color(); } 83 static Color initialStrokePaintColor() { return Color(); }
86 static String initialStrokePaintUri() { return String(); } 84 static String initialStrokePaintUri() { return String(); }
87 static PassRefPtr<SVGDashArray> initialStrokeDashArray(); 85 static PassRefPtr<SVGDashArray> initialStrokeDashArray();
88 static Length initialStrokeDashOffset() { return Length(Fixed); } 86 static Length initialStrokeDashOffset() { return Length(Fixed); }
89 static float initialStrokeMiterLimit() { return 4; } 87 static float initialStrokeMiterLimit() { return 4; }
90 static UnzoomedLength initialStrokeWidth() {
91 return UnzoomedLength(Length(1, Fixed));
92 }
93 static float initialStopOpacity() { return 1; } 88 static float initialStopOpacity() { return 1; }
94 static Color initialStopColor() { return Color(0, 0, 0); } 89 static Color initialStopColor() { return Color(0, 0, 0); }
95 static float initialFloodOpacity() { return 1; } 90 static float initialFloodOpacity() { return 1; }
96 static Color initialFloodColor() { return Color(0, 0, 0); } 91 static Color initialFloodColor() { return Color(0, 0, 0); }
97 static Color initialLightingColor() { return Color(255, 255, 255); } 92 static Color initialLightingColor() { return Color(255, 255, 255); }
98 static const AtomicString& initialMaskerResource() { return nullAtom; } 93 static const AtomicString& initialMaskerResource() { return nullAtom; }
99 static const AtomicString& initialMarkerStartResource() { return nullAtom; } 94 static const AtomicString& initialMarkerStartResource() { return nullAtom; }
100 static const AtomicString& initialMarkerMidResource() { return nullAtom; } 95 static const AtomicString& initialMarkerMidResource() { return nullAtom; }
101 static const AtomicString& initialMarkerEndResource() { return nullAtom; } 96 static const AtomicString& initialMarkerEndResource() { return nullAtom; }
102 static EMaskType initialMaskType() { return MT_LUMINANCE; } 97 static EMaskType initialMaskType() { return MT_LUMINANCE; }
103 static EPaintOrder initialPaintOrder() { return PaintOrderNormal; }
104 static StylePath* initialD() { return nullptr; } 98 static StylePath* initialD() { return nullptr; }
105 static Length initialCx() { return Length(Fixed); } 99 static Length initialCx() { return Length(Fixed); }
106 static Length initialCy() { return Length(Fixed); } 100 static Length initialCy() { return Length(Fixed); }
107 static Length initialX() { return Length(Fixed); } 101 static Length initialX() { return Length(Fixed); }
108 static Length initialY() { return Length(Fixed); } 102 static Length initialY() { return Length(Fixed); }
109 static Length initialR() { return Length(Fixed); } 103 static Length initialR() { return Length(Fixed); }
110 static Length initialRx() { return Length(Auto); } 104 static Length initialRx() { return Length(Auto); }
111 static Length initialRy() { return Length(Auto); } 105 static Length initialRy() { return Length(Auto); }
112 106
113 // SVG CSS Property setters 107 // SVG CSS Property setters
114 void setAlignmentBaseline(EAlignmentBaseline val) { 108 void setAlignmentBaseline(EAlignmentBaseline val) {
115 svg_noninherited_flags.f.alignmentBaseline = val; 109 svg_noninherited_flags.f.alignmentBaseline = val;
116 } 110 }
117 void setDominantBaseline(EDominantBaseline val) { 111 void setDominantBaseline(EDominantBaseline val) {
118 svg_inherited_flags.dominantBaseline = val; 112 svg_inherited_flags.dominantBaseline = val;
119 } 113 }
120 void setBaselineShift(EBaselineShift val) { 114 void setBaselineShift(EBaselineShift val) {
121 svg_noninherited_flags.f.baselineShift = val; 115 svg_noninherited_flags.f.baselineShift = val;
122 } 116 }
123 void setVectorEffect(EVectorEffect val) { 117 void setVectorEffect(EVectorEffect val) {
124 svg_noninherited_flags.f.vectorEffect = val; 118 svg_noninherited_flags.f.vectorEffect = val;
125 } 119 }
126 void setBufferedRendering(EBufferedRendering val) { 120 void setBufferedRendering(EBufferedRendering val) {
127 svg_noninherited_flags.f.bufferedRendering = val; 121 svg_noninherited_flags.f.bufferedRendering = val;
128 } 122 }
129 void setCapStyle(LineCap val) { svg_inherited_flags.capStyle = val; }
130 void setClipRule(WindRule val) { svg_inherited_flags.clipRule = val; } 123 void setClipRule(WindRule val) { svg_inherited_flags.clipRule = val; }
131 void setColorInterpolation(EColorInterpolation val) { 124 void setColorInterpolation(EColorInterpolation val) {
132 svg_inherited_flags.colorInterpolation = val; 125 svg_inherited_flags.colorInterpolation = val;
133 } 126 }
134 void setColorInterpolationFilters(EColorInterpolation val) { 127 void setColorInterpolationFilters(EColorInterpolation val) {
135 svg_inherited_flags.colorInterpolationFilters = val; 128 svg_inherited_flags.colorInterpolationFilters = val;
136 } 129 }
137 void setColorRendering(EColorRendering val) { 130 void setColorRendering(EColorRendering val) {
138 svg_inherited_flags.colorRendering = val; 131 svg_inherited_flags.colorRendering = val;
139 } 132 }
140 void setFillRule(WindRule val) { svg_inherited_flags.fillRule = val; } 133 void setFillRule(WindRule val) { svg_inherited_flags.fillRule = val; }
141 void setJoinStyle(LineJoin val) { svg_inherited_flags.joinStyle = val; }
142 void setShapeRendering(EShapeRendering val) { 134 void setShapeRendering(EShapeRendering val) {
143 svg_inherited_flags.shapeRendering = val; 135 svg_inherited_flags.shapeRendering = val;
144 } 136 }
145 void setTextAnchor(ETextAnchor val) { svg_inherited_flags.textAnchor = val; } 137 void setTextAnchor(ETextAnchor val) { svg_inherited_flags.textAnchor = val; }
146 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; } 138 void setMaskType(EMaskType val) { svg_noninherited_flags.f.maskType = val; }
147 void setPaintOrder(EPaintOrder val) {
148 svg_inherited_flags.paintOrder = (int)val;
149 }
150 void setD(PassRefPtr<StylePath> d) { 139 void setD(PassRefPtr<StylePath> d) {
151 if (!(geometry->d == d)) 140 if (!(geometry->d == d))
152 geometry.access()->d = d; 141 geometry.access()->d = d;
153 } 142 }
154 void setCx(const Length& obj) { 143 void setCx(const Length& obj) {
155 if (!(geometry->cx == obj)) 144 if (!(geometry->cx == obj))
156 geometry.access()->cx = obj; 145 geometry.access()->cx = obj;
157 } 146 }
158 void setCy(const Length& obj) { 147 void setCy(const Length& obj) {
159 if (!(geometry->cy == obj)) 148 if (!(geometry->cy == obj))
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 void setStrokeDashArray(PassRefPtr<SVGDashArray> dashArray) { 227 void setStrokeDashArray(PassRefPtr<SVGDashArray> dashArray) {
239 if (*stroke->dashArray != *dashArray) 228 if (*stroke->dashArray != *dashArray)
240 stroke.access()->dashArray = dashArray; 229 stroke.access()->dashArray = dashArray;
241 } 230 }
242 231
243 void setStrokeMiterLimit(float obj) { 232 void setStrokeMiterLimit(float obj) {
244 if (!(stroke->miterLimit == obj)) 233 if (!(stroke->miterLimit == obj))
245 stroke.access()->miterLimit = obj; 234 stroke.access()->miterLimit = obj;
246 } 235 }
247 236
248 void setStrokeWidth(const UnzoomedLength& strokeWidth) {
249 if (!(stroke->width == strokeWidth))
250 stroke.access()->width = strokeWidth;
251 }
252
253 void setStrokeDashOffset(const Length& dashOffset) { 237 void setStrokeDashOffset(const Length& dashOffset) {
254 if (!(stroke->dashOffset == dashOffset)) 238 if (!(stroke->dashOffset == dashOffset))
255 stroke.access()->dashOffset = dashOffset; 239 stroke.access()->dashOffset = dashOffset;
256 } 240 }
257 241
258 void setStopOpacity(float obj) { 242 void setStopOpacity(float obj) {
259 if (!(stops->opacity == obj)) 243 if (!(stops->opacity == obj))
260 stops.access()->opacity = obj; 244 stops.access()->opacity = obj;
261 } 245 }
262 246
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 } 300 }
317 EBaselineShift baselineShift() const { 301 EBaselineShift baselineShift() const {
318 return (EBaselineShift)svg_noninherited_flags.f.baselineShift; 302 return (EBaselineShift)svg_noninherited_flags.f.baselineShift;
319 } 303 }
320 EVectorEffect vectorEffect() const { 304 EVectorEffect vectorEffect() const {
321 return (EVectorEffect)svg_noninherited_flags.f.vectorEffect; 305 return (EVectorEffect)svg_noninherited_flags.f.vectorEffect;
322 } 306 }
323 EBufferedRendering bufferedRendering() const { 307 EBufferedRendering bufferedRendering() const {
324 return (EBufferedRendering)svg_noninherited_flags.f.bufferedRendering; 308 return (EBufferedRendering)svg_noninherited_flags.f.bufferedRendering;
325 } 309 }
326 LineCap capStyle() const { return (LineCap)svg_inherited_flags.capStyle; }
327 WindRule clipRule() const { return (WindRule)svg_inherited_flags.clipRule; } 310 WindRule clipRule() const { return (WindRule)svg_inherited_flags.clipRule; }
328 EColorInterpolation colorInterpolation() const { 311 EColorInterpolation colorInterpolation() const {
329 return (EColorInterpolation)svg_inherited_flags.colorInterpolation; 312 return (EColorInterpolation)svg_inherited_flags.colorInterpolation;
330 } 313 }
331 EColorInterpolation colorInterpolationFilters() const { 314 EColorInterpolation colorInterpolationFilters() const {
332 return (EColorInterpolation)svg_inherited_flags.colorInterpolationFilters; 315 return (EColorInterpolation)svg_inherited_flags.colorInterpolationFilters;
333 } 316 }
334 EColorRendering colorRendering() const { 317 EColorRendering colorRendering() const {
335 return (EColorRendering)svg_inherited_flags.colorRendering; 318 return (EColorRendering)svg_inherited_flags.colorRendering;
336 } 319 }
337 WindRule fillRule() const { return (WindRule)svg_inherited_flags.fillRule; } 320 WindRule fillRule() const { return (WindRule)svg_inherited_flags.fillRule; }
338 LineJoin joinStyle() const { return (LineJoin)svg_inherited_flags.joinStyle; }
339 EShapeRendering shapeRendering() const { 321 EShapeRendering shapeRendering() const {
340 return (EShapeRendering)svg_inherited_flags.shapeRendering; 322 return (EShapeRendering)svg_inherited_flags.shapeRendering;
341 } 323 }
342 ETextAnchor textAnchor() const { 324 ETextAnchor textAnchor() const {
343 return (ETextAnchor)svg_inherited_flags.textAnchor; 325 return (ETextAnchor)svg_inherited_flags.textAnchor;
344 } 326 }
345 float fillOpacity() const { return fill->opacity; } 327 float fillOpacity() const { return fill->opacity; }
346 const SVGPaintType& fillPaintType() const { return fill->paintType; } 328 const SVGPaintType& fillPaintType() const { return fill->paintType; }
347 const Color& fillPaintColor() const { return fill->paintColor; } 329 const Color& fillPaintColor() const { return fill->paintColor; }
348 const String& fillPaintUri() const { return fill->paintUri; } 330 const String& fillPaintUri() const { return fill->paintUri; }
349 float strokeOpacity() const { return stroke->opacity; } 331 float strokeOpacity() const { return stroke->opacity; }
350 const SVGPaintType& strokePaintType() const { return stroke->paintType; } 332 const SVGPaintType& strokePaintType() const { return stroke->paintType; }
351 const Color& strokePaintColor() const { return stroke->paintColor; } 333 const Color& strokePaintColor() const { return stroke->paintColor; }
352 const String& strokePaintUri() const { return stroke->paintUri; } 334 const String& strokePaintUri() const { return stroke->paintUri; }
353 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); } 335 SVGDashArray* strokeDashArray() const { return stroke->dashArray.get(); }
354 float strokeMiterLimit() const { return stroke->miterLimit; } 336 float strokeMiterLimit() const { return stroke->miterLimit; }
355 const UnzoomedLength& strokeWidth() const { return stroke->width; }
356 const Length& strokeDashOffset() const { return stroke->dashOffset; } 337 const Length& strokeDashOffset() const { return stroke->dashOffset; }
357 float stopOpacity() const { return stops->opacity; } 338 float stopOpacity() const { return stops->opacity; }
358 const Color& stopColor() const { return stops->color; } 339 const Color& stopColor() const { return stops->color; }
359 float floodOpacity() const { return misc->floodOpacity; } 340 float floodOpacity() const { return misc->floodOpacity; }
360 const Color& floodColor() const { return misc->floodColor; } 341 const Color& floodColor() const { return misc->floodColor; }
361 const Color& lightingColor() const { return misc->lightingColor; } 342 const Color& lightingColor() const { return misc->lightingColor; }
362 const Length& baselineShiftValue() const { return misc->baselineShiftValue; } 343 const Length& baselineShiftValue() const { return misc->baselineShiftValue; }
363 StylePath* d() const { return geometry->d.get(); } 344 StylePath* d() const { return geometry->d.get(); }
364 const Length& cx() const { return geometry->cx; } 345 const Length& cx() const { return geometry->cx; }
365 const Length& cy() const { return geometry->cy; } 346 const Length& cy() const { return geometry->cy; }
366 const Length& x() const { return geometry->x; } 347 const Length& x() const { return geometry->x; }
367 const Length& y() const { return geometry->y; } 348 const Length& y() const { return geometry->y; }
368 const Length& r() const { return geometry->r; } 349 const Length& r() const { return geometry->r; }
369 const Length& rx() const { return geometry->rx; } 350 const Length& rx() const { return geometry->rx; }
370 const Length& ry() const { return geometry->ry; } 351 const Length& ry() const { return geometry->ry; }
371 const AtomicString& maskerResource() const { return resources->masker; } 352 const AtomicString& maskerResource() const { return resources->masker; }
372 const AtomicString& markerStartResource() const { 353 const AtomicString& markerStartResource() const {
373 return inheritedResources->markerStart; 354 return inheritedResources->markerStart;
374 } 355 }
375 const AtomicString& markerMidResource() const { 356 const AtomicString& markerMidResource() const {
376 return inheritedResources->markerMid; 357 return inheritedResources->markerMid;
377 } 358 }
378 const AtomicString& markerEndResource() const { 359 const AtomicString& markerEndResource() const {
379 return inheritedResources->markerEnd; 360 return inheritedResources->markerEnd;
380 } 361 }
381 EMaskType maskType() const { 362 EMaskType maskType() const {
382 return (EMaskType)svg_noninherited_flags.f.maskType; 363 return (EMaskType)svg_noninherited_flags.f.maskType;
383 } 364 }
384 EPaintOrder paintOrder() const {
385 return (EPaintOrder)svg_inherited_flags.paintOrder;
386 }
387 EPaintOrderType paintOrderType(unsigned index) const;
388
389 const SVGPaintType& visitedLinkFillPaintType() const { 365 const SVGPaintType& visitedLinkFillPaintType() const {
390 return fill->visitedLinkPaintType; 366 return fill->visitedLinkPaintType;
391 } 367 }
392 const Color& visitedLinkFillPaintColor() const { 368 const Color& visitedLinkFillPaintColor() const {
393 return fill->visitedLinkPaintColor; 369 return fill->visitedLinkPaintColor;
394 } 370 }
395 const String& visitedLinkFillPaintUri() const { 371 const String& visitedLinkFillPaintUri() const {
396 return fill->visitedLinkPaintUri; 372 return fill->visitedLinkPaintUri;
397 } 373 }
398 const SVGPaintType& visitedLinkStrokePaintType() const { 374 const SVGPaintType& visitedLinkStrokePaintType() const {
(...skipping 20 matching lines...) Expand all
419 visitedLinkStrokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR; 395 visitedLinkStrokePaintType() == SVG_PAINTTYPE_URI_CURRENTCOLOR;
420 } 396 }
421 397
422 // convenience 398 // convenience
423 bool hasMasker() const { return !maskerResource().isEmpty(); } 399 bool hasMasker() const { return !maskerResource().isEmpty(); }
424 bool hasMarkers() const { 400 bool hasMarkers() const {
425 return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() || 401 return !markerStartResource().isEmpty() || !markerMidResource().isEmpty() ||
426 !markerEndResource().isEmpty(); 402 !markerEndResource().isEmpty();
427 } 403 }
428 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; } 404 bool hasStroke() const { return strokePaintType() != SVG_PAINTTYPE_NONE; }
429 bool hasVisibleStroke() const {
430 return hasStroke() && !strokeWidth().isZero();
431 }
432 bool hasSquareCapStyle() const { return capStyle() == SquareCap; }
433 bool hasMiterJoinStyle() const { return joinStyle() == MiterJoin; }
434 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; } 405 bool hasFill() const { return fillPaintType() != SVG_PAINTTYPE_NONE; }
435 406
436 protected: 407 protected:
437 // inherit 408 // inherit
438 struct InheritedFlags { 409 struct InheritedFlags {
439 bool operator==(const InheritedFlags& other) const { 410 bool operator==(const InheritedFlags& other) const {
440 return (colorRendering == other.colorRendering) && 411 return (colorRendering == other.colorRendering) &&
441 (shapeRendering == other.shapeRendering) && 412 (shapeRendering == other.shapeRendering) &&
442 (clipRule == other.clipRule) && (fillRule == other.fillRule) && 413 (clipRule == other.clipRule) && (fillRule == other.fillRule) &&
443 (capStyle == other.capStyle) && (joinStyle == other.joinStyle) &&
444 (textAnchor == other.textAnchor) && 414 (textAnchor == other.textAnchor) &&
445 (colorInterpolation == other.colorInterpolation) && 415 (colorInterpolation == other.colorInterpolation) &&
446 (colorInterpolationFilters == other.colorInterpolationFilters) && 416 (colorInterpolationFilters == other.colorInterpolationFilters) &&
447 (paintOrder == other.paintOrder) &&
448 (dominantBaseline == other.dominantBaseline); 417 (dominantBaseline == other.dominantBaseline);
449 } 418 }
450 419
451 bool operator!=(const InheritedFlags& other) const { 420 bool operator!=(const InheritedFlags& other) const {
452 return !(*this == other); 421 return !(*this == other);
453 } 422 }
454 423
455 unsigned colorRendering : 2; // EColorRendering 424 unsigned colorRendering : 2; // EColorRendering
456 unsigned shapeRendering : 2; // EShapeRendering 425 unsigned shapeRendering : 2; // EShapeRendering
457 unsigned clipRule : 1; // WindRule 426 unsigned clipRule : 1; // WindRule
458 unsigned fillRule : 1; // WindRule 427 unsigned fillRule : 1; // WindRule
459 unsigned capStyle : 2; // LineCap
460 unsigned joinStyle : 2; // LineJoin
461 unsigned textAnchor : 2; // ETextAnchor 428 unsigned textAnchor : 2; // ETextAnchor
462 unsigned colorInterpolation : 2; // EColorInterpolation 429 unsigned colorInterpolation : 2; // EColorInterpolation
463 unsigned colorInterpolationFilters : 2; // EColorInterpolation_ 430 unsigned colorInterpolationFilters : 2; // EColorInterpolation_
464 unsigned paintOrder : 3; // EPaintOrder
465 unsigned dominantBaseline : 4; // EDominantBaseline 431 unsigned dominantBaseline : 4; // EDominantBaseline
466 } svg_inherited_flags; 432 } svg_inherited_flags;
467 433
468 // don't inherit 434 // don't inherit
469 struct NonInheritedFlags { 435 struct NonInheritedFlags {
470 // 32 bit non-inherited, don't add to the struct, or the operator will 436 // 32 bit non-inherited, don't add to the struct, or the operator will
471 // break. 437 // break.
472 bool operator==(const NonInheritedFlags& other) const { 438 bool operator==(const NonInheritedFlags& other) const {
473 return niflags == other.niflags; 439 return niflags == other.niflags;
474 } 440 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 476
511 bool diffNeedsLayoutAndPaintInvalidation(const SVGComputedStyle* other) const; 477 bool diffNeedsLayoutAndPaintInvalidation(const SVGComputedStyle* other) const;
512 bool diffNeedsPaintInvalidation(const SVGComputedStyle* other) const; 478 bool diffNeedsPaintInvalidation(const SVGComputedStyle* other) const;
513 479
514 void setBitDefaults() { 480 void setBitDefaults() {
515 svg_inherited_flags.clipRule = initialClipRule(); 481 svg_inherited_flags.clipRule = initialClipRule();
516 svg_inherited_flags.colorRendering = initialColorRendering(); 482 svg_inherited_flags.colorRendering = initialColorRendering();
517 svg_inherited_flags.fillRule = initialFillRule(); 483 svg_inherited_flags.fillRule = initialFillRule();
518 svg_inherited_flags.shapeRendering = initialShapeRendering(); 484 svg_inherited_flags.shapeRendering = initialShapeRendering();
519 svg_inherited_flags.textAnchor = initialTextAnchor(); 485 svg_inherited_flags.textAnchor = initialTextAnchor();
520 svg_inherited_flags.capStyle = initialCapStyle();
521 svg_inherited_flags.joinStyle = initialJoinStyle();
522 svg_inherited_flags.colorInterpolation = initialColorInterpolation(); 486 svg_inherited_flags.colorInterpolation = initialColorInterpolation();
523 svg_inherited_flags.colorInterpolationFilters = 487 svg_inherited_flags.colorInterpolationFilters =
524 initialColorInterpolationFilters(); 488 initialColorInterpolationFilters();
525 svg_inherited_flags.paintOrder = initialPaintOrder();
526 svg_inherited_flags.dominantBaseline = initialDominantBaseline(); 489 svg_inherited_flags.dominantBaseline = initialDominantBaseline();
527 490
528 svg_noninherited_flags.niflags = 0; 491 svg_noninherited_flags.niflags = 0;
529 svg_noninherited_flags.f.alignmentBaseline = initialAlignmentBaseline(); 492 svg_noninherited_flags.f.alignmentBaseline = initialAlignmentBaseline();
530 svg_noninherited_flags.f.baselineShift = initialBaselineShift(); 493 svg_noninherited_flags.f.baselineShift = initialBaselineShift();
531 svg_noninherited_flags.f.vectorEffect = initialVectorEffect(); 494 svg_noninherited_flags.f.vectorEffect = initialVectorEffect();
532 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering(); 495 svg_noninherited_flags.f.bufferedRendering = initialBufferedRendering();
533 svg_noninherited_flags.f.maskType = initialMaskType(); 496 svg_noninherited_flags.f.maskType = initialMaskType();
534 } 497 }
535 }; 498 };
536 499
537 } // namespace blink 500 } // namespace blink
538 501
539 #endif // SVGComputedStyle_h 502 #endif // SVGComputedStyle_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyleTest.cpp ('k') | third_party/WebKit/Source/core/style/SVGComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698