RESOLVED FIXED 28024
Need AtomicStrings for the various font family names
https://bugs.webkit.org/show_bug.cgi?id=28024
Summary Need AtomicStrings for the various font family names
Eric Seidel (no email)
Reported 2009-08-05 12:18:09 PDT
Need AtomicStrings for the various font family names In: static int identifierForFamily(const AtomicString& family) { DEFINE_STATIC_LOCAL(AtomicString, cursiveFamily, ("-webkit-cursive")); DEFINE_STATIC_LOCAL(AtomicString, fantasyFamily, ("-webkit-fantasy")); DEFINE_STATIC_LOCAL(AtomicString, monospaceFamily, ("-webkit-monospace")); DEFINE_STATIC_LOCAL(AtomicString, sansSerifFamily, ("-webkit-sans-serif")); DEFINE_STATIC_LOCAL(AtomicString, serifFamily, ("-webkit-serif")); we use static locals. A bunch of other places we just use c-string constants: void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule) static FontData* fontDataForGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName) void CSSStyleSelector::applyProperty(int id, CSSValue *value) This is error-prone and slower than necessary. Should be easy to fix with a little .in file wired up through make_names.pl in DerivedSources.make. Also need to make sure that Page() calls FontFamilyNames::init().
Attachments
proposed patch (30.81 KB, patch)
2011-06-14 23:33 PDT, Andras Becsi
no flags
updated patch (removed debug variables from perl script) (30.73 KB, patch)
2011-06-15 01:07 PDT, Andras Becsi
no flags
proposed patch v2 (33.76 KB, patch)
2011-06-20 09:34 PDT, Andras Becsi
no flags
updated patch (35.35 KB, patch)
2011-08-16 05:18 PDT, Andras Becsi
no flags
Eric Seidel (no email)
Comment 1 2009-08-05 12:58:32 PDT
Turns out that the various Names::init() calls are made from Frame(...), I'm surprised by this. It's probably "wrong" in that we could have a Page which wanted to use the various Names* calls before the first Frame was created... but oh well.
Andras Becsi
Comment 2 2011-06-14 23:33:09 PDT
Created attachment 97237 [details] proposed patch
Andras Becsi
Comment 3 2011-06-15 01:07:00 PDT
Created attachment 97249 [details] updated patch (removed debug variables from perl script)
Eric Seidel (no email)
Comment 4 2011-06-15 08:45:03 PDT
Comment on attachment 97249 [details] updated patch (removed debug variables from perl script) View in context: https://bugs.webkit.org/attachment.cgi?id=97249&action=review > Source/WebCore/dom/make_names.pl:90 > +if (length($fontNamesIn)) { > + my $names = new IO::File; > + my $familyNamesFileBase = "WebKitFontFamilyNames"; Why are we forking all this perl code here? Can't we share with the other names generation?
Andras Becsi
Comment 5 2011-06-20 09:34:36 PDT
Created attachment 97811 [details] proposed patch v2
Andras Becsi
Comment 6 2011-06-20 09:44:45 PDT
(In reply to comment #4) > (From update of attachment 97249 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=97249&action=review > > > Source/WebCore/dom/make_names.pl:90 > > +if (length($fontNamesIn)) { > > + my $names = new IO::File; > > + my $familyNamesFileBase = "WebKitFontFamilyNames"; > > Why are we forking all this perl code here? Can't we share with the other names generation? The common parts appeared to be not that many to be worth obfuscating the understandability of the patch, but I tried now to restructure the common parts of the generation routines into separate functions. Eric, could you take another look?
Andras Becsi
Comment 7 2011-08-16 05:18:46 PDT
Created attachment 104026 [details] updated patch
Csaba Osztrogonác
Comment 8 2011-08-16 06:46:45 PDT
Comment on attachment 104026 [details] updated patch r=me
Andras Becsi
Comment 9 2011-08-16 07:26:38 PDT
Comment on attachment 104026 [details] updated patch Clearing flags on attachment: 104026 Committed r93097: <http://trac.webkit.org/changeset/93097>
Andras Becsi
Comment 10 2011-08-16 07:26:46 PDT
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 11 2013-09-13 13:10:03 PDT
Comment on attachment 104026 [details] updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=104026&action=review > Source/WebCore/CodeGenerators.pri:772 > +entities.depends = $$PWD/dom/make_names.pl $$FONT_NAMES This has entities.depends, not fontnames.depends. Is that intended?
Note You need to log in before you can comment on or make changes to this bug.