Changeset 163171 in webkit
- Timestamp:
- Jan 31, 2014 8:48:55 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163170 r163171 1 2014-01-31 Zalan Bujtas <zalan@apple.com> 2 3 Subpixel rendering: Change RenderBoxModelObject's border functions' signature to support subpixel border painting. 4 https://bugs.webkit.org/show_bug.cgi?id=127975 5 6 Reviewed by Simon Fraser. 7 8 From int to LayoutUnit. 9 10 Covered by existing tests. No change in functionality. 11 12 * platform/text/TextStream.cpp: 13 (WebCore::TextStream::operator<<): 14 * platform/text/TextStream.h: 15 * rendering/RenderBoxModelObject.cpp: 16 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 17 * rendering/RenderBoxModelObject.h: 18 (WebCore::RenderBoxModelObject::borderTop): 19 (WebCore::RenderBoxModelObject::borderBottom): 20 (WebCore::RenderBoxModelObject::borderLeft): 21 (WebCore::RenderBoxModelObject::borderRight): 22 (WebCore::RenderBoxModelObject::borderBefore): 23 (WebCore::RenderBoxModelObject::borderAfter): 24 (WebCore::RenderBoxModelObject::borderStart): 25 (WebCore::RenderBoxModelObject::borderEnd): 26 * rendering/RenderElement.cpp: 27 (WebCore::RenderElement::repaintAfterLayoutIfNeeded): 28 * rendering/RenderTable.cpp: 29 (WebCore::RenderTable::borderBefore): 30 (WebCore::RenderTable::borderAfter): 31 * rendering/RenderTable.h: 32 * rendering/RenderTableCell.cpp: 33 (WebCore::RenderTableCell::borderLeft): 34 (WebCore::RenderTableCell::borderRight): 35 (WebCore::RenderTableCell::borderTop): 36 (WebCore::RenderTableCell::borderBottom): 37 (WebCore::RenderTableCell::borderStart): 38 (WebCore::RenderTableCell::borderEnd): 39 (WebCore::RenderTableCell::borderBefore): 40 (WebCore::RenderTableCell::borderAfter): 41 * rendering/RenderTableCell.h: 42 1 43 2014-01-31 Brady Eidson <beidson@apple.com> 2 44 -
trunk/Source/WebCore/platform/text/TextStream.cpp
r159027 r163171 32 32 #include "IntRect.h" 33 33 #include "LayoutRect.h" 34 #include "LayoutUnit.h" 34 35 #include <wtf/MathExtras.h> 35 36 #include <wtf/StringExtras.h> … … 151 152 } 152 153 154 TextStream& TextStream::operator<<(const LayoutUnit& v) 155 { 156 return *this << TextStream::FormatNumberRespectingIntegers(v.toFloat()); 157 } 158 153 159 TextStream& TextStream::operator<<(const LayoutPoint& p) 154 160 { -
trunk/Source/WebCore/platform/text/TextStream.h
r158183 r163171 39 39 class LayoutPoint; 40 40 class LayoutRect; 41 class LayoutUnit; 41 42 42 43 class TextStream { … … 65 66 TextStream& operator<<(const FloatPoint&); 66 67 TextStream& operator<<(const FloatSize&); 68 TextStream& operator<<(const LayoutUnit&); 67 69 TextStream& operator<<(const LayoutPoint&); 68 70 TextStream& operator<<(const LayoutRect&); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r163156 r163171 677 677 } 678 678 679 int bLeft = includeLeftEdge ? borderLeft() : 0;680 int bRight = includeRightEdge ? borderRight() : 0;679 LayoutUnit bLeft = includeLeftEdge ? borderLeft() : LayoutUnit::fromPixel(0); 680 LayoutUnit bRight = includeRightEdge ? borderRight() : LayoutUnit::fromPixel(0); 681 681 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : LayoutUnit(); 682 682 LayoutUnit pRight = includeRightEdge ? paddingRight() : LayoutUnit(); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r163156 r163171 114 114 virtual LayoutUnit paddingEnd() const { return computedCSSPaddingEnd(); } 115 115 116 virtual int borderTop() const { return style().borderTopWidth(); }117 virtual int borderBottom() const { return style().borderBottomWidth(); }118 virtual int borderLeft() const { return style().borderLeftWidth(); }119 virtual int borderRight() const { return style().borderRightWidth(); }120 virtual int borderBefore() const { return style().borderBeforeWidth(); }121 virtual int borderAfter() const { return style().borderAfterWidth(); }122 virtual int borderStart() const { return style().borderStartWidth(); }123 virtual int borderEnd() const { return style().borderEndWidth(); }116 virtual LayoutUnit borderTop() const { return style().borderTopWidth(); } 117 virtual LayoutUnit borderBottom() const { return style().borderBottomWidth(); } 118 virtual LayoutUnit borderLeft() const { return style().borderLeftWidth(); } 119 virtual LayoutUnit borderRight() const { return style().borderRightWidth(); } 120 virtual LayoutUnit borderBefore() const { return style().borderBeforeWidth(); } 121 virtual LayoutUnit borderAfter() const { return style().borderAfterWidth(); } 122 virtual LayoutUnit borderStart() const { return style().borderStartWidth(); } 123 virtual LayoutUnit borderEnd() const { return style().borderEndWidth(); } 124 124 125 125 LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingStart(); } -
trunk/Source/WebCore/rendering/RenderElement.cpp
r163079 r163171 1227 1227 LayoutUnit shadowRight; 1228 1228 style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight); 1229 int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;1229 int borderRight = isBox() ? toRenderBox(this)->borderRight() : LayoutUnit::fromPixel(0); 1230 1230 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit(); 1231 1231 LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width())); … … 1247 1247 LayoutUnit shadowBottom; 1248 1248 style().getBoxShadowVerticalExtent(shadowTop, shadowBottom); 1249 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;1249 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : LayoutUnit::fromPixel(0); 1250 1250 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit(); 1251 1251 LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min<LayoutUnit>(newBounds.height(), oldBounds.height())); -
trunk/Source/WebCore/rendering/RenderTable.cpp
r163165 r163171 1074 1074 } 1075 1075 1076 int RenderTable::borderBefore() const1076 LayoutUnit RenderTable::borderBefore() const 1077 1077 { 1078 1078 if (collapseBorders()) { … … 1083 1083 } 1084 1084 1085 int RenderTable::borderAfter() const1085 LayoutUnit RenderTable::borderAfter() const 1086 1086 { 1087 1087 if (collapseBorders()) { -
trunk/Source/WebCore/rendering/RenderTable.h
r162158 r163171 54 54 bool collapseBorders() const { return style().borderCollapse(); } 55 55 56 virtual int borderStart() const override { return m_borderStart; }57 virtual int borderEnd() const override { return m_borderEnd; }58 virtual int borderBefore() const override;59 virtual int borderAfter() const override;60 61 virtual int borderLeft() const override56 virtual LayoutUnit borderStart() const override { return m_borderStart; } 57 virtual LayoutUnit borderEnd() const override { return m_borderEnd; } 58 virtual LayoutUnit borderBefore() const override; 59 virtual LayoutUnit borderAfter() const override; 60 61 virtual LayoutUnit borderLeft() const override 62 62 { 63 63 if (style().isHorizontalWritingMode()) … … 66 66 } 67 67 68 virtual int borderRight() const override68 virtual LayoutUnit borderRight() const override 69 69 { 70 70 if (style().isHorizontalWritingMode()) … … 73 73 } 74 74 75 virtual int borderTop() const override75 virtual LayoutUnit borderTop() const override 76 76 { 77 77 if (style().isHorizontalWritingMode()) … … 80 80 } 81 81 82 virtual int borderBottom() const override82 virtual LayoutUnit borderBottom() const override 83 83 { 84 84 if (style().isHorizontalWritingMode()) -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r159856 r163171 931 931 } 932 932 933 int RenderTableCell::borderLeft() const934 { 935 return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlockFlow::borderLeft();936 } 937 938 int RenderTableCell::borderRight() const939 { 940 return table()->collapseBorders() ? borderHalfRight(false) : RenderBlockFlow::borderRight();941 } 942 943 int RenderTableCell::borderTop() const944 { 945 return table()->collapseBorders() ? borderHalfTop(false) : RenderBlockFlow::borderTop();946 } 947 948 int RenderTableCell::borderBottom() const949 { 950 return table()->collapseBorders() ? borderHalfBottom(false) : RenderBlockFlow::borderBottom();933 LayoutUnit RenderTableCell::borderLeft() const 934 { 935 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfLeft(false)) : RenderBlockFlow::borderLeft(); 936 } 937 938 LayoutUnit RenderTableCell::borderRight() const 939 { 940 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfRight(false)) : RenderBlockFlow::borderRight(); 941 } 942 943 LayoutUnit RenderTableCell::borderTop() const 944 { 945 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfTop(false)) : RenderBlockFlow::borderTop(); 946 } 947 948 LayoutUnit RenderTableCell::borderBottom() const 949 { 950 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfBottom(false)) : RenderBlockFlow::borderBottom(); 951 951 } 952 952 953 953 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=46191, make the collapsed border drawing 954 954 // work with different block flow values instead of being hard-coded to top-to-bottom. 955 int RenderTableCell::borderStart() const956 { 957 return table()->collapseBorders() ? borderHalfStart(false) : RenderBlockFlow::borderStart();958 } 959 960 int RenderTableCell::borderEnd() const961 { 962 return table()->collapseBorders() ? borderHalfEnd(false) : RenderBlockFlow::borderEnd();963 } 964 965 int RenderTableCell::borderBefore() const966 { 967 return table()->collapseBorders() ? borderHalfBefore(false) : RenderBlockFlow::borderBefore();968 } 969 970 int RenderTableCell::borderAfter() const971 { 972 return table()->collapseBorders() ? borderHalfAfter(false) : RenderBlockFlow::borderAfter();955 LayoutUnit RenderTableCell::borderStart() const 956 { 957 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfStart(false)) : RenderBlockFlow::borderStart(); 958 } 959 960 LayoutUnit RenderTableCell::borderEnd() const 961 { 962 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfEnd(false)) : RenderBlockFlow::borderEnd(); 963 } 964 965 LayoutUnit RenderTableCell::borderBefore() const 966 { 967 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfBefore(false)) : RenderBlockFlow::borderBefore(); 968 } 969 970 LayoutUnit RenderTableCell::borderAfter() const 971 { 972 return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfAfter(false)) : RenderBlockFlow::borderAfter(); 973 973 } 974 974 -
trunk/Source/WebCore/rendering/RenderTableCell.h
r162198 r163171 104 104 // Call computedCSSPadding* directly to avoid including implicitPadding. 105 105 if (!document().inQuirksMode() && style().boxSizing() != BORDER_BOX) 106 styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + borderBefore() + borderAfter();106 styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + (borderBefore() + borderAfter()).floor(); 107 107 return std::max(styleLogicalHeight, adjustedLogicalHeight); 108 108 } … … 111 111 void setCellLogicalWidth(int constrainedLogicalWidth); 112 112 113 virtual int borderLeft() const override;114 virtual int borderRight() const override;115 virtual int borderTop() const override;116 virtual int borderBottom() const override;117 virtual int borderStart() const override;118 virtual int borderEnd() const override;119 virtual int borderBefore() const override;120 virtual int borderAfter() const override;113 virtual LayoutUnit borderLeft() const override; 114 virtual LayoutUnit borderRight() const override; 115 virtual LayoutUnit borderTop() const override; 116 virtual LayoutUnit borderBottom() const override; 117 virtual LayoutUnit borderStart() const override; 118 virtual LayoutUnit borderEnd() const override; 119 virtual LayoutUnit borderBefore() const override; 120 virtual LayoutUnit borderAfter() const override; 121 121 122 122 void collectBorderValues(RenderTable::CollapsedBorderValues&) const;
Note: See TracChangeset
for help on using the changeset viewer.