Bug 67728

Summary: Refactor hyphen measurement
Product: WebKit Reporter: Ned Holbrook <ned>
Component: TextAssignee: Nobody <webkit-unassigned>
Severity: Enhancement CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Proposed changes.
darin: review+
Changes per review. none

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.