Summary: | Avoid calling logicalLeftOffsetForLine 2 times in LineWidth::fitBelowFloats | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Zoltan Horvath <zoltan> | ||||||
Component: | CSS | Assignee: | Zoltan Horvath <zoltan> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, esprehn+autocc, glenn, kondapallykalyan | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Zoltan Horvath
2014-02-27 09:39:37 PST
Created attachment 225384 [details]
Patch
Comment on attachment 225384 [details] Patch 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&". Created attachment 225413 [details] Patch > Doesn’t seem good to repeat the function twice. Can we make the old function call the new one? Good point. I changed it. > Argument types here should just be float. No reason to pass "const float&". I modified to use float. Thanks for the review! Comment on attachment 225413 [details] Patch Clearing flags on attachment: 225413 Committed r164834: <http://trac.webkit.org/changeset/164834> All reviewed patches have been landed. Closing bug. |