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

Side by Side Diff: Source/core/css/CSSValue.cpp

Issue 189913012: Merge SVGColor into SVGPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix system color test Created 6 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
« no previous file with comments | « Source/core/css/CSSValue.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "core/css/CSSInitialValue.h" 48 #include "core/css/CSSInitialValue.h"
49 #include "core/css/CSSLineBoxContainValue.h" 49 #include "core/css/CSSLineBoxContainValue.h"
50 #include "core/css/CSSPrimitiveValue.h" 50 #include "core/css/CSSPrimitiveValue.h"
51 #include "core/css/CSSReflectValue.h" 51 #include "core/css/CSSReflectValue.h"
52 #include "core/css/CSSSVGDocumentValue.h" 52 #include "core/css/CSSSVGDocumentValue.h"
53 #include "core/css/CSSShadowValue.h" 53 #include "core/css/CSSShadowValue.h"
54 #include "core/css/CSSTimingFunctionValue.h" 54 #include "core/css/CSSTimingFunctionValue.h"
55 #include "core/css/CSSTransformValue.h" 55 #include "core/css/CSSTransformValue.h"
56 #include "core/css/CSSUnicodeRangeValue.h" 56 #include "core/css/CSSUnicodeRangeValue.h"
57 #include "core/css/CSSValueList.h" 57 #include "core/css/CSSValueList.h"
58 #include "core/svg/SVGColor.h"
59 #include "core/svg/SVGPaint.h" 58 #include "core/svg/SVGPaint.h"
60 59
61 namespace WebCore { 60 namespace WebCore {
62 61
63 struct SameSizeAsCSSValue : public RefCountedWillBeRefCountedGarbageCollected<Sa meSizeAsCSSValue> { 62 struct SameSizeAsCSSValue : public RefCountedWillBeRefCountedGarbageCollected<Sa meSizeAsCSSValue> {
64 uint32_t bitfields; 63 uint32_t bitfields;
65 }; 64 };
66 65
67 COMPILE_ASSERT(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), CSS_value_should_ stay_small); 66 COMPILE_ASSERT(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), CSS_value_should_ stay_small);
68 67
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 case LineBoxContainClass: 192 case LineBoxContainClass:
194 return compareCSSValues<CSSLineBoxContainValue>(*this, other); 193 return compareCSSValues<CSSLineBoxContainValue>(*this, other);
195 case CalculationClass: 194 case CalculationClass:
196 return compareCSSValues<CSSCalcValue>(*this, other); 195 return compareCSSValues<CSSCalcValue>(*this, other);
197 case ImageSetClass: 196 case ImageSetClass:
198 return compareCSSValues<CSSImageSetValue>(*this, other); 197 return compareCSSValues<CSSImageSetValue>(*this, other);
199 case CSSFilterClass: 198 case CSSFilterClass:
200 return compareCSSValues<CSSFilterValue>(*this, other); 199 return compareCSSValues<CSSFilterValue>(*this, other);
201 case CSSArrayFunctionValueClass: 200 case CSSArrayFunctionValueClass:
202 return compareCSSValues<CSSArrayFunctionValue>(*this, other); 201 return compareCSSValues<CSSArrayFunctionValue>(*this, other);
203 case SVGColorClass:
204 return compareCSSValues<SVGColor>(*this, other);
205 case SVGPaintClass: 202 case SVGPaintClass:
206 return compareCSSValues<SVGPaint>(*this, other); 203 return compareCSSValues<SVGPaint>(*this, other);
207 case CSSSVGDocumentClass: 204 case CSSSVGDocumentClass:
208 return compareCSSValues<CSSSVGDocumentValue>(*this, other); 205 return compareCSSValues<CSSSVGDocumentValue>(*this, other);
209 default: 206 default:
210 ASSERT_NOT_REACHED(); 207 ASSERT_NOT_REACHED();
211 return false; 208 return false;
212 } 209 }
213 } else if (m_classType == ValueListClass && other.m_classType != ValueListCl ass) 210 } else if (m_classType == ValueListClass && other.m_classType != ValueListCl ass)
214 return toCSSValueList(this)->equals(other); 211 return toCSSValueList(this)->equals(other);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 case LineBoxContainClass: 274 case LineBoxContainClass:
278 return toCSSLineBoxContainValue(this)->customCSSText(); 275 return toCSSLineBoxContainValue(this)->customCSSText();
279 case CalculationClass: 276 case CalculationClass:
280 return toCSSCalcValue(this)->customCSSText(); 277 return toCSSCalcValue(this)->customCSSText();
281 case ImageSetClass: 278 case ImageSetClass:
282 return toCSSImageSetValue(this)->customCSSText(); 279 return toCSSImageSetValue(this)->customCSSText();
283 case CSSFilterClass: 280 case CSSFilterClass:
284 return toCSSFilterValue(this)->customCSSText(); 281 return toCSSFilterValue(this)->customCSSText();
285 case CSSArrayFunctionValueClass: 282 case CSSArrayFunctionValueClass:
286 return toCSSArrayFunctionValue(this)->customCSSText(); 283 return toCSSArrayFunctionValue(this)->customCSSText();
287 case SVGColorClass:
288 return toSVGColor(this)->customCSSText();
289 case SVGPaintClass: 284 case SVGPaintClass:
290 return toSVGPaint(this)->customCSSText(); 285 return toSVGPaint(this)->customCSSText();
291 case CSSSVGDocumentClass: 286 case CSSSVGDocumentClass:
292 return toCSSSVGDocumentValue(this)->customCSSText(); 287 return toCSSSVGDocumentValue(this)->customCSSText();
293 } 288 }
294 ASSERT_NOT_REACHED(); 289 ASSERT_NOT_REACHED();
295 return String(); 290 return String();
296 } 291 }
297 292
298 void CSSValue::destroy() 293 void CSSValue::destroy()
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 return; 380 return;
386 case ImageSetClass: 381 case ImageSetClass:
387 delete toCSSImageSetValue(this); 382 delete toCSSImageSetValue(this);
388 return; 383 return;
389 case CSSFilterClass: 384 case CSSFilterClass:
390 delete toCSSFilterValue(this); 385 delete toCSSFilterValue(this);
391 return; 386 return;
392 case CSSArrayFunctionValueClass: 387 case CSSArrayFunctionValueClass:
393 delete toCSSArrayFunctionValue(this); 388 delete toCSSArrayFunctionValue(this);
394 return; 389 return;
395 case SVGColorClass:
396 delete toSVGColor(this);
397 return;
398 case SVGPaintClass: 390 case SVGPaintClass:
399 delete toSVGPaint(this); 391 delete toSVGPaint(this);
400 return; 392 return;
401 case CSSSVGDocumentClass: 393 case CSSSVGDocumentClass:
402 delete toCSSSVGDocumentValue(this); 394 delete toCSSSVGDocumentValue(this);
403 return; 395 return;
404 } 396 }
405 ASSERT_NOT_REACHED(); 397 ASSERT_NOT_REACHED();
406 } 398 }
407 399
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 return; 487 return;
496 case ImageSetClass: 488 case ImageSetClass:
497 static_cast<CSSImageSetValue*>(this)->~CSSImageSetValue(); 489 static_cast<CSSImageSetValue*>(this)->~CSSImageSetValue();
498 return; 490 return;
499 case CSSFilterClass: 491 case CSSFilterClass:
500 static_cast<CSSFilterValue*>(this)->~CSSFilterValue(); 492 static_cast<CSSFilterValue*>(this)->~CSSFilterValue();
501 return; 493 return;
502 case CSSArrayFunctionValueClass: 494 case CSSArrayFunctionValueClass:
503 static_cast<CSSArrayFunctionValue*>(this)->~CSSArrayFunctionValue(); 495 static_cast<CSSArrayFunctionValue*>(this)->~CSSArrayFunctionValue();
504 return; 496 return;
505 case SVGColorClass:
506 static_cast<SVGColor*>(this)->~SVGColor();
507 return;
508 case SVGPaintClass: 497 case SVGPaintClass:
509 static_cast<SVGPaint*>(this)->~SVGPaint(); 498 static_cast<SVGPaint*>(this)->~SVGPaint();
510 return; 499 return;
511 case CSSSVGDocumentClass: 500 case CSSSVGDocumentClass:
512 static_cast<CSSSVGDocumentValue*>(this)->~CSSSVGDocumentValue(); 501 static_cast<CSSSVGDocumentValue*>(this)->~CSSSVGDocumentValue();
513 return; 502 return;
514 } 503 }
515 ASSERT_NOT_REACHED(); 504 ASSERT_NOT_REACHED();
516 } 505 }
517 506
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 return; 594 return;
606 case ImageSetClass: 595 case ImageSetClass:
607 static_cast<CSSImageSetValue*>(this)->traceAfterDispatch(visitor); 596 static_cast<CSSImageSetValue*>(this)->traceAfterDispatch(visitor);
608 return; 597 return;
609 case CSSFilterClass: 598 case CSSFilterClass:
610 static_cast<CSSFilterValue*>(this)->traceAfterDispatch(visitor); 599 static_cast<CSSFilterValue*>(this)->traceAfterDispatch(visitor);
611 return; 600 return;
612 case CSSArrayFunctionValueClass: 601 case CSSArrayFunctionValueClass:
613 static_cast<CSSArrayFunctionValue*>(this)->traceAfterDispatch(visitor); 602 static_cast<CSSArrayFunctionValue*>(this)->traceAfterDispatch(visitor);
614 return; 603 return;
615 case SVGColorClass:
616 static_cast<SVGColor*>(this)->traceAfterDispatch(visitor);
617 return;
618 case SVGPaintClass: 604 case SVGPaintClass:
619 static_cast<SVGPaint*>(this)->traceAfterDispatch(visitor); 605 static_cast<SVGPaint*>(this)->traceAfterDispatch(visitor);
620 return; 606 return;
621 case CSSSVGDocumentClass: 607 case CSSSVGDocumentClass:
622 static_cast<CSSSVGDocumentValue*>(this)->traceAfterDispatch(visitor); 608 static_cast<CSSSVGDocumentValue*>(this)->traceAfterDispatch(visitor);
623 return; 609 return;
624 } 610 }
625 ASSERT_NOT_REACHED(); 611 ASSERT_NOT_REACHED();
626 } 612 }
627 613
628 PassRefPtrWillBeRawPtr<CSSValue> CSSValue::cloneForCSSOM() const 614 PassRefPtrWillBeRawPtr<CSSValue> CSSValue::cloneForCSSOM() const
629 { 615 {
630 switch (classType()) { 616 switch (classType()) {
631 case PrimitiveClass: 617 case PrimitiveClass:
632 return toCSSPrimitiveValue(this)->cloneForCSSOM(); 618 return toCSSPrimitiveValue(this)->cloneForCSSOM();
633 case ValueListClass: 619 case ValueListClass:
634 return toCSSValueList(this)->cloneForCSSOM(); 620 return toCSSValueList(this)->cloneForCSSOM();
635 case ImageClass: 621 case ImageClass:
636 case CursorImageClass: 622 case CursorImageClass:
637 return toCSSImageValue(this)->cloneForCSSOM(); 623 return toCSSImageValue(this)->cloneForCSSOM();
638 case CSSFilterClass: 624 case CSSFilterClass:
639 return toCSSFilterValue(this)->cloneForCSSOM(); 625 return toCSSFilterValue(this)->cloneForCSSOM();
640 case CSSArrayFunctionValueClass: 626 case CSSArrayFunctionValueClass:
641 return toCSSArrayFunctionValue(this)->cloneForCSSOM(); 627 return toCSSArrayFunctionValue(this)->cloneForCSSOM();
642 case CSSTransformClass: 628 case CSSTransformClass:
643 return toCSSTransformValue(this)->cloneForCSSOM(); 629 return toCSSTransformValue(this)->cloneForCSSOM();
644 case ImageSetClass: 630 case ImageSetClass:
645 return toCSSImageSetValue(this)->cloneForCSSOM(); 631 return toCSSImageSetValue(this)->cloneForCSSOM();
646 case SVGColorClass:
647 return toSVGColor(this)->cloneForCSSOM();
648 case SVGPaintClass: 632 case SVGPaintClass:
649 return toSVGPaint(this)->cloneForCSSOM(); 633 return toSVGPaint(this)->cloneForCSSOM();
650 default: 634 default:
651 ASSERT(!isSubtypeExposedToCSSOM()); 635 ASSERT(!isSubtypeExposedToCSSOM());
652 return TextCloneCSSValue::create(classType(), cssText()); 636 return TextCloneCSSValue::create(classType(), cssText());
653 } 637 }
654 } 638 }
655 639
656 } 640 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSValue.h ('k') | Source/core/css/parser/CSSPropertyParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698