[Webkit-unassigned] [Bug 81332] Cache support for OpenTypeVerticalData

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 17 20:29:45 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81332





--- Comment #9 from Koji Ishii <kojiishi at gmail.com>  2012-04-17 20:29:45 PST ---
(From update of attachment 135005)
View in context: https://bugs.webkit.org/attachment.cgi?id=135005&action=review

>>>> Source/WebCore/platform/graphics/FontCache.cpp:195
>>>> +        return getCachedFontPlatformData(fontDescription, AtomicString(familyName.impl()->substring(1)), checkingAlternateName);
>>> 
>>> I recommend removing all "@"s in the front name before to avoid unnecessary recursion.
>> 
>> While I agree with you as a general comment, in this specific case, family name having two or more leading '@' is very unlikely. If that assumption stands, I suppose this code runs more efficient than removing all leading '@' before the call. I can't do it without adding cycles on single case, can I, or do you think I'm assuming too much?
> 
> I concerned malicious inputs like "@@@.......". If my understanding is correct, familyName comes from user input. Does the spec (or implementation) limit the length of font name?

You're correct and we need to work either way. The point I'm making is which scenario we want our code optimized for. The current code runs better on single case and worse on more. Your proposal make the code better for multiple case by adding slightly additional code on single case. I think we shouldn't try to run fast or efficiently against malicious input, especially if doing so adds cost to the normal code path. I agree that we shouldn't crash though. Is this agreeable?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list