Skip to content

Commit

Permalink
Inline RenderBoxModelObject::computedCSSPadding()
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267120
rdar://120510598

Reviewed by Wenson Hsieh and Tim Nguyen.

RenderBoxModelObject::computedCSSPadding() is fairly hot on some traces, and not
inlined because it was needlessly marked as WEBCORE_EXPORT, so inline it.

* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computedCSSPadding const): Deleted.
* Source/WebCore/rendering/RenderBoxModelObject.h:
* Source/WebCore/rendering/RenderBoxModelObjectInlines.h:
(WebCore::RenderBoxModelObject::computedCSSPadding const):

Canonical link: https://commits.webkit.org/272695@main
  • Loading branch information
smfr committed Jan 5, 2024
1 parent d579532 commit 473160f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 0 additions & 8 deletions Source/WebCore/rendering/RenderBoxModelObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,14 +650,6 @@ LayoutUnit RenderBoxModelObject::offsetTop() const
return adjustedPositionRelativeToOffsetParent(LayoutPoint()).y();
}

LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
{
LayoutUnit w;
if (padding.isPercentOrCalculated())
w = containingBlockLogicalWidthForContent();
return minimumValueForLength(padding, w);
}

InterpolationQuality RenderBoxModelObject::chooseInterpolationQuality(GraphicsContext& context, Image& image, const void* layer, const LayoutSize& size) const
{
return view().imageQualityController().chooseInterpolationQuality(context, const_cast<RenderBoxModelObject*>(this), image, layer, size);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/RenderBoxModelObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class RenderBoxModelObject : public RenderLayerModelObject {
ContinuationChainNode* continuationChainNode() const;

protected:
WEBCORE_EXPORT LayoutUnit computedCSSPadding(const Length&) const;
LayoutUnit computedCSSPadding(const Length&) const;
virtual void absoluteQuadsIgnoringContinuation(const FloatRect&, Vector<FloatQuad>&, bool* /*wasFixed*/) const { ASSERT_NOT_REACHED(); }
void collectAbsoluteQuadsForContinuation(Vector<FloatQuad>& quads, bool* wasFixed) const;

Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/rendering/RenderBoxModelObjectInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,12 @@ inline LayoutSize RenderBoxModelObject::stickyPositionLogicalOffset() const { re
inline LayoutUnit RenderBoxModelObject::verticalBorderAndPaddingExtent() const { return borderTop() + borderBottom() + paddingTop() + paddingBottom(); }
inline LayoutUnit RenderBoxModelObject::verticalBorderExtent() const { return borderTop() + borderBottom(); }

inline LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
{
LayoutUnit containerWidth;
if (padding.isPercentOrCalculated())
containerWidth = containingBlockLogicalWidthForContent();
return minimumValueForLength(padding, containerWidth);
}

} // namespace WebCore

0 comments on commit 473160f

Please sign in to comment.