[webkit-reviews] review granted: [Bug 129433] Avoid calling logicalLeftOffsetForLine 2 times in LineWidth::fitBelowFloats : [Attachment 225384] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 27 12:20:11 PST 2014


Darin Adler <darin at apple.com> has granted Zoltan Horvath <zoltan at webkit.org>'s
request for review:
Bug 129433: Avoid calling logicalLeftOffsetForLine 2 times in
LineWidth::fitBelowFloats
https://bugs.webkit.org/show_bug.cgi?id=129433

Attachment 225384: Patch
https://bugs.webkit.org/attachment.cgi?id=225384&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=225384&action=review


> Source/WebCore/rendering/line/LineWidth.cpp:168
> +inline static float availableWidthAtOffset(const RenderBlockFlow& block,
const LayoutUnit& offset, bool shouldIndentText, float& newLineLeft, float&
newLineRight)
> +{
> +    newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText);
> +    newLineRight = block.logicalRightOffsetForLine(offset,
shouldIndentText);
> +    return std::max(0.0f, newLineRight - newLineLeft);
> +}
> +
>  inline static float availableWidthAtOffset(const RenderBlock& block, const
LayoutUnit& offset, bool shouldIndentText)

Doesn’t seem good to repeat the function twice. Can we make the old function
call the new one?

> Source/WebCore/rendering/line/LineWidth.cpp:175
> +void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit
newLineWidth, const float& newLineLeft, const float& newLineRight)

Argument types here should just be float. No reason to pass "const float&".

> Source/WebCore/rendering/line/LineWidth.h:79
> +    void updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth,
const float& newLineLeft, const float& newLineRight);

Argument types here should just be float. No reason to pass "const float&".


More information about the webkit-reviews mailing list