WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
129433
Avoid calling logicalLeftOffsetForLine 2 times in LineWidth::fitBelowFloats
https://bugs.webkit.org/show_bug.cgi?id=129433
Summary
Avoid calling logicalLeftOffsetForLine 2 times in LineWidth::fitBelowFloats
Zoltan Horvath
Reported
2014-02-27 09:39:37 PST
This change updates fitBelowFloats and its helpers to call RenderBlock::logicalLeftOffsetForLine only once.
Attachments
Patch
(5.45 KB, patch)
2014-02-27 09:42 PST
,
Zoltan Horvath
darin
: review+
darin
: commit-queue-
Details
Formatted Diff
Diff
Patch
(6.13 KB, patch)
2014-02-27 14:41 PST
,
Zoltan Horvath
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Zoltan Horvath
Comment 1
2014-02-27 09:42:28 PST
Created
attachment 225384
[details]
Patch
Darin Adler
Comment 2
2014-02-27 12:17:17 PST
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&".
Zoltan Horvath
Comment 3
2014-02-27 14:41:04 PST
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!
WebKit Commit Bot
Comment 4
2014-02-27 15:18:33 PST
Comment on
attachment 225413
[details]
Patch Clearing flags on attachment: 225413 Committed
r164834
: <
http://trac.webkit.org/changeset/164834
>
WebKit Commit Bot
Comment 5
2014-02-27 15:18:35 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug