Bug 89892 - Compilation failure in StyleResolver.cpp (clang)
Summary: Compilation failure in StyleResolver.cpp (clang)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mike West
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-25 10:24 PDT by Mike West
Modified: 2012-07-16 00:11 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.14 KB, patch)
2012-06-25 10:31 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (2.33 KB, patch)
2012-06-25 11:03 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (2.32 KB, patch)
2012-06-25 11:07 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (2.34 KB, patch)
2012-06-25 11:27 PDT, Mike West
no flags Details | Formatted Diff | Diff
Patch (3.21 KB, patch)
2012-06-25 19:09 PDT, Luke Macpherson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike West 2012-06-25 10:24:57 PDT
Currently, compilation via ninja/clang is throwing errors in StyleResolver and CSSParser like the following:

../../third_party/WebKit/Source/WebCore/css/StyleResolver.cpp:3392:13: error: enumeration value 'CSSPropertyVariable' not handled in switch [-Werror,-Wswitch]
    switch (id) {
Comment 1 Mike West 2012-06-25 10:31:03 PDT
Created attachment 149317 [details]
Patch
Comment 2 Alexis Menard (darktears) 2012-06-25 10:53:15 PDT
Comment on attachment 149317 [details]
Patch

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

> Source/WebCore/css/CSSParser.cpp:2634
> +#endif

It is misleading to put it there as per comment above : 

// These properties should be handled before in isValidKeywordPropertyAndValue().

And CSSPropertyVariable is not handled there. So it will ASSERT which is incorrect.

You better make a case somewhere else, and return false, add a FIXME : Implement me.

> Source/WebCore/css/StyleResolver.cpp:4281
> +#endif

Ditto there. Incorrect.
Comment 3 Mike West 2012-06-25 10:57:01 PDT
(In reply to comment #2)
> (From update of attachment 149317 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=149317&action=review
> 
> > Source/WebCore/css/CSSParser.cpp:2634
> > +#endif
> 
> It is misleading to put it there as per comment above : 
> 
> // These properties should be handled before in isValidKeywordPropertyAndValue().
> 
> And CSSPropertyVariable is not handled there. So it will ASSERT which is incorrect.
> 
> You better make a case somewhere else, and return false, add a FIXME : Implement me.

Thanks for the review. I figured that ASSERTing was better than just returning false (since I have no idea what the correct behavior is), but I'll add the additional case and track down the original author for implementation details.
Comment 4 Mike West 2012-06-25 11:03:09 PDT
Created attachment 149324 [details]
Patch
Comment 5 Mike West 2012-06-25 11:04:50 PDT
New patch; macpherson@chromium.org looks like the original author, and is on CC.
Comment 6 Mike West 2012-06-25 11:05:42 PDT
Comment on attachment 149324 [details]
Patch

Ignore this, it fails.
Comment 7 Mike West 2012-06-25 11:07:59 PDT
Created attachment 149325 [details]
Patch
Comment 8 Alexis Menard (darktears) 2012-06-25 11:25:13 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 149317 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=149317&action=review
> > 
> > > Source/WebCore/css/CSSParser.cpp:2634
> > > +#endif
> > 
> > It is misleading to put it there as per comment above : 
> > 
> > // These properties should be handled before in isValidKeywordPropertyAndValue().
> > 
> > And CSSPropertyVariable is not handled there. So it will ASSERT which is incorrect.
> > 
> > You better make a case somewhere else, and return false, add a FIXME : Implement me.
> 
> Thanks for the review. I figured that ASSERTing was better than just returning false (since I have no idea what the correct behavior is), but I'll add the additional case and track down the original author for implementation details.

Well ASSERTing is a bit rude. It if returns false then the CSS declaration will be dropped but at least I can continue using the browser :).
Comment 9 Mike West 2012-06-25 11:27:25 PDT
Created attachment 149333 [details]
Patch
Comment 10 Mike West 2012-06-25 11:28:40 PDT
(In reply to comment #9)
> Created an attachment (id=149333) [details]
> Patch

New patch moves the `case` up above the "all the rest + svg" block.
Comment 11 WebKit Review Bot 2012-06-25 16:16:01 PDT
Comment on attachment 149333 [details]
Patch

Clearing flags on attachment: 149333

Committed r121192: <http://trac.webkit.org/changeset/121192>
Comment 12 WebKit Review Bot 2012-06-25 16:16:16 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Luke Macpherson 2012-06-25 18:13:51 PDT
Weird that these showed up in clang but not my regular variables build. In both cases this code should be unreachable. Thanks for the fixes.
Comment 14 Mike West 2012-06-25 18:18:08 PDT
(In reply to comment #13)
> Weird that these showed up in clang but not my regular variables build. In both cases this code should be unreachable. Thanks for the fixes.

If it really is unreachable, can you throw up a patch to trigger the ASSERT (basically the first patch on this bug, I suppose)? I wasn't sure what the behavior should be, and Alexis suggested that special-casing it was appropriate.

If we don't need that case, we can just fold it into the big block o' case statements. :)
Comment 15 Luke Macpherson 2012-06-25 19:09:17 PDT
Reopening to attach new patch.
Comment 16 Luke Macpherson 2012-06-25 19:09:23 PDT
Created attachment 149426 [details]
Patch
Comment 17 Luke Macpherson 2012-06-25 19:18:01 PDT
I also ran tests locally with CSS_VARIABLES enabled to make sure the code really is unreachable.
Comment 18 Luke Macpherson 2012-07-03 17:23:45 PDT
Ping for r+?
Comment 19 Ryosuke Niwa 2012-07-13 15:18:34 PDT
Comment on attachment 149426 [details]
Patch

ok.
Comment 20 WebKit Review Bot 2012-07-16 00:11:17 PDT
Comment on attachment 149426 [details]
Patch

Clearing flags on attachment: 149426

Committed r122700: <http://trac.webkit.org/changeset/122700>
Comment 21 WebKit Review Bot 2012-07-16 00:11:22 PDT
All reviewed patches have been landed.  Closing bug.