Bug 98452 - Font::glyphDataAndPageForCharacter doesn't account for text orientation when using systemFallback on a cold cache.
Summary: Font::glyphDataAndPageForCharacter doesn't account for text orientation when ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-04 14:06 PDT by Enrica Casucci
Modified: 2012-10-08 10:31 PDT (History)
4 users (show)

See Also:


Attachments
Test case (320 bytes, text/html)
2012-10-04 14:07 PDT, Enrica Casucci
no flags Details
Patch (13.72 KB, patch)
2012-10-04 16:26 PDT, Enrica Casucci
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2012-10-04 14:06:26 PDT
The text orientation is taken into account only when the glyph is already in the cache.
Use the attached test case to reproduce this problem, launching it from a new instance of Safari.
The line break occurs in the wrong place and you'll see the difference where reloading the page.
Comment 1 Enrica Casucci 2012-10-04 14:07:29 PDT
Created attachment 167170 [details]
Test case
Comment 2 Enrica Casucci 2012-10-04 16:26:27 PDT
Created attachment 167197 [details]
Patch
Comment 3 mitz 2012-10-04 17:02:49 PDT
Comment on attachment 167197 [details]
Patch

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

> Source/WebCore/platform/graphics/FontFastPath.cpp:50
> +static inline std::pair<GlyphData, GlyphPage*> applyTextOrientationForCharacter(UChar32 c, GlyphData& data, GlyphPage* page, unsigned pageNumber, TextOrientation orientation)

Please rename “c” to “character”. The verb “apply” doesn’t fit a function that doesn’t mutate anything. How about glyphDataAndPageForCharacterWithTextOrientation(…), perhaps also moving the TextOrientation parameter to the second spot?
Comment 4 Enrica Casucci 2012-10-04 18:33:20 PDT
(In reply to comment #3)
> (From update of attachment 167197 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=167197&action=review
> 
> > Source/WebCore/platform/graphics/FontFastPath.cpp:50
> > +static inline std::pair<GlyphData, GlyphPage*> applyTextOrientationForCharacter(UChar32 c, GlyphData& data, GlyphPage* page, unsigned pageNumber, TextOrientation orientation)
> 
> Please rename “c” to “character”. The verb “apply” doesn’t fit a function that doesn’t mutate anything. How about glyphDataAndPageForCharacterWithTextOrientation(…), perhaps also moving the TextOrientation parameter to the second spot?
That was the first name I came up with, but then I thought it was too long.
I should have followed my instincts :-)
thanks for the review, will do as you suggested.
Comment 5 Enrica Casucci 2012-10-04 19:03:34 PDT
Committed revision 130443.