Changeset 84877 in webkit
- Timestamp:
- Apr 25, 2011 10:05:05 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84871 r84877 1 2011-04-25 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Fix OwnPtr strict errors in RenderStyle and make StyleRareInheritedData::textShadow an OwnPtr 6 https://bugs.webkit.org/show_bug.cgi?id=59377 7 8 * css/CSSStyleSelector.cpp: 9 (WebCore::CSSStyleSelector::applyProperty): 10 * page/animation/AnimationBase.cpp: 11 (WebCore::PropertyWrapperShadow::PropertyWrapperShadow): 12 (WebCore::PropertyWrapperShadow::blend): 13 * rendering/style/RenderStyle.cpp: 14 (WebCore::RenderStyle::setTextShadow): 15 (WebCore::RenderStyle::setBoxShadow): 16 * rendering/style/RenderStyle.h: 17 (WebCore::InheritedFlags::textShadow): 18 * rendering/style/StyleRareInheritedData.cpp: 19 (WebCore::StyleRareInheritedData::StyleRareInheritedData): 20 (WebCore::StyleRareInheritedData::~StyleRareInheritedData): 21 * rendering/style/StyleRareInheritedData.h: 22 * rendering/style/StyleRareNonInheritedData.cpp: 23 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 24 1 25 2011-04-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 26 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r84729 r84877 5146 5146 if (id == CSSPropertyTextShadow) 5147 5147 return m_style->setTextShadow(m_parentStyle->textShadow() ? new ShadowData(*m_parentStyle->textShadow()) : 0); 5148 return m_style->setBoxShadow(m_parentStyle->boxShadow() ? new ShadowData(*m_parentStyle->boxShadow()) : 0);5148 return m_style->setBoxShadow(m_parentStyle->boxShadow() ? adoptPtr(new ShadowData(*m_parentStyle->boxShadow())) : PassOwnPtr<ShadowData>()); 5149 5149 } 5150 5150 if (isInitial || primitiveValue) // initial | none -
trunk/Source/WebCore/page/animation/AnimationBase.cpp
r84538 r84877 330 330 class PropertyWrapperShadow : public PropertyWrapperBase { 331 331 public: 332 PropertyWrapperShadow(int prop, const ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)( ShadowData*, bool))332 PropertyWrapperShadow(int prop, const ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassOwnPtr<ShadowData>, bool)) 333 333 : PropertyWrapperBase(prop) 334 334 , m_getter(getter) … … 366 366 ShadowData defaultInsetShadowData(0, 0, 0, 0, Inset, property() == CSSPropertyWebkitBoxShadow, Color::transparent); 367 367 368 ShadowData* newShadowData = 0;368 OwnPtr<ShadowData> newShadowData; 369 369 ShadowData* lastShadow = 0; 370 370 … … 375 375 ShadowData* blendedShadow = blendFunc(anim, srcShadow, dstShadow, progress); 376 376 if (!lastShadow) 377 newShadowData = blendedShadow;377 newShadowData = adoptPtr(blendedShadow); 378 378 else 379 379 lastShadow->setNext(blendedShadow); … … 385 385 } 386 386 387 (dst->*m_setter)(newShadowData , false);387 (dst->*m_setter)(newShadowData.release(), false); 388 388 } 389 389 390 390 private: 391 391 const ShadowData* (RenderStyle::*m_getter)() const; 392 void (RenderStyle::*m_setter)( ShadowData*, bool);392 void (RenderStyle::*m_setter)(PassOwnPtr<ShadowData>, bool); 393 393 }; 394 394 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r84815 r84877 729 729 } 730 730 731 void RenderStyle::setTextShadow( ShadowData* val, bool add)732 { 733 ASSERT(! val || (!val->spread() && val->style() == Normal));731 void RenderStyle::setTextShadow(PassOwnPtr<ShadowData> shadowData, bool add) 732 { 733 ASSERT(!shadowData || (!shadowData->spread() && shadowData->style() == Normal)); 734 734 735 735 StyleRareInheritedData* rareData = rareInheritedData.access(); 736 736 if (!add) { 737 delete rareData->textShadow; 738 rareData->textShadow = val; 737 rareData->textShadow = shadowData; 739 738 return; 740 739 } 741 740 742 val->setNext(rareData->textShadow); 743 rareData->textShadow = val; 744 } 745 746 void RenderStyle::setBoxShadow(ShadowData* shadowData, bool add) 741 rareData->textShadow = shadowData; 742 } 743 744 void RenderStyle::setBoxShadow(PassOwnPtr<ShadowData> shadowData, bool add) 747 745 { 748 746 StyleRareNonInheritedData* rareData = rareNonInheritedData.access(); 749 747 if (!add) { 750 rareData->m_boxShadow .set(shadowData);748 rareData->m_boxShadow = shadowData; 751 749 return; 752 750 } 753 751 754 752 shadowData->setNext(rareData->m_boxShadow.leakPtr()); 755 rareData->m_boxShadow .set(shadowData);753 rareData->m_boxShadow = shadowData; 756 754 } 757 755 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r84380 r84877 651 651 } 652 652 653 const ShadowData* textShadow() const { return rareInheritedData->textShadow ; }653 const ShadowData* textShadow() const { return rareInheritedData->textShadow.get(); } 654 654 void getTextShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(textShadow(), top, right, bottom, left); } 655 655 void getTextShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(textShadow(), left, right); } … … 1020 1020 // CSS3 Setters 1021 1021 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v) } 1022 void setTextShadow( ShadowData* val, bool add=false);1022 void setTextShadow(PassOwnPtr<ShadowData>, bool add = false); 1023 1023 void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) } 1024 1024 void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) } … … 1035 1035 void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->flexibleBox, orient, o); } 1036 1036 void setBoxPack(EBoxAlignment p) { SET_VAR(rareNonInheritedData.access()->flexibleBox, pack, p); } 1037 void setBoxShadow( ShadowData* val, bool add=false);1037 void setBoxShadow(PassOwnPtr<ShadowData>, bool add = false); 1038 1038 void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; } 1039 1039 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); } -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
r81684 r84877 33 33 StyleRareInheritedData::StyleRareInheritedData() 34 34 : textStrokeWidth(RenderStyle::initialTextStrokeWidth()) 35 , textShadow(0)36 35 , indent(RenderStyle::initialTextIndent()) 37 36 , m_effectiveZoom(RenderStyle::initialZoom()) … … 65 64 , textFillColor(o.textFillColor) 66 65 , textEmphasisColor(o.textEmphasisColor) 67 , textShadow(o.textShadow ? new ShadowData(*o.textShadow) : 0)66 , textShadow(o.textShadow ? adoptPtr(new ShadowData(*o.textShadow)) : 0) 68 67 , highlight(o.highlight) 69 68 , cursorData(o.cursorData) … … 98 97 StyleRareInheritedData::~StyleRareInheritedData() 99 98 { 100 delete textShadow;101 99 } 102 100 -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h
r81684 r84877 59 59 Color textEmphasisColor; 60 60 61 ShadowData*textShadow; // Our text shadow information for shadowed text drawing.61 OwnPtr<ShadowData> textShadow; // Our text shadow information for shadowed text drawing. 62 62 AtomicString highlight; // Apple-specific extension for custom highlight rendering. 63 63 -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r81049 r84877 35 35 : lineClamp(RenderStyle::initialLineClamp()) 36 36 , opacity(RenderStyle::initialOpacity()) 37 , m_content(0)38 , m_counterDirectives(0)39 37 , userDrag(RenderStyle::initialUserDrag()) 40 38 , textOverflow(RenderStyle::initialTextOverflow()) … … 50 48 , m_runningAcceleratedAnimation(false) 51 49 #endif 52 , m_boxShadow(0)53 , m_animations(0)54 , m_transitions(0)55 50 , m_mask(FillLayer(MaskFillLayer)) 56 51 , m_transformStyle3D(RenderStyle::initialTransformStyle3D()) … … 72 67 , m_multiCol(o.m_multiCol) 73 68 , m_transform(o.m_transform) 74 , m_content(0)75 , m_counterDirectives(0)76 69 , userDrag(o.userDrag) 77 70 , textOverflow(o.textOverflow) … … 87 80 , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation) 88 81 #endif 89 , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0)82 , m_boxShadow(o.m_boxShadow ? adoptPtr(new ShadowData(*o.m_boxShadow)) : PassOwnPtr<ShadowData>()) 90 83 , m_boxReflect(o.m_boxReflect) 91 , m_animations(o.m_animations ? new AnimationList(*o.m_animations) : 0)92 , m_transitions(o.m_transitions ? new AnimationList(*o.m_transitions) : 0)84 , m_animations(o.m_animations ? adoptPtr(new AnimationList(*o.m_animations)) : PassOwnPtr<AnimationList>()) 85 , m_transitions(o.m_transitions ? adoptPtr(new AnimationList(*o.m_transitions)) : PassOwnPtr<AnimationList>()) 93 86 , m_mask(o.m_mask) 94 87 , m_maskBoxImage(o.m_maskBoxImage)
Note: See TracChangeset
for help on using the changeset viewer.