Changeset 57355 in webkit
- Timestamp:
- Apr 9, 2010 1:21:55 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57351 r57355 1 2010-04-09 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Adam Roben. 4 5 https://bugs.webkit.org/show_bug.cgi?id=37349, RenderStyle cleanup. Working from the outside in to 6 bring some style consistency to RenderStyle and its associated classes. This patch cleans up the 7 border and outline classes. 8 9 * rendering/RenderTable.cpp: 10 (WebCore::RenderTable::calcBorderLeft): 11 (WebCore::RenderTable::calcBorderRight): 12 (WebCore::RenderTable::outerBorderTop): 13 (WebCore::RenderTable::outerBorderBottom): 14 (WebCore::RenderTable::outerBorderLeft): 15 (WebCore::RenderTable::outerBorderRight): 16 * rendering/RenderTableCell.cpp: 17 (WebCore::compareBorders): 18 * rendering/RenderTableSection.cpp: 19 (WebCore::RenderTableSection::calcOuterBorderTop): 20 (WebCore::RenderTableSection::calcOuterBorderBottom): 21 (WebCore::RenderTableSection::calcOuterBorderLeft): 22 (WebCore::RenderTableSection::calcOuterBorderRight): 23 * rendering/style/BorderData.h: 24 (WebCore::BorderData::hasBorder): 25 (WebCore::BorderData::hasBorderRadius): 26 (WebCore::BorderData::borderLeftWidth): 27 (WebCore::BorderData::borderRightWidth): 28 (WebCore::BorderData::borderTopWidth): 29 (WebCore::BorderData::borderBottomWidth): 30 (WebCore::BorderData::operator==): 31 (WebCore::BorderData::left): 32 (WebCore::BorderData::right): 33 (WebCore::BorderData::top): 34 (WebCore::BorderData::bottom): 35 (WebCore::BorderData::image): 36 (WebCore::BorderData::topLeft): 37 (WebCore::BorderData::topRight): 38 (WebCore::BorderData::bottomLeft): 39 (WebCore::BorderData::bottomRight): 40 * rendering/style/BorderValue.h: 41 (WebCore::BorderValue::BorderValue): 42 (WebCore::BorderValue::nonZero): 43 (WebCore::BorderValue::isTransparent): 44 (WebCore::BorderValue::operator==): 45 (WebCore::BorderValue::color): 46 (WebCore::BorderValue::width): 47 (WebCore::BorderValue::style): 48 * rendering/style/CollapsedBorderValue.h: 49 (WebCore::CollapsedBorderValue::CollapsedBorderValue): 50 (WebCore::CollapsedBorderValue::width): 51 (WebCore::CollapsedBorderValue::style): 52 (WebCore::CollapsedBorderValue::exists): 53 (WebCore::CollapsedBorderValue::color): 54 (WebCore::CollapsedBorderValue::isTransparent): 55 (WebCore::CollapsedBorderValue::precedence): 56 (WebCore::CollapsedBorderValue::operator==): 57 * rendering/style/OutlineValue.h: 58 (WebCore::OutlineValue::OutlineValue): 59 (WebCore::OutlineValue::operator==): 60 (WebCore::OutlineValue::offset): 61 (WebCore::OutlineValue::isAuto): 62 * rendering/style/RenderStyle.cpp: 63 (WebCore::RenderStyle::getBorderRadiiForRect): 64 * rendering/style/RenderStyle.h: 65 (WebCore::InheritedFlags::borderLeft): 66 (WebCore::InheritedFlags::borderRight): 67 (WebCore::InheritedFlags::borderTop): 68 (WebCore::InheritedFlags::borderBottom): 69 (WebCore::InheritedFlags::borderImage): 70 (WebCore::InheritedFlags::borderTopLeftRadius): 71 (WebCore::InheritedFlags::borderTopRightRadius): 72 (WebCore::InheritedFlags::borderBottomLeftRadius): 73 (WebCore::InheritedFlags::borderBottomRightRadius): 74 (WebCore::InheritedFlags::borderLeftStyle): 75 (WebCore::InheritedFlags::borderLeftColor): 76 (WebCore::InheritedFlags::borderLeftIsTransparent): 77 (WebCore::InheritedFlags::borderRightStyle): 78 (WebCore::InheritedFlags::borderRightColor): 79 (WebCore::InheritedFlags::borderRightIsTransparent): 80 (WebCore::InheritedFlags::borderTopStyle): 81 (WebCore::InheritedFlags::borderTopColor): 82 (WebCore::InheritedFlags::borderTopIsTransparent): 83 (WebCore::InheritedFlags::borderBottomStyle): 84 (WebCore::InheritedFlags::borderBottomColor): 85 (WebCore::InheritedFlags::borderBottomIsTransparent): 86 (WebCore::InheritedFlags::outlineWidth): 87 (WebCore::InheritedFlags::outlineStyleIsAuto): 88 (WebCore::InheritedFlags::outlineColor): 89 (WebCore::InheritedFlags::outlineOffset): 90 (WebCore::InheritedFlags::columnRuleColor): 91 (WebCore::InheritedFlags::resetBorderTop): 92 (WebCore::InheritedFlags::resetBorderRight): 93 (WebCore::InheritedFlags::resetBorderBottom): 94 (WebCore::InheritedFlags::resetBorderLeft): 95 (WebCore::InheritedFlags::resetBorderImage): 96 (WebCore::InheritedFlags::resetBorderTopLeftRadius): 97 (WebCore::InheritedFlags::resetBorderTopRightRadius): 98 (WebCore::InheritedFlags::resetBorderBottomLeftRadius): 99 (WebCore::InheritedFlags::resetBorderBottomRightRadius): 100 (WebCore::InheritedFlags::setBorderImage): 101 (WebCore::InheritedFlags::setBorderTopLeftRadius): 102 (WebCore::InheritedFlags::setBorderTopRightRadius): 103 (WebCore::InheritedFlags::setBorderBottomLeftRadius): 104 (WebCore::InheritedFlags::setBorderBottomRightRadius): 105 (WebCore::InheritedFlags::setBorderLeftWidth): 106 (WebCore::InheritedFlags::setBorderLeftStyle): 107 (WebCore::InheritedFlags::setBorderLeftColor): 108 (WebCore::InheritedFlags::setBorderRightWidth): 109 (WebCore::InheritedFlags::setBorderRightStyle): 110 (WebCore::InheritedFlags::setBorderRightColor): 111 (WebCore::InheritedFlags::setBorderTopWidth): 112 (WebCore::InheritedFlags::setBorderTopStyle): 113 (WebCore::InheritedFlags::setBorderTopColor): 114 (WebCore::InheritedFlags::setBorderBottomWidth): 115 (WebCore::InheritedFlags::setBorderBottomStyle): 116 (WebCore::InheritedFlags::setBorderBottomColor): 117 (WebCore::InheritedFlags::setOutlineWidth): 118 (WebCore::InheritedFlags::setOutlineStyle): 119 (WebCore::InheritedFlags::setOutlineColor): 120 (WebCore::InheritedFlags::setOutlineOffset): 121 (WebCore::InheritedFlags::setColumnRuleColor): 122 (WebCore::InheritedFlags::setColumnRuleWidth): 123 * rendering/style/StyleMultiColData.h: 124 (WebCore::StyleMultiColData::ruleWidth): 125 1 126 2010-04-09 Andrey Kosyakov <caseq@chromium.org> 2 127 -
trunk/WebCore/rendering/RenderTable.cpp
r56319 r57355 725 725 return 0; 726 726 if (tb.style() > BHIDDEN) 727 borderWidth = tb.width ;727 borderWidth = tb.width(); 728 728 729 729 int leftmostColumn = style()->direction() == RTL ? numEffCols() - 1 : 0; … … 734 734 return 0; 735 735 if (gb.style() > BHIDDEN) 736 borderWidth = max(borderWidth, static_cast<unsigned>(gb.width ));736 borderWidth = max(borderWidth, static_cast<unsigned>(gb.width())); 737 737 } 738 738 … … 747 747 748 748 if (sb.style() > BHIDDEN) 749 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width ));749 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width())); 750 750 751 751 const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, leftmostColumn); … … 761 761 762 762 if (cb.style() > BHIDDEN) 763 borderWidth = max(borderWidth, static_cast<unsigned>(cb.width ));763 borderWidth = max(borderWidth, static_cast<unsigned>(cb.width())); 764 764 if (rb.style() > BHIDDEN) 765 borderWidth = max(borderWidth, static_cast<unsigned>(rb.width ));765 borderWidth = max(borderWidth, static_cast<unsigned>(rb.width())); 766 766 } 767 767 } … … 784 784 return 0; 785 785 if (tb.style() > BHIDDEN) 786 borderWidth = tb.width ;786 borderWidth = tb.width(); 787 787 788 788 int rightmostColumn = style()->direction() == RTL ? 0 : numEffCols() - 1; … … 793 793 return 0; 794 794 if (gb.style() > BHIDDEN) 795 borderWidth = max(borderWidth, static_cast<unsigned>(gb.width ));795 borderWidth = max(borderWidth, static_cast<unsigned>(gb.width())); 796 796 } 797 797 … … 806 806 807 807 if (sb.style() > BHIDDEN) 808 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width ));808 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width())); 809 809 810 810 const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, rightmostColumn); … … 820 820 821 821 if (cb.style() > BHIDDEN) 822 borderWidth = max(borderWidth, static_cast<unsigned>(cb.width ));822 borderWidth = max(borderWidth, static_cast<unsigned>(cb.width())); 823 823 if (rb.style() > BHIDDEN) 824 borderWidth = max(borderWidth, static_cast<unsigned>(rb.width ));824 borderWidth = max(borderWidth, static_cast<unsigned>(rb.width())); 825 825 } 826 826 } … … 873 873 return 0; 874 874 if (tb.style() > BHIDDEN) 875 borderWidth = max(borderWidth, static_cast<int>(tb.width / 2));875 borderWidth = max(borderWidth, static_cast<int>(tb.width() / 2)); 876 876 return borderWidth; 877 877 } … … 899 899 return 0; 900 900 if (tb.style() > BHIDDEN) 901 borderWidth = max(borderWidth, static_cast<int>((tb.width + 1) / 2));901 borderWidth = max(borderWidth, static_cast<int>((tb.width() + 1) / 2)); 902 902 return borderWidth; 903 903 } … … 914 914 return 0; 915 915 if (tb.style() > BHIDDEN) 916 borderWidth = tb.width / 2;916 borderWidth = tb.width() / 2; 917 917 918 918 bool allHidden = true; … … 944 944 return 0; 945 945 if (tb.style() > BHIDDEN) 946 borderWidth = (tb.width + 1) / 2;946 borderWidth = (tb.width() + 1) / 2; 947 947 948 948 bool allHidden = true; -
trunk/WebCore/rendering/RenderTableCell.cpp
r57292 r57355 323 323 324 324 // The border have the same width and style. Rely on precedence (cell over row over row group, etc.) 325 return border1.precedence >= border2.precedence? border1 : border2;325 return border1.precedence() >= border2.precedence() ? border1 : border2; 326 326 } 327 327 -
trunk/WebCore/rendering/RenderTableSection.cpp
r52683 r57355 721 721 return -1; 722 722 if (sb.style() > BHIDDEN) 723 borderWidth = sb.width ;723 borderWidth = sb.width(); 724 724 725 725 const BorderValue& rb = firstChild()->style()->borderTop(); 726 726 if (rb.style() == BHIDDEN) 727 727 return -1; 728 if (rb.style() > BHIDDEN && rb.width > borderWidth)729 borderWidth = rb.width ;728 if (rb.style() > BHIDDEN && rb.width() > borderWidth) 729 borderWidth = rb.width(); 730 730 731 731 bool allHidden = true; … … 743 743 else 744 744 allHidden = false; 745 if (gb.style() > BHIDDEN && gb.width > borderWidth)746 borderWidth = gb.width ;747 if (cb.style() > BHIDDEN && cb.width > borderWidth)748 borderWidth = cb.width ;745 if (gb.style() > BHIDDEN && gb.width() > borderWidth) 746 borderWidth = gb.width(); 747 if (cb.style() > BHIDDEN && cb.width() > borderWidth) 748 borderWidth = cb.width(); 749 749 } else { 750 750 if (cb.style() == BHIDDEN) … … 752 752 else 753 753 allHidden = false; 754 if (cb.style() > BHIDDEN && cb.width > borderWidth)755 borderWidth = cb.width ;754 if (cb.style() > BHIDDEN && cb.width() > borderWidth) 755 borderWidth = cb.width(); 756 756 } 757 757 } … … 774 774 return -1; 775 775 if (sb.style() > BHIDDEN) 776 borderWidth = sb.width ;776 borderWidth = sb.width(); 777 777 778 778 const BorderValue& rb = lastChild()->style()->borderBottom(); 779 779 if (rb.style() == BHIDDEN) 780 780 return -1; 781 if (rb.style() > BHIDDEN && rb.width > borderWidth)782 borderWidth = rb.width ;781 if (rb.style() > BHIDDEN && rb.width() > borderWidth) 782 borderWidth = rb.width(); 783 783 784 784 bool allHidden = true; … … 796 796 else 797 797 allHidden = false; 798 if (gb.style() > BHIDDEN && gb.width > borderWidth)799 borderWidth = gb.width ;800 if (cb.style() > BHIDDEN && cb.width > borderWidth)801 borderWidth = cb.width ;798 if (gb.style() > BHIDDEN && gb.width() > borderWidth) 799 borderWidth = gb.width(); 800 if (cb.style() > BHIDDEN && cb.width() > borderWidth) 801 borderWidth = cb.width(); 802 802 } else { 803 803 if (cb.style() == BHIDDEN) … … 805 805 else 806 806 allHidden = false; 807 if (cb.style() > BHIDDEN && cb.width > borderWidth)808 borderWidth = cb.width ;807 if (cb.style() > BHIDDEN && cb.width() > borderWidth) 808 borderWidth = cb.width(); 809 809 } 810 810 } … … 827 827 return -1; 828 828 if (sb.style() > BHIDDEN) 829 borderWidth = sb.width ;829 borderWidth = sb.width(); 830 830 831 831 int leftmostColumn = rtl ? totalCols - 1 : 0; … … 835 835 if (gb.style() == BHIDDEN) 836 836 return -1; 837 if (gb.style() > BHIDDEN && gb.width > borderWidth)838 borderWidth = gb.width ;837 if (gb.style() > BHIDDEN && gb.width() > borderWidth) 838 borderWidth = gb.width(); 839 839 } 840 840 … … 851 851 else 852 852 allHidden = false; 853 if (cb.style() > BHIDDEN && cb.width > borderWidth)854 borderWidth = cb.width ;855 if (rb.style() > BHIDDEN && rb.width > borderWidth)856 borderWidth = rb.width ;853 if (cb.style() > BHIDDEN && cb.width() > borderWidth) 854 borderWidth = cb.width(); 855 if (rb.style() > BHIDDEN && rb.width() > borderWidth) 856 borderWidth = rb.width(); 857 857 } 858 858 if (allHidden) … … 874 874 return -1; 875 875 if (sb.style() > BHIDDEN) 876 borderWidth = sb.width ;876 borderWidth = sb.width(); 877 877 878 878 int rightmostColumn = rtl ? 0 : totalCols - 1; … … 882 882 if (gb.style() == BHIDDEN) 883 883 return -1; 884 if (gb.style() > BHIDDEN && gb.width > borderWidth)885 borderWidth = gb.width ;884 if (gb.style() > BHIDDEN && gb.width() > borderWidth) 885 borderWidth = gb.width(); 886 886 } 887 887 … … 898 898 else 899 899 allHidden = false; 900 if (cb.style() > BHIDDEN && cb.width > borderWidth)901 borderWidth = cb.width ;902 if (rb.style() > BHIDDEN && rb.width > borderWidth)903 borderWidth = rb.width ;900 if (cb.style() > BHIDDEN && cb.width() > borderWidth) 901 borderWidth = cb.width(); 902 if (rb.style() > BHIDDEN && rb.width() > borderWidth) 903 borderWidth = rb.width(); 904 904 } 905 905 if (allHidden) -
trunk/WebCore/rendering/style/BorderData.h
r36568 r57355 33 33 34 34 class BorderData { 35 friend class RenderStyle; 35 36 public: 36 BorderValue left;37 BorderValue right;38 BorderValue top;39 BorderValue bottom;40 41 NinePieceImage image;42 43 IntSize topLeft;44 IntSize topRight;45 IntSize bottomLeft;46 IntSize bottomRight;47 48 37 bool hasBorder() const 49 38 { 50 bool haveImage = image.hasImage();51 return left.nonZero(!haveImage) || right.nonZero(!haveImage) || top.nonZero(!haveImage) ||bottom.nonZero(!haveImage);39 bool haveImage = m_image.hasImage(); 40 return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage); 52 41 } 53 42 54 43 bool hasBorderRadius() const 55 44 { 56 if ( topLeft.width() > 0)45 if (m_topLeft.width() > 0) 57 46 return true; 58 if ( topRight.width() > 0)47 if (m_topRight.width() > 0) 59 48 return true; 60 if ( bottomLeft.width() > 0)49 if (m_bottomLeft.width() > 0) 61 50 return true; 62 if ( bottomRight.width() > 0)51 if (m_bottomRight.width() > 0) 63 52 return true; 64 53 return false; … … 67 56 unsigned short borderLeftWidth() const 68 57 { 69 if (! image.hasImage() && (left.style() == BNONE ||left.style() == BHIDDEN))58 if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN)) 70 59 return 0; 71 return left.width;60 return m_left.width(); 72 61 } 73 62 74 63 unsigned short borderRightWidth() const 75 64 { 76 if (! image.hasImage() && (right.style() == BNONE ||right.style() == BHIDDEN))65 if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN)) 77 66 return 0; 78 return right.width;67 return m_right.width(); 79 68 } 80 69 81 70 unsigned short borderTopWidth() const 82 71 { 83 if (! image.hasImage() && (top.style() == BNONE ||top.style() == BHIDDEN))72 if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == BHIDDEN)) 84 73 return 0; 85 return top.width;74 return m_top.width(); 86 75 } 87 76 88 77 unsigned short borderBottomWidth() const 89 78 { 90 if (! image.hasImage() && (bottom.style() == BNONE ||bottom.style() == BHIDDEN))79 if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN)) 91 80 return 0; 92 return bottom.width;81 return m_bottom.width(); 93 82 } 94 83 95 84 bool operator==(const BorderData& o) const 96 85 { 97 return left == o.left && right == o.right && top == o.top && bottom == o.bottom && image == o.image &&98 topLeft == o.topLeft && topRight == o.topRight && bottomLeft == o.bottomLeft && bottomRight == o.bottomRight;86 return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && m_bottom == o.m_bottom && m_image == o.m_image 87 && m_topLeft == o.m_topLeft && m_topRight == o.m_topRight && m_bottomLeft == o.m_bottomLeft && m_bottomRight == o.m_bottomRight; 99 88 } 100 89 … … 103 92 return !(*this == o); 104 93 } 94 95 const BorderValue& left() const { return m_left; } 96 const BorderValue& right() const { return m_right; } 97 const BorderValue& top() const { return m_top; } 98 const BorderValue& bottom() const { return m_bottom; } 99 100 const NinePieceImage& image() const { return m_image; } 101 102 const IntSize& topLeft() const { return m_topLeft; } 103 const IntSize& topRight() const { return m_topRight; } 104 const IntSize& bottomLeft() const { return m_bottomLeft; } 105 const IntSize& bottomRight() const { return m_bottomRight; } 106 107 private: 108 BorderValue m_left; 109 BorderValue m_right; 110 BorderValue m_top; 111 BorderValue m_bottom; 112 113 NinePieceImage m_image; 114 115 IntSize m_topLeft; 116 IntSize m_topRight; 117 IntSize m_bottomLeft; 118 IntSize m_bottomRight; 105 119 }; 106 120 -
trunk/WebCore/rendering/style/BorderValue.h
r36579 r57355 32 32 33 33 class BorderValue { 34 friend class RenderStyle; 34 35 public: 35 36 BorderValue() 36 : width(3)37 : m_width(3) 37 38 , m_style(BNONE) 38 39 { 39 40 } 40 41 41 Color color;42 unsigned width : 12;43 unsigned m_style : 4; // EBorderStyle44 45 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }46 47 42 bool nonZero(bool checkStyle = true) const 48 43 { 49 return width != 0&& (!checkStyle || m_style != BNONE);44 return width() && (!checkStyle || m_style != BNONE); 50 45 } 51 46 52 47 bool isTransparent() const 53 48 { 54 return color.isValid() && color.alpha() == 0;49 return m_color.isValid() && !m_color.alpha(); 55 50 } 56 51 … … 62 57 bool operator==(const BorderValue& o) const 63 58 { 64 return width == o.width && m_style == o.m_style && color == o.color;59 return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color; 65 60 } 66 61 … … 69 64 return !(*this == o); 70 65 } 66 67 const Color& color() const { return m_color; } 68 unsigned short width() const { return m_width; } 69 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } 70 71 protected: 72 Color m_color; 73 unsigned m_width : 12; 74 unsigned m_style : 4; // EBorderStyle 71 75 }; 72 76 -
trunk/WebCore/rendering/style/CollapsedBorderValue.h
r57292 r57355 30 30 namespace WebCore { 31 31 32 struct CollapsedBorderValue { 32 class CollapsedBorderValue { 33 friend class RenderStyle; 34 public: 33 35 CollapsedBorderValue() 34 : border(0)35 , precedence(BOFF)36 : m_border(0) 37 , m_precedence(BOFF) 36 38 { 37 39 } 38 40 39 41 CollapsedBorderValue(const BorderValue* b, Color c, EBorderPrecedence p) 40 : border(b)41 , borderColor(c)42 , precedence(p)42 : m_border(b) 43 , m_borderColor(c) 44 , m_precedence(p) 43 45 { 44 46 } 45 47 46 int width() const { return border && border->nonZero() ? border->width : 0; } 47 EBorderStyle style() const { return border ? border->style() : BHIDDEN; } 48 bool exists() const { return border; } 49 Color color() const { return borderColor; } 50 bool isTransparent() const { return border ? border->isTransparent() : true; } 51 48 int width() const { return m_border && m_border->nonZero() ? m_border->width() : 0; } 49 EBorderStyle style() const { return m_border ? m_border->style() : BHIDDEN; } 50 bool exists() const { return m_border; } 51 const Color& color() const { return m_borderColor; } 52 bool isTransparent() const { return m_border ? m_border->isTransparent() : true; } 53 EBorderPrecedence precedence() const { return m_precedence; } 54 52 55 bool operator==(const CollapsedBorderValue& o) const 53 56 { 54 if (! border)55 return !o. border;56 if (!o. border)57 if (!m_border) 58 return !o.m_border; 59 if (!o.m_border) 57 60 return false; 58 return * border == *o.border && borderColor == o.borderColor && precedence == o.precedence;61 return *m_border == *o.m_border && m_borderColor == o.m_borderColor && m_precedence == o.m_precedence; 59 62 } 60 61 const BorderValue* border; 62 Color borderColor; 63 EBorderPrecedence precedence; 63 64 private: 65 const BorderValue* m_border; 66 Color m_borderColor; 67 EBorderPrecedence m_precedence; 64 68 }; 65 69 -
trunk/WebCore/rendering/style/OutlineValue.h
r36568 r57355 31 31 32 32 class OutlineValue : public BorderValue { 33 friend class RenderStyle; 33 34 public: 34 35 OutlineValue() 35 : _offset(0)36 , _auto(false)36 : m_offset(0) 37 , m_isAuto(false) 37 38 { 38 39 } … … 40 41 bool operator==(const OutlineValue& o) const 41 42 { 42 return width == o.width && m_style == o.m_style && color == o.color && _offset == o._offset && _auto == o._auto;43 return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color && m_offset == o.m_offset && m_isAuto == o.m_isAuto; 43 44 } 44 45 … … 48 49 } 49 50 50 int _offset; 51 bool _auto; 51 int offset() const { return m_offset; } 52 bool isAuto() const { return m_isAuto; } 53 54 private: 55 int m_offset; 56 bool m_isAuto; 52 57 }; 53 58 -
trunk/WebCore/rendering/style/RenderStyle.cpp
r57292 r57355 734 734 void RenderStyle::getBorderRadiiForRect(const IntRect& r, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const 735 735 { 736 topLeft = surround->border.topLeft ;737 topRight = surround->border.topRight ;736 topLeft = surround->border.topLeft(); 737 topRight = surround->border.topRight(); 738 738 739 bottomLeft = surround->border.bottomLeft ;740 bottomRight = surround->border.bottomRight ;739 bottomLeft = surround->border.bottomLeft(); 740 bottomRight = surround->border.bottomRight(); 741 741 742 742 // Constrain corner radii using CSS3 rules: -
trunk/WebCore/rendering/style/RenderStyle.h
r57292 r57355 386 386 387 387 const BorderData& border() const { return surround->border; } 388 const BorderValue& borderLeft() const { return surround->border.left ; }389 const BorderValue& borderRight() const { return surround->border.right ; }390 const BorderValue& borderTop() const { return surround->border.top ; }391 const BorderValue& borderBottom() const { return surround->border.bottom ; }392 393 const NinePieceImage& borderImage() const { return surround->border.image ; }394 395 const IntSize& borderTopLeftRadius() const { return surround->border.topLeft ; }396 const IntSize& borderTopRightRadius() const { return surround->border.topRight ; }397 const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft ; }398 const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight ; }388 const BorderValue& borderLeft() const { return surround->border.left(); } 389 const BorderValue& borderRight() const { return surround->border.right(); } 390 const BorderValue& borderTop() const { return surround->border.top(); } 391 const BorderValue& borderBottom() const { return surround->border.bottom(); } 392 393 const NinePieceImage& borderImage() const { return surround->border.image(); } 394 395 const IntSize& borderTopLeftRadius() const { return surround->border.topLeft(); } 396 const IntSize& borderTopRightRadius() const { return surround->border.topRight(); } 397 const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); } 398 const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight(); } 399 399 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); } 400 400 401 401 unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); } 402 EBorderStyle borderLeftStyle() const { return surround->border.left .style(); }403 const Color& borderLeftColor() const { return surround->border.left .color; }404 bool borderLeftIsTransparent() const { return surround->border.left .isTransparent(); }402 EBorderStyle borderLeftStyle() const { return surround->border.left().style(); } 403 const Color& borderLeftColor() const { return surround->border.left().color(); } 404 bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); } 405 405 unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); } 406 EBorderStyle borderRightStyle() const { return surround->border.right .style(); }407 const Color& borderRightColor() const { return surround->border.right .color; }408 bool borderRightIsTransparent() const { return surround->border.right .isTransparent(); }406 EBorderStyle borderRightStyle() const { return surround->border.right().style(); } 407 const Color& borderRightColor() const { return surround->border.right().color(); } 408 bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); } 409 409 unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); } 410 EBorderStyle borderTopStyle() const { return surround->border.top .style(); }411 const Color& borderTopColor() const { return surround->border.top .color; }412 bool borderTopIsTransparent() const { return surround->border.top .isTransparent(); }410 EBorderStyle borderTopStyle() const { return surround->border.top().style(); } 411 const Color& borderTopColor() const { return surround->border.top().color(); } 412 bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); } 413 413 unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); } 414 EBorderStyle borderBottomStyle() const { return surround->border.bottom .style(); }415 const Color& borderBottomColor() const { return surround->border.bottom .color; }416 bool borderBottomIsTransparent() const { return surround->border.bottom .isTransparent(); }414 EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); } 415 const Color& borderBottomColor() const { return surround->border.bottom().color(); } 416 bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); } 417 417 418 418 unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); } … … 421 421 if (background->m_outline.style() == BNONE) 422 422 return 0; 423 return background->m_outline.width ;423 return background->m_outline.width(); 424 424 } 425 425 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; } 426 426 EBorderStyle outlineStyle() const { return background->m_outline.style(); } 427 bool outlineStyleIsAuto() const { return background->m_outline. _auto; }428 const Color& outlineColor() const { return background->m_outline.color ; }427 bool outlineStyleIsAuto() const { return background->m_outline.isAuto(); } 428 const Color& outlineColor() const { return background->m_outline.color(); } 429 429 430 430 EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); } … … 611 611 if (background->m_outline.style() == BNONE) 612 612 return 0; 613 return background->m_outline. _offset;613 return background->m_outline.offset(); 614 614 } 615 615 … … 662 662 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; } 663 663 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; } 664 const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color ; }664 const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); } 665 665 EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); } 666 666 unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); } … … 757 757 758 758 void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); } 759 void resetBorderTop() { SET_VAR(surround, border. top, BorderValue()) }760 void resetBorderRight() { SET_VAR(surround, border. right, BorderValue()) }761 void resetBorderBottom() { SET_VAR(surround, border. bottom, BorderValue()) }762 void resetBorderLeft() { SET_VAR(surround, border. left, BorderValue()) }763 void resetBorderImage() { SET_VAR(surround, border. image, NinePieceImage()) }759 void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()) } 760 void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()) } 761 void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()) } 762 void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()) } 763 void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()) } 764 764 void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); } 765 void resetBorderTopLeftRadius() { SET_VAR(surround, border. topLeft, initialBorderRadius()) }766 void resetBorderTopRightRadius() { SET_VAR(surround, border. topRight, initialBorderRadius()) }767 void resetBorderBottomLeftRadius() { SET_VAR(surround, border. bottomLeft, initialBorderRadius()) }768 void resetBorderBottomRightRadius() { SET_VAR(surround, border. bottomRight, initialBorderRadius()) }765 void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()) } 766 void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()) } 767 void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()) } 768 void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()) } 769 769 770 770 void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) } … … 777 777 void setBackgroundSizeLength(LengthSize l) { SET_VAR(background, m_background.m_sizeLength, l) } 778 778 779 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border. image, b) }780 781 void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border. topLeft, s) }782 void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border. topRight, s) }783 void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border. bottomLeft, s) }784 void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border. bottomRight, s) }779 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) } 780 781 void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.m_topLeft, s) } 782 void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.m_topRight, s) } 783 void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.m_bottomLeft, s) } 784 void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.m_bottomRight, s) } 785 785 786 786 void setBorderRadius(const IntSize& s) … … 794 794 void getBorderRadiiForRect(const IntRect&, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const; 795 795 796 void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border. left.width, v) }797 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border. left.m_style, v) }798 void setBorderLeftColor(const Color& v) { SET_VAR(surround, border. left.color, v) }799 void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border. right.width, v) }800 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border. right.m_style, v) }801 void setBorderRightColor(const Color& v) { SET_VAR(surround, border. right.color, v) }802 void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border. top.width, v) }803 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border. top.m_style, v) }804 void setBorderTopColor(const Color& v) { SET_VAR(surround, border. top.color, v) }805 void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border. bottom.width, v) }806 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border. bottom.m_style, v) }807 void setBorderBottomColor(const Color& v) { SET_VAR(surround, border. bottom.color, v) }808 void setOutlineWidth(unsigned short v) { SET_VAR(background, m_outline. width, v) }796 void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) } 797 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v) } 798 void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.m_left.m_color, v) } 799 void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.m_right.m_width, v) } 800 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v) } 801 void setBorderRightColor(const Color& v) { SET_VAR(surround, border.m_right.m_color, v) } 802 void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.m_top.m_width, v) } 803 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v) } 804 void setBorderTopColor(const Color& v) { SET_VAR(surround, border.m_top.m_color, v) } 805 void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.m_bottom.m_width, v) } 806 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v) } 807 void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.m_bottom.m_color, v) } 808 void setOutlineWidth(unsigned short v) { SET_VAR(background, m_outline.m_width, v) } 809 809 810 810 void setOutlineStyle(EBorderStyle v, bool isAuto = false) 811 811 { 812 812 SET_VAR(background, m_outline.m_style, v) 813 SET_VAR(background, m_outline. _auto, isAuto)814 } 815 816 void setOutlineColor(const Color& v) { SET_VAR(background, m_outline. color, v) }813 SET_VAR(background, m_outline.m_isAuto, isAuto) 814 } 815 816 void setOutlineColor(const Color& v) { SET_VAR(background, m_outline.m_color, v) } 817 817 818 818 void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; } … … 948 948 #endif 949 949 950 void setOutlineOffset(int v) { SET_VAR(background, m_outline. _offset, v) }950 void setOutlineOffset(int v) { SET_VAR(background, m_outline.m_offset, v) } 951 951 void setTextShadow(ShadowData* val, bool add=false); 952 952 void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) } … … 992 992 void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); } 993 993 void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); } 994 void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule. color, c); }994 void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_color, c); } 995 995 void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); } 996 void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule. width, w); }996 void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_width, w); } 997 997 void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()) } 998 998 void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); } -
trunk/WebCore/rendering/style/StyleMultiColData.h
r36587 r57355 51 51 if (m_rule.style() == BNONE || m_rule.style() == BHIDDEN) 52 52 return 0; 53 return m_rule.width ;53 return m_rule.width(); 54 54 } 55 55
Note: See TracChangeset
for help on using the changeset viewer.