Bug 78698 - Simplify CSSParser::parseFont.
Summary: Simplify CSSParser::parseFont.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexis Menard (darktears)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-15 04:58 PST by Alexis Menard (darktears)
Modified: 2012-04-23 07:27 PDT (History)
11 users (show)

See Also:


Attachments
Patch (16.11 KB, patch)
2012-02-15 05:01 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (17.29 KB, patch)
2012-02-15 05:51 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (19.21 KB, patch)
2012-02-15 09:29 PST, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (19.23 KB, patch)
2012-04-10 05:06 PDT, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (22.77 KB, patch)
2012-04-20 14:51 PDT, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Menard (darktears) 2012-02-15 04:58:51 PST
Simplify CSSParser::parseFont.
Comment 1 Alexis Menard (darktears) 2012-02-15 05:01:40 PST
Created attachment 127166 [details]
Patch
Comment 2 Alexis Menard (darktears) 2012-02-15 05:51:22 PST
Created attachment 127169 [details]
Patch
Comment 3 WebKit Review Bot 2012-02-15 06:56:11 PST
Comment on attachment 127169 [details]
Patch

Attachment 127169 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11515784

New failing tests:
fast/inspector-support/style.html
fast/parser/style-script-head-test.html
Comment 4 Alexis Menard (darktears) 2012-02-15 09:29:04 PST
Created attachment 127190 [details]
Patch
Comment 5 WebKit Review Bot 2012-02-15 09:30:15 PST
Attachment 127190 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/update-webkit']" exit_code: 2

Updating OpenSource
git.webkit.org[0: 17.254.20.231]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
Died at Tools/Scripts/update-webkit line 162.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Alexis Menard (darktears) 2012-04-10 05:06:03 PDT
Created attachment 136429 [details]
Patch

Rebased version
Comment 7 Antti Koivisto 2012-04-19 16:49:00 PDT
Comment on attachment 136429 [details]
Patch

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

> Source/WebCore/css/CSSParser.cpp:4314
> +        if (!fontStyleParsed && parseValue(CSSPropertyFontStyle, important))
> +            fontStyleParsed = true;

I think we should avoid calling to generic parseValue() from parseFont(). We already know what property this is so jumping through the huge switch seems like wasted work.

Perhaps we could refactor this so that both parseValue and this can use the same helper functions.

> Source/WebCore/css/CSSParser.cpp:-4594
> -    if (m_valueList->size() != 1)
> -        return false;

Only shorthand properties can have list longer than 1, right?  You could assert for that.
Comment 8 Alexis Menard (darktears) 2012-04-20 14:51:25 PDT
Created attachment 138169 [details]
Patch
Comment 9 Alexis Menard (darktears) 2012-04-20 14:53:03 PDT
(In reply to comment #7)
> (From update of attachment 136429 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=136429&action=review
> 
> > Source/WebCore/css/CSSParser.cpp:4314
> > +        if (!fontStyleParsed && parseValue(CSSPropertyFontStyle, important))
> > +            fontStyleParsed = true;
> 
> I think we should avoid calling to generic parseValue() from parseFont(). We already know what property this is so jumping through the huge switch seems like wasted work.

Fixed in the new version.

> 
> Perhaps we could refactor this so that both parseValue and this can use the same helper functions.
> 
> > Source/WebCore/css/CSSParser.cpp:-4594
> > -    if (m_valueList->size() != 1)
> > -        return false;
> 
> Only shorthand properties can have list longer than 1, right?  You could assert for that.

As discussed we don't really want to ASSERT in case of an invalid property, we just want to skip it.
Comment 10 Antti Koivisto 2012-04-23 06:44:00 PDT
Comment on attachment 138169 [details]
Patch

r=me
Comment 11 WebKit Review Bot 2012-04-23 07:27:12 PDT
Comment on attachment 138169 [details]
Patch

Clearing flags on attachment: 138169

Committed r114895: <http://trac.webkit.org/changeset/114895>
Comment 12 WebKit Review Bot 2012-04-23 07:27:18 PDT
All reviewed patches have been landed.  Closing bug.