Bug 135285

Summary: There are unnecessary condition check on FontGlyphs.cpp
Product: WebKit Reporter: byeongha.cho
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Minor CC: commit-queue, mmaxfield
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description byeongha.cho 2014-07-25 02:13:13 PDT
There are condition check for characterFontData followed by same condition check for characterFontData in the FontGlyphs::glyphDataAndPageForCharacter().

I think this is not necessary.
Comment 1 byeongha.cho 2014-07-25 04:45:54 PDT
Created attachment 235507 [details]
Patch
Comment 2 Myles C. Maxfield 2014-07-25 08:29:48 PDT
Comment on attachment 235507 [details]
Patch

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

> Source/WebCore/platform/graphics/FontGlyphs.cpp:389
>              characterFontData = characterFontData->variantFontData(description, variant);

This function might return nullptr.
Comment 3 Myles C. Maxfield 2014-07-25 08:30:02 PDT
I'm not a reviewer but I would r- this.
Comment 4 byeongha.cho 2014-07-27 07:23:23 PDT
Yes, I agree that variantFontData() could rarely return nullptr.
So I close this issue.
Comment 5 byeongha.cho 2014-07-27 07:40:38 PDT
Thank you for reviewing.
Comment 6 Darin Adler 2014-07-27 23:28:49 PDT
Comment on attachment 235507 [details]
Patch

As Myles says, this patch is only correct if variantFontData never returns null.

Did you prove that variantFontData will never return null?