Changeset 269835 in webkit
- Timestamp:
- Nov 15, 2020 5:15:09 PM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269833 r269835 1 2020-11-15 Simon Fraser <simon.fraser@apple.com> 2 3 Minor RenderStyle boxShadow cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=218952 5 6 Reviewed by Sam Weinig. 7 8 Rename getBoxShadowExtent() to boxShadowExtent() and have it return a LayoutBoxExtent. 9 10 Make shadow-related functions static that can be, and private that can be. 11 12 * rendering/RenderBox.cpp: 13 (WebCore::RenderBox::applyVisualEffectOverflow const): 14 * rendering/RenderElement.cpp: 15 (WebCore::RenderElement::repaintAfterLayoutIfNeeded): 16 * rendering/style/RenderStyle.cpp: 17 (WebCore::RenderStyle::shadowExtent): 18 (WebCore::RenderStyle::shadowInsetExtent): 19 (WebCore::RenderStyle::getShadowHorizontalExtent): 20 (WebCore::RenderStyle::getShadowVerticalExtent): 21 (WebCore::RenderStyle::getShadowExtent const): Deleted. 22 (WebCore::RenderStyle::getShadowInsetExtent const): Deleted. 23 (WebCore::RenderStyle::getShadowHorizontalExtent const): Deleted. 24 (WebCore::RenderStyle::getShadowVerticalExtent const): Deleted. 25 * rendering/style/RenderStyle.h: 26 (WebCore::RenderStyle::boxShadowExtent const): 27 (WebCore::RenderStyle::boxShadowInsetExtent const): 28 (WebCore::RenderStyle::getBoxShadowExtent const): Deleted. 29 (WebCore::RenderStyle::getBoxShadowInsetExtent const): Deleted. 30 1 31 2020-11-15 Andres Gonzalez <andresg_22@apple.com> 2 32 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r269728 r269835 4614 4614 // Compute box-shadow overflow first. 4615 4615 if (style().boxShadow()) { 4616 LayoutUnit shadowLeft; 4617 LayoutUnit shadowRight; 4618 LayoutUnit shadowTop; 4619 LayoutUnit shadowBottom; 4620 style().getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 4616 auto shadowExtent = style().boxShadowExtent(); 4621 4617 4622 4618 // In flipped blocks writing modes such as vertical-rl, the physical right shadow value is actually at the lower x-coordinate. 4623 overflowMinX = borderBox.x() + ((!isFlipped || isHorizontal) ? shadow Left : -shadowRight);4624 overflowMaxX = borderBox.maxX() + ((!isFlipped || isHorizontal) ? shadow Right : -shadowLeft);4625 overflowMinY = borderBox.y() + ((!isFlipped || !isHorizontal) ? shadow Top : -shadowBottom);4626 overflowMaxY = borderBox.maxY() + ((!isFlipped || !isHorizontal) ? shadow Bottom : -shadowTop);4619 overflowMinX = borderBox.x() + ((!isFlipped || isHorizontal) ? shadowExtent.left() : -shadowExtent.right()); 4620 overflowMaxX = borderBox.maxX() + ((!isFlipped || isHorizontal) ? shadowExtent.right() : -shadowExtent.left()); 4621 overflowMinY = borderBox.y() + ((!isFlipped || !isHorizontal) ? shadowExtent.top() : -shadowExtent.bottom()); 4622 overflowMaxY = borderBox.maxY() + ((!isFlipped || !isHorizontal) ? shadowExtent.bottom() : -shadowExtent.top()); 4627 4623 } 4628 4624 4629 4625 // Now compute border-image-outset overflow. 4630 4626 if (style().hasBorderImageOutsets()) { 4631 LayoutBoxExtentborderOutsets = style().borderImageOutsets();4627 auto borderOutsets = style().borderImageOutsets(); 4632 4628 4633 4629 // In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right -
trunk/Source/WebCore/rendering/RenderElement.cpp
r269228 r269835 1235 1235 const RenderStyle& outlineStyle = outlineStyleForRepaint(); 1236 1236 LayoutUnit outlineWidth { outlineStyle.outlineSize() }; 1237 LayoutBoxExtent insetShadowExtent = style().getBoxShadowInsetExtent();1237 auto insetShadowExtent = style().boxShadowInsetExtent(); 1238 1238 LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width()); 1239 1239 if (width) { -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r269144 r269835 1920 1920 } 1921 1921 1922 void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const 1923 { 1924 top = 0;1925 right = 0;1926 bottom = 0;1927 left = 0;1922 LayoutBoxExtent RenderStyle::shadowExtent(const ShadowData* shadow) 1923 { 1924 LayoutUnit top; 1925 LayoutUnit right; 1926 LayoutUnit bottom; 1927 LayoutUnit left; 1928 1928 1929 1929 for ( ; shadow; shadow = shadow->next()) { … … 1937 1937 left = std::min<LayoutUnit>(left, shadow->x() - extentAndSpread); 1938 1938 } 1939 } 1940 1941 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowData* shadow) const 1939 1940 return { top, right, bottom, left }; 1941 } 1942 1943 LayoutBoxExtent RenderStyle::shadowInsetExtent(const ShadowData* shadow) 1942 1944 { 1943 1945 LayoutUnit top; … … 1957 1959 } 1958 1960 1959 return LayoutBoxExtent(WTFMove(top), WTFMove(right), WTFMove(bottom), WTFMove(left));1960 } 1961 1962 void RenderStyle::getShadowHorizontalExtent(const ShadowData* shadow, LayoutUnit &left, LayoutUnit &right) const1961 return { top, right, bottom, left }; 1962 } 1963 1964 void RenderStyle::getShadowHorizontalExtent(const ShadowData* shadow, LayoutUnit &left, LayoutUnit &right) 1963 1965 { 1964 1966 left = 0; … … 1975 1977 } 1976 1978 1977 void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, LayoutUnit &top, LayoutUnit &bottom) const1979 void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, LayoutUnit &top, LayoutUnit &bottom) 1978 1980 { 1979 1981 top = 0; -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r269820 r269835 564 564 565 565 const ShadowData* boxShadow() const { return m_rareNonInheritedData->boxShadow.get(); } 566 void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }567 LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }566 LayoutBoxExtent boxShadowExtent() const { return shadowExtent(boxShadow()); } 567 LayoutBoxExtent boxShadowInsetExtent() const { return shadowInsetExtent(boxShadow()); } 568 568 void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); } 569 569 void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); } … … 1778 1778 1779 1779 void inheritUnicodeBidiFrom(const RenderStyle* parent) { m_nonInheritedFlags.unicodeBidi = parent->m_nonInheritedFlags.unicodeBidi; } 1780 void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const; 1781 void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right) const; 1782 void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom) const; 1780 1783 1781 void getShadowInlineDirectionExtent(const ShadowData*, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const; 1784 1782 void getShadowBlockDirectionExtent(const ShadowData*, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const; … … 1913 1911 void setContent(std::unique_ptr<ContentData>, bool add); 1914 1912 1915 LayoutBoxExtent getShadowInsetExtent(const ShadowData*) const;1916 1917 1913 static bool isDisplayReplacedType(DisplayType); 1918 1914 static bool isDisplayInlineType(DisplayType); … … 1920 1916 static bool isDisplayGridBox(DisplayType); 1921 1917 static bool isDisplayFlexibleOrGridBox(DisplayType); 1918 1919 static LayoutBoxExtent shadowExtent(const ShadowData*); 1920 static LayoutBoxExtent shadowInsetExtent(const ShadowData*); 1921 static void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right); 1922 static void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom); 1922 1923 1923 1924 Color colorResolvingCurrentColor(CSSPropertyID colorProperty, bool visitedLink) const;
Note: See TracChangeset
for help on using the changeset viewer.