Changeset 191017 in webkit
- Timestamp:
- Oct 13, 2015, 5:14:29 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WTF/ChangeLog ¶
r190882 r191017 1 2015-10-13 Simon Fraser <simon.fraser@apple.com> 2 3 Add helper funtion for checking pointer equivalency and use it 4 https://bugs.webkit.org/show_bug.cgi?id=150022 5 6 Reviewed by Darin Adler. 7 8 Add PointerComparison.h which contains the templated pointer comparison 9 function. 10 11 * WTF.xcodeproj/project.pbxproj: 12 * wtf/PointerComparison.h: Added. 13 (WTF::arePointingToEqualData): 14 1 15 2015-10-12 Andreas Kling <akling@apple.com> 2 16 -
TabularUnified trunk/Source/WTF/WTF.xcodeproj/project.pbxproj ¶
r190310 r191017 52 52 0FEB3DD11BB7366B009D7AAD /* ParallelVectorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEB3DD01BB7366B009D7AAD /* ParallelVectorIterator.h */; }; 53 53 0FED67B61B22D4D80066CE15 /* TinyPtrSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FED67B51B22D4D80066CE15 /* TinyPtrSet.h */; }; 54 0FF860951BCCBD740045127F /* PointerComparison.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF860941BCCBD740045127F /* PointerComparison.h */; }; 54 55 0FFF19DC1BB334EB00886D91 /* ParallelHelperPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FFF19DA1BB334EB00886D91 /* ParallelHelperPool.cpp */; }; 55 56 0FFF19DD1BB334EB00886D91 /* ParallelHelperPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FFF19DB1BB334EB00886D91 /* ParallelHelperPool.h */; }; … … 345 346 0FEB3DD01BB7366B009D7AAD /* ParallelVectorIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelVectorIterator.h; sourceTree = "<group>"; }; 346 347 0FED67B51B22D4D80066CE15 /* TinyPtrSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyPtrSet.h; sourceTree = "<group>"; }; 348 0FF860941BCCBD740045127F /* PointerComparison.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PointerComparison.h; sourceTree = "<group>"; }; 347 349 0FFF19DA1BB334EB00886D91 /* ParallelHelperPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParallelHelperPool.cpp; sourceTree = "<group>"; }; 348 350 0FFF19DB1BB334EB00886D91 /* ParallelHelperPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelHelperPool.h; sourceTree = "<group>"; }; … … 838 840 A8A472ED151A825B004123FF /* PassRefPtr.h */, 839 841 A876DBD7151816E500DADB95 /* Platform.h */, 842 0FF860941BCCBD740045127F /* PointerComparison.h */, 840 843 0F9D335D165DBA73005AD387 /* PrintStream.cpp */, 841 844 0F9D335E165DBA73005AD387 /* PrintStream.h */, … … 1209 1212 A8A47422151A825B004123FF /* SHA1.h in Headers */, 1210 1213 A8A47423151A825B004123FF /* SimpleStats.h in Headers */, 1214 0FF860951BCCBD740045127F /* PointerComparison.h in Headers */, 1211 1215 A8A47424151A825B004123FF /* SinglyLinkedList.h in Headers */, 1212 1216 A748745317A0BDAE00FA04CB /* SixCharacterHash.h in Headers */, -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r191014 r191017 1 2015-10-13 Simon Fraser <simon.fraser@apple.com> 2 3 Add helper funtion for checking pointer equivalency and use it 4 https://bugs.webkit.org/show_bug.cgi?id=150022 5 6 Reviewed by Darin Adler. 7 8 A common pattern in WebCore code is to check for equivalency of two pointers, 9 either both null, or both non-null and with equal values. This was written in 10 several different ways in different places. 11 12 Add arePointingToEqualData() to standardize this pattern. 13 14 This obviates the need for StyleImage::imagesEquivalent(), counterDataEquivalent() 15 etc. 16 17 Also change some comparisons of DataRef<> which checked the pointer and then the 18 values to use DataRef<>::operator== which does the same thing. Comparisons of 19 m_grid and m_gridItem only checked pointer equality, so this is probably a bug fix there. 20 21 * page/animation/CSSPropertyAnimation.cpp: if ((!a && !b) || a == b) is redundant so fix, 22 and add checks for a and b RenderStyle* first. 23 (WebCore::PropertyWrapperGetter::equals): 24 (WebCore::StyleImagePropertyWrapper::equals): 25 (WebCore::PropertyWrapperShadow::equals): 26 (WebCore::PropertyWrapperMaybeInvalidColor::equals): 27 (WebCore::FillLayerPropertyWrapperGetter::equals): 28 (WebCore::FillLayerStyleImagePropertyWrapper::equals): 29 (WebCore::FillLayersPropertyWrapper::equals): 30 (WebCore::ShorthandPropertyWrapper::equals): 31 (WebCore::PropertyWrapperFlex::equals): 32 (WebCore::PropertyWrapperSVGPaint::equals): 33 * platform/network/ResourceRequestBase.cpp: 34 (WebCore::equalIgnoringHeaderFields): 35 * rendering/style/FillLayer.cpp: 36 (WebCore::FillLayer::operator==): 37 * rendering/style/NinePieceImage.cpp: 38 (WebCore::NinePieceImageData::operator==): 39 * rendering/style/RenderStyle.cpp: Some nullptr cleanup. 40 (WebCore::RenderStyle::getCachedPseudoStyle): 41 (WebCore::RenderStyle::addCachedPseudoStyle): 42 (WebCore::RenderStyle::changeAffectsVisualOverflow): 43 (WebCore::RenderStyle::changeRequiresLayout): 44 (WebCore::RenderStyle::changeRequiresLayerRepaint): 45 (WebCore::RenderStyle::setWillChange): 46 * rendering/style/SVGRenderStyleDefs.cpp: 47 (WebCore::StyleShadowSVGData::operator==): 48 * rendering/style/ShadowData.cpp: 49 (WebCore::ShadowData::operator==): 50 * rendering/style/StyleImage.h: 51 (WebCore::StyleImage::imagesEquivalent): Deleted. 52 * rendering/style/StyleRareInheritedData.cpp: 53 (WebCore::StyleRareInheritedData::operator==): 54 (WebCore::cursorDataEquivalent): Deleted. 55 (WebCore::quotesDataEquivalent): Deleted. 56 (WebCore::StyleRareInheritedData::shadowDataEquivalent): Deleted. 57 * rendering/style/StyleRareInheritedData.h: 58 * rendering/style/StyleRareNonInheritedData.cpp: 59 (WebCore::StyleRareNonInheritedData::operator==): 60 (WebCore::StyleRareNonInheritedData::counterDataEquivalent): Deleted. 61 (WebCore::StyleRareNonInheritedData::shadowDataEquivalent): Deleted. 62 (WebCore::StyleRareNonInheritedData::willChangeDataEquivalent): Deleted. 63 (WebCore::StyleRareNonInheritedData::reflectionDataEquivalent): Deleted. 64 (WebCore::StyleRareNonInheritedData::animationDataEquivalent): Deleted. 65 (WebCore::StyleRareNonInheritedData::transitionDataEquivalent): Deleted. 66 * rendering/style/StyleRareNonInheritedData.h: 67 1 68 2015-10-13 Myles C. Maxfield <mmaxfield@apple.com> 2 69 -
TabularUnified trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp ¶
r190879 r191017 55 55 #include <wtf/MathExtras.h> 56 56 #include <wtf/Noncopyable.h> 57 #include <wtf/PointerComparison.h> 57 58 #include <wtf/RefCounted.h> 58 59 … … 401 402 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 402 403 { 403 // If the style pointers are the same, don't bother doing the test. 404 // If either is null, return false. If both are null, return true. 405 if ((!a && !b) || a == b) 404 if (a == b) 406 405 return true; 407 406 if (!a || !b) … … 537 536 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 538 537 { 539 // If the style pointers are the same, don't bother doing the test.540 // If either is null, return false. If both are null, return true.541 538 if (a == b) 542 539 return true; … … 546 543 StyleImage* imageA = (a->*m_getter)(); 547 544 StyleImage* imageB = (b->*m_getter)(); 548 return StyleImage::imagesEquivalent(imageA, imageB);545 return arePointingToEqualData(imageA, imageB); 549 546 } 550 547 }; … … 675 672 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 676 673 { 674 if (a == b) 675 return true; 676 if (!a || !b) 677 return false; 678 677 679 const ShadowData* shadowA = (a->*m_getter)(); 678 680 const ShadowData* shadowB = (b->*m_getter)(); … … 791 793 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 792 794 { 795 if (a == b) 796 return true; 797 if (!a || !b) 798 return false; 799 793 800 Color fromColor = (a->*m_getter)(); 794 801 Color toColor = (b->*m_getter)(); … … 885 892 virtual bool equals(const FillLayer* a, const FillLayer* b) const 886 893 { 887 // If the style pointers are the same, don't bother doing the test. 888 // If either is null, return false. If both are null, return true. 889 if ((!a && !b) || a == b) 890 return true; 891 if (!a || !b) 894 if (a == b) 895 return true; 896 if (!a || !b) 892 897 return false; 893 898 return (a->*m_getter)() == (b->*m_getter)(); … … 946 951 virtual bool equals(const FillLayer* a, const FillLayer* b) const 947 952 { 948 // If the style pointers are the same, don't bother doing the test.949 // If either is null, return false. If both are null, return true.950 953 if (a == b) 951 954 return true; … … 955 958 StyleImage* imageA = (a->*m_getter)(); 956 959 StyleImage* imageB = (b->*m_getter)(); 957 return StyleImage::imagesEquivalent(imageA, imageB);960 return arePointingToEqualData(imageA, imageB); 958 961 } 959 962 }; … … 994 997 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 995 998 { 999 if (a == b) 1000 return true; 1001 if (!a || !b) 1002 return false; 1003 996 1004 const FillLayer* fromLayer = (a->*m_layersGetter)(); 997 1005 const FillLayer* toLayer = (b->*m_layersGetter)(); … … 1042 1050 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 1043 1051 { 1052 if (a == b) 1053 return true; 1054 if (!a || !b) 1055 return false; 1056 1044 1057 for (auto& wrapper : m_propertyWrappers) { 1045 1058 if (!wrapper->equals(a, b)) … … 1071 1084 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 1072 1085 { 1073 // If the style pointers are the same, don't bother doing the test. 1074 // If either is null, return false. If both are null, return true. 1075 if ((!a && !b) || a == b) 1086 if (a == b) 1076 1087 return true; 1077 1088 if (!a || !b) … … 1102 1113 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 1103 1114 { 1115 if (a == b) 1116 return true; 1117 if (!a || !b) 1118 return false; 1119 1104 1120 if ((a->*m_paintTypeGetter)() != (b->*m_paintTypeGetter)()) 1105 1121 return false; -
TabularUnified trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp ¶
r183901 r191017 29 29 #include "HTTPHeaderNames.h" 30 30 #include "ResourceRequest.h" 31 #include <wtf/PointerComparison.h> 31 32 32 33 namespace WebCore { … … 501 502 return false; 502 503 503 FormData* formDataA = a.httpBody(); 504 FormData* formDataB = b.httpBody(); 505 506 if (!formDataA) 507 return !formDataB; 508 if (!formDataB) 509 return !formDataA; 510 511 if (*formDataA != *formDataB) 512 return false; 513 514 return true; 504 return arePointingToEqualData(a.httpBody(), b.httpBody()); 515 505 } 516 506 -
TabularUnified trunk/Source/WebCore/rendering/style/FillLayer.cpp ¶
r186392 r191017 22 22 #include "config.h" 23 23 #include "FillLayer.h" 24 25 #include <wtf/PointerComparison.h> 24 26 25 27 namespace WebCore { … … 153 155 // We do not check the "isSet" booleans for each property, since those are only used during initial construction 154 156 // to propagate patterns into layers. All layer comparisons happen after values have all been filled in anyway. 155 return StyleImage::imagesEquivalent(m_image.get(), o.m_image.get()) && m_xPosition == o.m_xPosition && m_yPosition == o.m_yPosition157 return arePointingToEqualData(m_image.get(), o.m_image.get()) && m_xPosition == o.m_xPosition && m_yPosition == o.m_yPosition 156 158 && m_backgroundXOrigin == o.m_backgroundXOrigin && m_backgroundYOrigin == o.m_backgroundYOrigin 157 159 && m_attachment == o.m_attachment && m_clip == o.m_clip && m_composite == o.m_composite -
TabularUnified trunk/Source/WebCore/rendering/style/NinePieceImage.cpp ¶
r190883 r191017 29 29 #include "RenderStyle.h" 30 30 #include <wtf/NeverDestroyed.h> 31 #include <wtf/PointerComparison.h> 31 32 32 33 namespace WebCore { … … 253 254 bool NinePieceImageData::operator==(const NinePieceImageData& other) const 254 255 { 255 return StyleImage::imagesEquivalent(image.get(), other.image.get())256 return arePointingToEqualData(image, other.image) 256 257 && imageSlices == other.imageSlices 257 258 && fill == other.fill -
TabularUnified trunk/Source/WebCore/rendering/style/RenderStyle.cpp ¶
r190754 r191017 43 43 #include "WillChangeData.h" 44 44 #include <wtf/MathExtras.h> 45 #include <wtf/PointerComparison.h> 45 46 #include <wtf/StdLibExtras.h> 46 47 #include <algorithm> … … 311 312 { 312 313 if (!m_cachedPseudoStyles || !m_cachedPseudoStyles->size()) 313 return 0;314 return nullptr; 314 315 315 316 if (styleType() != NOPSEUDO) 316 return 0;317 return nullptr; 317 318 318 319 for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) { … … 322 323 } 323 324 324 return 0;325 return nullptr; 325 326 } 326 327 … … 328 329 { 329 330 if (!pseudo) 330 return 0;331 return nullptr; 331 332 332 333 ASSERT(pseudo->styleType() > NOPSEUDO); … … 460 461 { 461 462 if (rareNonInheritedData.get() != other.rareNonInheritedData.get() 462 && ! rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedData.get()))463 && !arePointingToEqualData(rareNonInheritedData->m_boxShadow, other.rareNonInheritedData->m_boxShadow)) 463 464 return true; 464 465 465 466 if (rareInheritedData.get() != other.rareInheritedData.get() 466 && ! rareInheritedData->shadowDataEquivalent(*other.rareInheritedData.get()))467 && !arePointingToEqualData(rareInheritedData->textShadow, other.rareInheritedData->textShadow)) 467 468 return true; 468 469 … … 524 525 #endif 525 526 526 if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other.rareNonInheritedData->m_deprecatedFlexibleBox.get() 527 && *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other.rareNonInheritedData->m_deprecatedFlexibleBox.get()) 528 return true; 529 530 if (rareNonInheritedData->m_flexibleBox.get() != other.rareNonInheritedData->m_flexibleBox.get() 531 && *rareNonInheritedData->m_flexibleBox.get() != *other.rareNonInheritedData->m_flexibleBox.get()) 532 return true; 527 if (rareNonInheritedData->m_deprecatedFlexibleBox != other.rareNonInheritedData->m_deprecatedFlexibleBox) 528 return true; 529 530 if (rareNonInheritedData->m_flexibleBox != other.rareNonInheritedData->m_flexibleBox) 531 return true; 532 533 533 if (rareNonInheritedData->m_order != other.rareNonInheritedData->m_order 534 534 || rareNonInheritedData->m_alignContent != other.rareNonInheritedData->m_alignContent … … 540 540 return true; 541 541 542 if (!rareNonInheritedData->reflectionDataEquivalent(*other.rareNonInheritedData.get())) 543 return true; 544 545 if (rareNonInheritedData->m_multiCol.get() != other.rareNonInheritedData->m_multiCol.get() 546 && *rareNonInheritedData->m_multiCol.get() != *other.rareNonInheritedData->m_multiCol.get()) 542 if (!arePointingToEqualData(rareNonInheritedData->m_boxReflect, other.rareNonInheritedData->m_boxReflect)) 543 return true; 544 545 if (rareNonInheritedData->m_multiCol != other.rareNonInheritedData->m_multiCol) 547 546 return true; 548 547 … … 557 556 558 557 #if ENABLE(CSS_GRID_LAYOUT) 559 if (rareNonInheritedData->m_grid .get() != other.rareNonInheritedData->m_grid.get()560 || rareNonInheritedData->m_gridItem .get() != other.rareNonInheritedData->m_gridItem.get())558 if (rareNonInheritedData->m_grid != other.rareNonInheritedData->m_grid 559 || rareNonInheritedData->m_gridItem != other.rareNonInheritedData->m_gridItem) 561 560 return true; 562 561 #endif … … 568 567 #endif 569 568 570 if (! rareNonInheritedData->willChangeDataEquivalent(*other.rareNonInheritedData.get())) {569 if (!arePointingToEqualData(rareNonInheritedData->m_willChange, other.rareNonInheritedData->m_willChange)) { 571 570 changedContextSensitiveProperties |= ContextSensitivePropertyWillChange; 572 571 // Don't return; keep looking for another change … … 617 616 || rareInheritedData->useTouchOverflowScrolling != other.rareInheritedData->useTouchOverflowScrolling 618 617 #endif 619 || rareInheritedData->listStyleImage != other.rareInheritedData->listStyleImage) 618 || rareInheritedData->listStyleImage != other.rareInheritedData->listStyleImage) // FIXME: needs arePointingToEqualData()? 620 619 return true; 621 620 … … 701 700 702 701 // If the counter directives change, trigger a relayout to re-calculate counter values and rebuild the counter node tree. 703 const CounterDirectiveMap* mapA = rareNonInheritedData->m_counterDirectives.get(); 704 const CounterDirectiveMap* mapB = other.rareNonInheritedData->m_counterDirectives.get(); 705 if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) 702 if (!arePointingToEqualData(rareNonInheritedData->m_counterDirectives, other.rareNonInheritedData->m_counterDirectives)) 706 703 return true; 707 704 … … 726 723 #endif 727 724 728 const QuotesData* quotesDataA = rareInheritedData->quotes.get(); 729 const QuotesData* quotesDataB = other.rareInheritedData->quotes.get(); 730 if (!(quotesDataA == quotesDataB || (quotesDataA && quotesDataB && *quotesDataA == *quotesDataB))) 725 if (!arePointingToEqualData(rareInheritedData->quotes, other.rareInheritedData->quotes)) 731 726 return true; 732 727 … … 785 780 } 786 781 787 if (rareNonInheritedData->m_filter.get() != other.rareNonInheritedData->m_filter.get() 788 && *rareNonInheritedData->m_filter.get() != *other.rareNonInheritedData->m_filter.get()) { 782 if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filter) { 789 783 changedContextSensitiveProperties |= ContextSensitivePropertyFilter; 790 784 // Don't return; keep looking for another change. … … 947 941 void RenderStyle::setWillChange(PassRefPtr<WillChangeData> willChangeData) 948 942 { 949 if (rareNonInheritedData->m_willChange == willChangeData 950 || (rareNonInheritedData->m_willChange && willChangeData && *rareNonInheritedData->m_willChange == *willChangeData)) 943 if (arePointingToEqualData(rareNonInheritedData->m_willChange.get(), willChangeData.get())) 951 944 return; 952 945 -
TabularUnified trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp ¶
r188647 r191017 32 32 #include "RenderStyle.h" 33 33 #include "SVGRenderStyle.h" 34 #include <wtf/PointerComparison.h> 34 35 35 36 namespace WebCore { … … 217 218 bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const 218 219 { 219 if ((!shadow && other.shadow) || (shadow && !other.shadow)) 220 return false; 221 if (shadow && other.shadow && (*shadow != *other.shadow)) 222 return false; 223 return true; 220 return arePointingToEqualData(shadow, other.shadow); 224 221 } 225 222 -
TabularUnified trunk/Source/WebCore/rendering/style/ShadowData.cpp ¶
r163751 r191017 24 24 25 25 #include "LayoutRect.h" 26 #include <wtf/PointerComparison.h> 26 27 27 28 namespace WebCore { … … 40 41 bool ShadowData::operator==(const ShadowData& o) const 41 42 { 42 if ((m_next && !o.m_next) || (!m_next && o.m_next) 43 || (m_next && o.m_next && *m_next != *o.m_next)) 43 if (!arePointingToEqualData(m_next, o.m_next)) 44 44 return false; 45 45 -
TabularUnified trunk/Source/WebCore/rendering/style/StyleImage.h ¶
r174836 r191017 75 75 ALWAYS_INLINE bool isCachedImageSet() const { return m_isCachedImageSet; } 76 76 77 static bool imagesEquivalent(StyleImage* image1, StyleImage* image2)78 {79 return image1 == image2 || (image1 && image2 && *image1 == *image2);80 }81 82 77 protected: 83 78 StyleImage() -
TabularUnified trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp ¶
r190754 r191017 31 31 #include "StyleCustomPropertyData.h" 32 32 #include "StyleImage.h" 33 #include <wtf/PointerComparison.h> 33 34 34 35 namespace WebCore { … … 236 237 } 237 238 238 static bool cursorDataEquivalent(const CursorList* c1, const CursorList* c2)239 {240 if (c1 == c2)241 return true;242 if ((!c1 && c2) || (c1 && !c2))243 return false;244 return (*c1 == *c2);245 }246 247 static bool quotesDataEquivalent(const QuotesData* q1, const QuotesData* q2)248 {249 if (q1 == q2)250 return true;251 if ((!q1 && q2) || (q1 && !q2))252 return false;253 return (*q1 == *q2);254 }255 256 239 bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const 257 240 { … … 266 249 && tapHighlightColor == o.tapHighlightColor 267 250 #endif 268 && shadowDataEquivalent(o)269 && cursorDataEquivalent(cursorData.get(), o.cursorData.get())251 && arePointingToEqualData(textShadow, o.textShadow) 252 && arePointingToEqualData(cursorData, o.cursorData) 270 253 && indent == o.indent 271 254 && m_effectiveZoom == o.m_effectiveZoom … … 308 291 && locale == o.locale 309 292 && textEmphasisCustomMark == o.textEmphasisCustomMark 310 && quotesDataEquivalent(quotes.get(), o.quotes.get())293 && arePointingToEqualData(quotes, o.quotes) 311 294 && m_tabSize == o.m_tabSize 312 295 && m_lineGrid == o.m_lineGrid … … 334 317 #endif 335 318 && m_customProperties == o.m_customProperties 336 && StyleImage::imagesEquivalent(listStyleImage.get(), o.listStyleImage.get()); 337 } 338 339 bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const 340 { 341 if ((!textShadow && o.textShadow) || (textShadow && !o.textShadow)) 342 return false; 343 if (textShadow && o.textShadow && (*textShadow != *o.textShadow)) 344 return false; 345 return true; 319 && arePointingToEqualData(listStyleImage, o.listStyleImage); 346 320 } 347 321 -
TabularUnified trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h ¶
r190754 r191017 59 59 return !(*this == o); 60 60 } 61 bool shadowDataEquivalent(const StyleRareInheritedData&) const;62 61 63 62 RefPtr<StyleImage> listStyleImage; -
TabularUnified trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp ¶
r190879 r191017 32 32 #include "StyleResolver.h" 33 33 #include "StyleScrollSnapPoints.h" 34 #include <wtf/PointerComparison.h> 35 #include <wtf/RefPtr.h> 34 36 35 37 namespace WebCore { … … 234 236 #endif 235 237 && contentDataEquivalent(o) 236 && counterDataEquivalent(o)237 && shadowDataEquivalent(o)238 && willChangeDataEquivalent(o)239 && reflectionDataEquivalent(o)240 && a nimationDataEquivalent(o)241 && transitionDataEquivalent(o)238 && arePointingToEqualData(m_counterDirectives, o.m_counterDirectives) 239 && arePointingToEqualData(m_boxShadow, o.m_boxShadow) 240 && arePointingToEqualData(m_willChange, o.m_willChange) 241 && arePointingToEqualData(m_boxReflect, o.m_boxReflect) 242 && arePointingToEqualData(m_animations, o.m_animations) 243 && arePointingToEqualData(m_transitions, o.m_transitions) 242 244 && m_mask == o.m_mask 243 245 && m_maskBoxImage == o.m_maskBoxImage 244 246 && m_pageSize == o.m_pageSize 245 247 #if ENABLE(CSS_SHAPES) 246 && shapeOutsideDataEquivalent(o)248 && arePointingToEqualData(m_shapeOutside, o.m_shapeOutside) 247 249 && m_shapeMargin == o.m_shapeMargin 248 250 && m_shapeImageThreshold == o.m_shapeImageThreshold 249 251 #endif 250 && clipPathOperationsEquivalent(o)252 && arePointingToEqualData(m_clipPath, o.m_clipPath) 251 253 && m_textDecorationColor == o.m_textDecorationColor 252 254 && m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColor … … 306 308 } 307 309 308 bool StyleRareNonInheritedData::counterDataEquivalent(const StyleRareNonInheritedData& o) const309 {310 if (m_counterDirectives.get() == o.m_counterDirectives.get())311 return true;312 313 if (m_counterDirectives && o.m_counterDirectives && *m_counterDirectives == *o.m_counterDirectives)314 return true;315 316 return false;317 }318 319 bool StyleRareNonInheritedData::shadowDataEquivalent(const StyleRareNonInheritedData& o) const320 {321 if ((!m_boxShadow && o.m_boxShadow) || (m_boxShadow && !o.m_boxShadow))322 return false;323 if (m_boxShadow && o.m_boxShadow && (*m_boxShadow != *o.m_boxShadow))324 return false;325 return true;326 }327 328 bool StyleRareNonInheritedData::willChangeDataEquivalent(const StyleRareNonInheritedData& o) const329 {330 if (m_willChange != o.m_willChange) {331 if (!m_willChange || !o.m_willChange)332 return false;333 return *m_willChange == *o.m_willChange;334 }335 return true;336 }337 338 bool StyleRareNonInheritedData::reflectionDataEquivalent(const StyleRareNonInheritedData& o) const339 {340 if (m_boxReflect != o.m_boxReflect) {341 if (!m_boxReflect || !o.m_boxReflect)342 return false;343 return *m_boxReflect == *o.m_boxReflect;344 }345 return true;346 }347 348 bool StyleRareNonInheritedData::animationDataEquivalent(const StyleRareNonInheritedData& o) const349 {350 if ((!m_animations && o.m_animations) || (m_animations && !o.m_animations))351 return false;352 if (m_animations && o.m_animations && (*m_animations != *o.m_animations))353 return false;354 return true;355 }356 357 bool StyleRareNonInheritedData::transitionDataEquivalent(const StyleRareNonInheritedData& o) const358 {359 if ((!m_transitions && o.m_transitions) || (m_transitions && !o.m_transitions))360 return false;361 if (m_transitions && o.m_transitions && (*m_transitions != *o.m_transitions))362 return false;363 return true;364 }365 366 bool StyleRareNonInheritedData::clipPathOperationsEquivalent(const StyleRareNonInheritedData& o) const367 {368 if ((!m_clipPath && o.m_clipPath) || (m_clipPath && !o.m_clipPath))369 return false;370 if (m_clipPath && o.m_clipPath && (*m_clipPath != *o.m_clipPath))371 return false;372 return true;373 }374 375 #if ENABLE(CSS_SHAPES)376 bool StyleRareNonInheritedData::shapeOutsideDataEquivalent(const StyleRareNonInheritedData& o) const377 {378 if ((!m_shapeOutside && o.m_shapeOutside) || (m_shapeOutside && !o.m_shapeOutside))379 return false;380 if (m_shapeOutside && o.m_shapeOutside && (*m_shapeOutside != *o.m_shapeOutside))381 return false;382 return true;383 }384 #endif385 386 310 bool StyleRareNonInheritedData::hasFilters() const 387 311 { -
TabularUnified trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h ¶
r190879 r191017 93 93 94 94 bool contentDataEquivalent(const StyleRareNonInheritedData&) const; 95 bool counterDataEquivalent(const StyleRareNonInheritedData&) const; 96 bool shadowDataEquivalent(const StyleRareNonInheritedData&) const; 97 bool willChangeDataEquivalent(const StyleRareNonInheritedData&) const; 98 bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const; 99 bool animationDataEquivalent(const StyleRareNonInheritedData&) const; 100 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const; 101 bool clipPathOperationsEquivalent(const StyleRareNonInheritedData&) const; 102 #if ENABLE(CSS_SHAPES) 103 bool shapeOutsideDataEquivalent(const StyleRareNonInheritedData&) const; 104 #endif 95 105 96 bool hasFilters() const; 106 97 #if ENABLE(FILTERS_LEVEL_2)
Note:
See TracChangeset
for help on using the changeset viewer.