Changeset 57526 in webkit
- Timestamp:
- Apr 13, 2010 11:10:40 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57522 r57526 1 2010-04-13 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=37510, clean up StyleBackgroundData 6 7 * rendering/style/RenderStyle.cpp: 8 (WebCore::RenderStyle::RenderStyle): 9 (WebCore::RenderStyle::operator==): 10 (WebCore::RenderStyle::diff): 11 * rendering/style/RenderStyle.h: 12 (WebCore::): 13 (WebCore::InheritedFlags::hasBackground): 14 (WebCore::InheritedFlags::hasBackgroundImage): 15 (WebCore::InheritedFlags::hasFixedBackgroundImage): 16 (WebCore::InheritedFlags::outlineWidth): 17 (WebCore::InheritedFlags::outlineStyle): 18 (WebCore::InheritedFlags::outlineStyleIsAuto): 19 (WebCore::InheritedFlags::outlineColor): 20 (WebCore::InheritedFlags::backgroundColor): 21 (WebCore::InheritedFlags::backgroundImage): 22 (WebCore::InheritedFlags::backgroundRepeatX): 23 (WebCore::InheritedFlags::backgroundRepeatY): 24 (WebCore::InheritedFlags::backgroundComposite): 25 (WebCore::InheritedFlags::backgroundAttachment): 26 (WebCore::InheritedFlags::backgroundClip): 27 (WebCore::InheritedFlags::backgroundOrigin): 28 (WebCore::InheritedFlags::backgroundXPosition): 29 (WebCore::InheritedFlags::backgroundYPosition): 30 (WebCore::InheritedFlags::backgroundSizeType): 31 (WebCore::InheritedFlags::backgroundSizeLength): 32 (WebCore::InheritedFlags::accessBackgroundLayers): 33 (WebCore::InheritedFlags::backgroundLayers): 34 (WebCore::InheritedFlags::outlineOffset): 35 (WebCore::InheritedFlags::resetOutline): 36 (WebCore::InheritedFlags::setBackgroundColor): 37 (WebCore::InheritedFlags::setBackgroundXPosition): 38 (WebCore::InheritedFlags::setBackgroundYPosition): 39 (WebCore::InheritedFlags::setBackgroundSize): 40 (WebCore::InheritedFlags::setBackgroundSizeLength): 41 (WebCore::InheritedFlags::setOutlineWidth): 42 (WebCore::InheritedFlags::setOutlineStyle): 43 (WebCore::InheritedFlags::setOutlineColor): 44 (WebCore::InheritedFlags::clearBackgroundLayers): 45 (WebCore::InheritedFlags::inheritBackgroundLayers): 46 (WebCore::InheritedFlags::setOutlineOffset): 47 * rendering/style/StyleBackgroundData.h: 48 (WebCore::StyleBackgroundData::background): 49 (WebCore::StyleBackgroundData::color): 50 (WebCore::StyleBackgroundData::outline): 51 1 52 2010-04-13 Stephan Aßmus <superstippi@gmx.de> 2 53 -
trunk/WebCore/rendering/style/RenderStyle.cpp
r57484 r57526 74 74 , box(defaultStyle()->box) 75 75 , visual(defaultStyle()->visual) 76 , background(defaultStyle()->background)76 , m_background(defaultStyle()->m_background) 77 77 , surround(defaultStyle()->surround) 78 78 , rareNonInheritedData(defaultStyle()->rareNonInheritedData) … … 104 104 box.init(); 105 105 visual.init(); 106 background.init();106 m_background.init(); 107 107 surround.init(); 108 108 rareNonInheritedData.init(); … … 135 135 , box(o.box) 136 136 , visual(o.visual) 137 , background(o.background)137 , m_background(o.m_background) 138 138 , surround(o.surround) 139 139 , rareNonInheritedData(o.rareNonInheritedData) … … 170 170 box == o.box && 171 171 visual == o.visual && 172 background == o.background &&172 m_background == o.m_background && 173 173 surround == o.surround && 174 174 rareNonInheritedData == o.rareNonInheritedData && … … 503 503 inherited_flags._insideLink != other->inherited_flags._insideLink || 504 504 surround->border != other->surround->border || 505 * background.get() != *other->background.get() ||505 *m_background.get() != *other->m_background.get() || 506 506 visual->textDecoration != other->visual->textDecoration || 507 507 rareInheritedData->userModify != other->rareInheritedData->userModify || -
trunk/WebCore/rendering/style/RenderStyle.h
r57482 r57526 138 138 DataRef<StyleBoxData> box; 139 139 DataRef<StyleVisualData> visual; 140 DataRef<StyleBackgroundData> background;140 DataRef<StyleBackgroundData> m_background; 141 141 DataRef<StyleSurroundData> surround; 142 142 DataRef<StyleRareNonInheritedData> rareNonInheritedData; … … 345 345 if (backgroundColor().isValid() && backgroundColor().alpha() > 0) 346 346 return true; 347 return background->m_background.hasImage();348 } 349 bool hasBackgroundImage() const { return background->m_background.hasImage(); }350 bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); }347 return m_background->background().hasImage(); 348 } 349 bool hasBackgroundImage() const { return m_background->background().hasImage(); } 350 bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); } 351 351 bool hasAppearance() const { return appearance() != NoControlPart; } 352 352 … … 419 419 unsigned short outlineWidth() const 420 420 { 421 if ( background->m_outline.style() == BNONE)421 if (m_background->outline().style() == BNONE) 422 422 return 0; 423 return background->m_outline.width();423 return m_background->outline().width(); 424 424 } 425 425 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; } 426 EBorderStyle outlineStyle() const { return background->m_outline.style(); }427 bool outlineStyleIsAuto() const { return background->m_outline.isAuto(); }428 const Color& outlineColor() const { return background->m_outline.color(); }426 EBorderStyle outlineStyle() const { return m_background->outline().style(); } 427 bool outlineStyleIsAuto() const { return m_background->outline().isAuto(); } 428 const Color& outlineColor() const { return m_background->outline().color(); } 429 429 430 430 EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); } … … 535 535 } 536 536 537 const Color& backgroundColor() const { return background->m_color; }538 StyleImage* backgroundImage() const { return background->m_background.image(); }539 EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>( background->m_background.repeatX()); }540 EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>( background->m_background.repeatY()); }541 CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>( background->m_background.composite()); }542 EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>( background->m_background.attachment()); }543 EFillBox backgroundClip() const { return static_cast<EFillBox>( background->m_background.clip()); }544 EFillBox backgroundOrigin() const { return static_cast<EFillBox>( background->m_background.origin()); }545 Length backgroundXPosition() const { return background->m_background.xPosition(); }546 Length backgroundYPosition() const { return background->m_background.yPosition(); }547 EFillSizeType backgroundSizeType() const { return background->m_background.sizeType(); }548 LengthSize backgroundSizeLength() const { return background->m_background.sizeLength(); }549 FillLayer* accessBackgroundLayers() { return &( background.access()->m_background); }550 const FillLayer* backgroundLayers() const { return &( background->m_background); }537 const Color& backgroundColor() const { return m_background->color(); } 538 StyleImage* backgroundImage() const { return m_background->background().image(); } 539 EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); } 540 EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); } 541 CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); } 542 EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); } 543 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); } 544 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); } 545 Length backgroundXPosition() const { return m_background->background().xPosition(); } 546 Length backgroundYPosition() const { return m_background->background().yPosition(); } 547 EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); } 548 LengthSize backgroundSizeLength() const { return m_background->background().sizeLength(); } 549 FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); } 550 const FillLayer* backgroundLayers() const { return &(m_background->background()); } 551 551 552 552 StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); } … … 610 610 int outlineOffset() const 611 611 { 612 if ( background->m_outline.style() == BNONE)612 if (m_background->outline().style() == BNONE) 613 613 return 0; 614 return background->m_outline.offset();614 return m_background->outline().offset(); 615 615 } 616 616 … … 769 769 void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()) } 770 770 771 void resetOutline() { SET_VAR( background, m_outline, OutlineValue()) }772 773 void setBackgroundColor(const Color& v) { SET_VAR( background, m_color, v) }774 775 void setBackgroundXPosition(Length l) { SET_VAR( background, m_background.m_xPosition, l) }776 void setBackgroundYPosition(Length l) { SET_VAR( background, m_background.m_yPosition, l) }777 void setBackgroundSize(EFillSizeType b) { SET_VAR( background, m_background.m_sizeType, b) }778 void setBackgroundSizeLength(LengthSize l) { SET_VAR( background, m_background.m_sizeLength, l) }771 void resetOutline() { SET_VAR(m_background, m_outline, OutlineValue()) } 772 773 void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v) } 774 775 void setBackgroundXPosition(Length l) { SET_VAR(m_background, m_background.m_xPosition, l) } 776 void setBackgroundYPosition(Length l) { SET_VAR(m_background, m_background.m_yPosition, l) } 777 void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b) } 778 void setBackgroundSizeLength(LengthSize l) { SET_VAR(m_background, m_background.m_sizeLength, l) } 779 779 780 780 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) } … … 807 807 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v) } 808 808 void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.m_bottom.m_color, v) } 809 void setOutlineWidth(unsigned short v) { SET_VAR( background, m_outline.m_width, v) }809 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v) } 810 810 811 811 void setOutlineStyle(EBorderStyle v, bool isAuto = false) 812 812 { 813 SET_VAR( background, m_outline.m_style, v)814 SET_VAR( background, m_outline.m_isAuto, isAuto)815 } 816 817 void setOutlineColor(const Color& v) { SET_VAR( background, m_outline.m_color, v) }813 SET_VAR(m_background, m_outline.m_style, v) 814 SET_VAR(m_background, m_outline.m_isAuto, isAuto) 815 } 816 817 void setOutlineColor(const Color& v) { SET_VAR(m_background, m_outline.m_color, v) } 818 818 819 819 void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; } … … 864 864 void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); } 865 865 866 void clearBackgroundLayers() { background.access()->m_background = FillLayer(BackgroundFillLayer); }867 void inheritBackgroundLayers(const FillLayer& parent) { background.access()->m_background = parent; }866 void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); } 867 void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; } 868 868 869 869 void adjustBackgroundLayers() … … 949 949 #endif 950 950 951 void setOutlineOffset(int v) { SET_VAR( background, m_outline.m_offset, v) }951 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v) } 952 952 void setTextShadow(ShadowData* val, bool add=false); 953 953 void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) } -
trunk/WebCore/rendering/style/StyleBackgroundData.h
r36587 r57526 46 46 } 47 47 48 const FillLayer& background() const { return m_background; } 49 const Color& color() const { return m_color; } 50 const OutlineValue& outline() const { return m_outline; } 51 52 private: 53 friend class RenderStyle; 54 55 StyleBackgroundData(); 56 StyleBackgroundData(const StyleBackgroundData&); 57 48 58 FillLayer m_background; 49 59 Color m_color; 50 60 OutlineValue m_outline; 51 52 private:53 StyleBackgroundData();54 StyleBackgroundData(const StyleBackgroundData&);55 61 }; 56 62
Note: See TracChangeset
for help on using the changeset viewer.