Bug 164075 - [CSS Parser] Implement CSS variables
Summary: [CSS Parser] Implement CSS variables
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-27 13:40 PDT by Dave Hyatt
Modified: 2016-10-27 15:08 PDT (History)
1 user (show)

See Also:


Attachments
Patch (58.32 KB, patch)
2016-10-27 13:54 PDT, Dave Hyatt
no flags Details | Formatted Diff | Diff
Patch (58.32 KB, patch)
2016-10-27 13:57 PDT, Dave Hyatt
dino: review+
Details | Formatted Diff | Diff
Patch (60.24 KB, patch)
2016-10-27 14:12 PDT, Dave Hyatt
dino: review+
Details | Formatted Diff | Diff
Patch (60.35 KB, patch)
2016-10-27 14:46 PDT, Dave Hyatt
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2016-10-27 13:40:56 PDT
[CSS Parser] Implement CSS variables
Comment 1 Dave Hyatt 2016-10-27 13:54:32 PDT
Created attachment 293052 [details]
Patch
Comment 2 WebKit Commit Bot 2016-10-27 13:55:48 PDT
Attachment 293052 [details] did not pass style-queue:


ERROR: Source/WebCore/css/CSSVariableData.h:63:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dave Hyatt 2016-10-27 13:57:08 PDT
Created attachment 293053 [details]
Patch
Comment 4 Dean Jackson 2016-10-27 14:08:47 PDT
Comment on attachment 293053 [details]
Patch

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

> Source/WebCore/WebCore.xcodeproj/project.pbxproj:3425
> -		9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDD1D8861580073A074 /* CSSVariableData.h */; };
> +		9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDD1D8861580073A074 /* CSSVariableData.h */; settings = {ATTRIBUTES = (Private, ); }; };

Was this intentional?

> Source/WebCore/css/CSSVariableData.cpp:109
> +            AtomicString variableName =
> +            block.consumeIncludingWhitespace().value().toAtomicString();

Typo. Accidental newline.

> Source/WebCore/css/parser/CSSParser.cpp:1809
> +        const CSSVariableDependentValue& dependentValue = downcast<CSSVariableDependentValue>(value);

You could probably auto this.

> Source/WebCore/css/parser/CSSParser.cpp:1814
> +        CSSPropertyID dependentValuePropertyID = dependentValue.propertyID();

And this. etc.

> Source/WebCore/css/parser/CSSParser.cpp:1858
> +        const CSSVariableReferenceValue& valueWithReferences = downcast<CSSVariableReferenceValue>(value);
> +        const CSSVariableData* variableData = valueWithReferences.variableDataValue();

More autos.

> Source/WebCore/css/parser/CSSParserImpl.cpp:95
> -            CSSCustomPropertyValue* customValue = downcast<CSSCustomPropertyValue>(property.value());
> -            const AtomicString& name = customValue->name();
> -            if (seenCustomProperties.contains(name))
> +            auto& name = downcast<CSSCustomPropertyValue>(*property.value()).name();
> +            if (!seenCustomProperties.add(name).isNewEntry)
>                  continue;
> -            seenCustomProperties.add(name);
> +            output[--unusedEntries] = property;
>              continue;
>          }

I don't understand this change.
Comment 5 Dave Hyatt 2016-10-27 14:12:07 PDT
Created attachment 293054 [details]
Patch
Comment 6 Dean Jackson 2016-10-27 14:31:39 PDT
Comment on attachment 293054 [details]
Patch

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

> Source/WebCore/css/CSSVariableData.cpp:108
> +            AtomicString variableName =

This still needs fixing.
Comment 7 Dave Hyatt 2016-10-27 14:46:03 PDT
Created attachment 293062 [details]
Patch
Comment 8 Dave Hyatt 2016-10-27 15:08:11 PDT
Landed in r208006.