Bug 161695

Summary: Add CSSAtRule id info for new parser
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: CSSAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 46591    
Attachments:
Description Flags
Patch sam: review+

Description Dave Hyatt 2016-09-07 09:39:42 PDT
Add CSSAtRule id info for new parser
Comment 1 Dave Hyatt 2016-09-07 09:41:15 PDT
Created attachment 288149 [details]
Patch
Comment 2 Sam Weinig 2016-09-07 09:53:14 PDT
Comment on attachment 288149 [details]
Patch

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

> Source/WebCore/css/parser/CSSAtRuleID.h:31
> +#ifndef CSSAtRuleID_h
> +#define CSSAtRuleID_h

You can replace this with #pragma once

> Source/WebCore/css/parser/CSSAtRuleID.h:33
> +#include <wtf/text/StringView.h>

This can be replaced with <wtf/Forward.h>

> Source/WebCore/css/parser/CSSAtRuleID.h:54
> +enum CSSAtRuleID {
> +    CSSAtRuleInvalid = 0,
> +
> +    CSSAtRuleCharset = 1,
> +    CSSAtRuleFontFace = 2,
> +    CSSAtRuleImport = 3,
> +    CSSAtRuleKeyframes = 4,
> +    CSSAtRuleMedia = 5,
> +    CSSAtRuleNamespace = 6,
> +    CSSAtRulePage = 7,
> +    CSSAtRuleSupports = 8,
> +    CSSAtRuleViewport = 9,
> +
> +    CSSAtRuleWebkitKeyframes = 10,
> +    CSSAtRuleApply = 11,
> +};
> +
> +CSSAtRuleID cssAtRuleID(StringView name);

We don't really have a style rule on this, but you could use enum class here to make this something like:

enum class CSSAtRule {
    Invalid ,
    Charset,
   ...
};

Up to you.
Comment 3 Dave Hyatt 2016-09-07 09:56:39 PDT
Landed in r205550.