Bug 149544

Summary: Make custom properties store the parser value list for variable resolution
Product: WebKit Reporter: Dave Hyatt <hyatt>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jonlee, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch dino: review+

Description Dave Hyatt 2015-09-24 15:45:36 PDT
Refactor custom property parsing so that we hold the actual CSSParserValueList of parsed terms, functions and operators. This will allow us to iterate directly over the already-parsed terms, functions and operators when we do variable resolution.
Comment 1 Dave Hyatt 2015-09-24 17:24:25 PDT
Created attachment 261904 [details]
Patch
Comment 2 WebKit Commit Bot 2015-09-24 17:27:25 PDT
Attachment 261904 [details] did not pass style-queue:


ERROR: Source/WebCore/css/CSSCustomPropertyValue.h:30:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dave Hyatt 2015-09-24 17:29:29 PDT
Created attachment 261905 [details]
Patch
Comment 4 Dave Hyatt 2015-09-24 17:31:34 PDT
Created attachment 261906 [details]
Patch
Comment 5 Dean Jackson 2015-09-24 17:41:09 PDT
Comment on attachment 261906 [details]
Patch

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

> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:2122
> +    Node* styledNode = this->styledNode();
> +    if (!styledNode)
> +        return emptyString();
> +
> +    RefPtr<RenderStyle> style = computeRenderStyleForProperty(styledNode, m_pseudoElementSpecifier, CSSPropertyCustom);
> +    if (!style || !style->hasCustomProperty(propertyName))
> +        return emptyString();
> +
> +    return style->getCustomPropertyValue(propertyName)->cssText();

Can't all this use customPropertyValue?

Something like

RefPtr<CSSValue> propertyValue = this->customPropertyValue(propertyName);
return propertyValue ? propertyValue->cssText() : emptyString();
Comment 6 Dave Hyatt 2015-09-24 17:55:18 PDT
Landed in r190231.
Comment 7 Radar WebKit Bug Importer 2015-12-04 18:19:16 PST
<rdar://problem/23771248>