Bug 67728 - Refactor hyphen measurement
Summary: Refactor hyphen measurement
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
Depends on:
Reported: 2011-09-07 12:58 PDT by Ned Holbrook
Modified: 2011-09-08 12:17 PDT (History)
1 user (show)

See Also:

Proposed changes. (3.50 KB, patch)
2011-09-07 13:00 PDT, Ned Holbrook
darin: review+
Details | Formatted Diff | Diff
Changes per review. (3.45 KB, patch)
2011-09-07 15:33 PDT, Ned Holbrook
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ned Holbrook 2011-09-07 12:58:13 PDT
It would be nice to avoid duplicated code in RenderBlockLineLayout.cpp by adding a helper function to measure the hyphen string.
Comment 1 Ned Holbrook 2011-09-07 13:00:19 PDT
Created attachment 106623 [details]
Proposed changes.
Comment 2 Darin Adler 2011-09-07 14:02:14 PDT
Comment on attachment 106623 [details]
Proposed changes.

View in context: https://bugs.webkit.org/attachment.cgi?id=106623&action=review

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:485
> +    RenderStyle* style = renderer->style();
> +    const AtomicString& hyphenString = style->hyphenString();
> +    return font.width(RenderBlock::constructTextRun(renderer, font, hyphenString.string(), style));

Not sure these local variables help make this more readable.
Comment 3 Ned Holbrook 2011-09-07 15:33:38 PDT
Created attachment 106660 [details]
Changes per review.

How about we split the difference so as to avoid doubly dereferencing |renderer|?
Comment 4 WebKit Review Bot 2011-09-08 12:17:49 PDT
Comment on attachment 106660 [details]
Changes per review.

Clearing flags on attachment: 106660

Committed r94778: <http://trac.webkit.org/changeset/94778>
Comment 5 WebKit Review Bot 2011-09-08 12:17:53 PDT
All reviewed patches have been landed.  Closing bug.