Bug 112108 - Implement CSSOM for CSS Variables
Summary: Implement CSSOM for CSS Variables
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alan Cutter
URL: http://dev.w3.org/csswg/css-variables...
Keywords:
Depends on:
Blocks: 85580
  Show dependency treegraph
 
Reported: 2013-03-12 00:10 PDT by Alan Cutter
Modified: 2013-04-15 23:20 PDT (History)
24 users (show)

See Also:


Attachments
WIP (50.48 KB, patch)
2013-03-13 20:00 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Testing GTK build (52.37 KB, patch)
2013-03-14 00:22 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Target only JavaScript interfaces (62.08 KB, patch)
2013-03-14 05:35 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Fixed incorrect XCode path (62.08 KB, patch)
2013-03-14 06:20 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
EFL GTK patch (68.42 KB, patch)
2013-03-14 18:48 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Rebased onto ToT (68.62 KB, patch)
2013-03-14 19:59 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Patch (72.71 KB, patch)
2013-03-20 20:38 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-02 (1.22 MB, application/zip)
2013-03-21 04:45 PDT, WebKit Review Bot
no flags Details
Patch (72.71 KB, patch)
2013-03-21 15:59 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Patch (78.21 KB, patch)
2013-03-28 01:23 PDT, Alan Cutter
no flags Details | Formatted Diff | Diff
Repatch for JSC (78.10 KB, patch)
2013-04-01 22:50 PDT, Alan Cutter
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 (707.49 KB, application/zip)
2013-04-02 13:01 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Cutter 2013-03-12 00:10:32 PDT
Implement a Javascript API for CSS variables according to the current spec: http://dev.w3.org/csswg/css-variables/#cssom
Comment 1 Alan Cutter 2013-03-13 20:00:20 PDT
Created attachment 193043 [details]
WIP
Comment 2 EFL EWS Bot 2013-03-13 21:10:12 PDT
Comment on attachment 193043 [details]
WIP

Attachment 193043 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17149572
Comment 3 Build Bot 2013-03-13 22:38:21 PDT
Comment on attachment 193043 [details]
WIP

Attachment 193043 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17160244
Comment 4 Build Bot 2013-03-13 23:13:47 PDT
Comment on attachment 193043 [details]
WIP

Attachment 193043 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/17210100
Comment 5 Build Bot 2013-03-13 23:47:01 PDT
Comment on attachment 193043 [details]
WIP

Attachment 193043 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17172091
Comment 6 Alan Cutter 2013-03-14 00:22:27 PDT
Created attachment 193081 [details]
Testing GTK build
Comment 7 WebKit Review Bot 2013-03-14 00:35:18 PDT
Please wait for approval from timothy@apple.com (or another member of the Apple Safari Team) before submitting because this patch contains changes to the Apple Mac WebKit.framework public API.
Comment 8 EFL EWS Bot 2013-03-14 01:51:17 PDT
Comment on attachment 193081 [details]
Testing GTK build

Attachment 193081 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17055538
Comment 9 Build Bot 2013-03-14 02:01:56 PDT
Comment on attachment 193081 [details]
Testing GTK build

Attachment 193081 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17182076
Comment 10 Build Bot 2013-03-14 02:08:25 PDT
Comment on attachment 193081 [details]
Testing GTK build

Attachment 193081 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/17161555
Comment 11 Alan Cutter 2013-03-14 05:35:41 PDT
Created attachment 193108 [details]
Target only JavaScript interfaces
Comment 12 Build Bot 2013-03-14 05:45:40 PDT
Comment on attachment 193108 [details]
Target only JavaScript interfaces

Attachment 193108 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/17041555
Comment 13 EFL EWS Bot 2013-03-14 05:55:09 PDT
Comment on attachment 193108 [details]
Target only JavaScript interfaces

Attachment 193108 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17080513
Comment 14 Alan Cutter 2013-03-14 06:20:03 PDT
Created attachment 193113 [details]
Fixed incorrect XCode path
Comment 15 EFL EWS Bot 2013-03-14 06:35:38 PDT
Comment on attachment 193113 [details]
Fixed incorrect XCode path

Attachment 193113 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17187176
Comment 16 Alan Cutter 2013-03-14 18:48:49 PDT
Created attachment 193217 [details]
EFL GTK patch
Comment 17 Alan Cutter 2013-03-14 19:59:21 PDT
Created attachment 193223 [details]
Rebased onto ToT
Comment 18 Alan Cutter 2013-03-14 20:41:26 PDT
(In reply to comment #17)
> Created an attachment (id=193223) [details]
> Rebased onto ToT

This patch appears to be building properly on the bots (pending Mac and Linux though they were passing before already).

I submit this patch up for preliminary code review.
Comment 19 Dimitri Glazkov (Google) 2013-03-19 09:01:22 PDT
Comment on attachment 193223 [details]
Rebased onto ToT

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

Large patch! :)

It looks like a lot of it is just tedious project adds and boilerplate, but there are important bits that we probably don't want to lose sight of.

The bindings code will need to be reviewed by bindings experts (sam, ggaren for JSC, haraken, abarth for V8), the CSSOM by the style experts (anttik, kling)

> Source/WebCore/ChangeLog:8
> +        WIP. Fixing build issues with EFL and GTK. Rebased patch onto ToT master. Still has unresolved matter of pointer to PropertySetCSSStyleDeclaration object shared across JS thread not ref counted.

If it's a WIP, probably don't need to mark it for review yet :)

> Source/WebCore/bindings/js/JSCSSVariablesDeclarationCustom.h:31
> +#include "JSCSSVariablesDeclaration.h"

This is weird. Why do we need this file?

> Source/WebCore/css/StylePropertySet.cpp:752
> +        if (testProperty.id() == CSSPropertyVariable && static_cast<const CSSVariableValue*>(testProperty.value())->name() == name) {

This looks like a toCSSVariableValue helper.

> Source/WebCore/css/StylePropertySet.cpp:768
> +void StylePropertySet::getVariableNames(Vector<AtomicString>& names) const

here, get is not superfluous, you are actually not returning a value.

> Source/WebCore/css/StylePropertySet.cpp:777
> +const String& StylePropertySet::getVariableValue(const AtomicString& name) const

here get is superfluous -> variableValue
Comment 20 Alan Cutter 2013-03-19 21:15:40 PDT
(In reply to comment #19)
> (From update of attachment 193223 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=193223&action=review
> 
> Large patch! :)
> 
> It looks like a lot of it is just tedious project adds and boilerplate, but there are important bits that we probably don't want to lose sight of.
> 
> The bindings code will need to be reviewed by bindings experts (sam, ggaren for JSC, haraken, abarth for V8), the CSSOM by the style experts (anttik, kling)

Thanks for the advice, I will go to these people for further review.

> > Source/WebCore/bindings/js/JSCSSVariablesDeclarationCustom.h:31
> > +#include "JSCSSVariablesDeclaration.h"
> 
> This is weird. Why do we need this file?

It does seem unnecessary but the EFL port wouldn't compile without it. Its binding code generator most likely includes it without checking for its existence first:
[ 45%] /home/eflews/git/webkit/WebKitBuild/Release/DerivedSources/WebCore/JSCSSVariablesDeclaration.cpp:28:45: fatal error: JSCSSVariablesDeclarationCustom.h: No such file or directory
compilation terminated.

I'll add a comment stating this.

> 
> > Source/WebCore/css/StylePropertySet.cpp:752
> > +        if (testProperty.id() == CSSPropertyVariable && static_cast<const CSSVariableValue*>(testProperty.value())->name() == name) {
> 
> This looks like a toCSSVariableValue helper.

I see what you mean but I'm not sure where this helper function should go. This doesn't appear to be an idiom that CSSValue uses.

> > Source/WebCore/css/StylePropertySet.cpp:768
> > +void StylePropertySet::getVariableNames(Vector<AtomicString>& names) const
> 
> here, get is not superfluous, you are actually not returning a value.
> 
> > Source/WebCore/css/StylePropertySet.cpp:777
> > +const String& StylePropertySet::getVariableValue(const AtomicString& name) const
> 
> here get is superfluous -> variableValue

Thanks for the style tip, updated function name.
Comment 21 Alan Cutter 2013-03-20 20:38:47 PDT
Created attachment 194178 [details]
Patch
Comment 22 Alan Cutter 2013-03-20 20:41:38 PDT
(In reply to comment #21)
> Created an attachment (id=194178) [details]
> Patch

 - Made changes based on Dimitri's review.
 - Split CSSOM test into smaller CRUD tests.
 - Fixed bug where non-inherited styles were not updating when a variable value cascade should have updated them.
Comment 23 WebKit Review Bot 2013-03-21 04:45:28 PDT
Comment on attachment 194178 [details]
Patch

Attachment 194178 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/17235329

New failing tests:
platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-month-popup.html
Comment 24 WebKit Review Bot 2013-03-21 04:45:35 PDT
Created attachment 194226 [details]
Archive of layout-test-results from gce-cr-linux-02

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-3.3.8-gcg-201212281604-x86_64-with-GCEL-10.04-gcel_10.04
Comment 25 Alan Cutter 2013-03-21 15:47:25 PDT
(In reply to comment #24)
> Created an attachment (id=194226) [details]
> Archive of layout-test-results from gce-cr-linux-02
> 
> The attached test failures were seen while running run-webkit-tests on the chromium-ews.
> Bot: gce-cr-linux-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-3.3.8-gcg-201212281604-x86_64-with-GCEL-10.04-gcel_10.04

These appear to be flakey/failing tests: http://build.webkit.org/builders/Chromium%20Linux%20Release%20%28Tests%29/builds/46263

Reuploading patch while the tree is green.
Comment 26 Alan Cutter 2013-03-21 15:59:17 PDT
Created attachment 194369 [details]
Patch
Comment 27 Alan Cutter 2013-03-28 01:23:12 PDT
Created attachment 195498 [details]
Patch
Comment 28 Alan Cutter 2013-03-28 01:24:22 PDT
(In reply to comment #27)
> Created an attachment (id=195498) [details]
> Patch

 - Rebaselined patch.
 - Implemented CSSOM API for computed styles.
Comment 29 kov's GTK+ EWS bot 2013-03-28 02:53:39 PDT
Comment on attachment 195498 [details]
Patch

Attachment 195498 [details] did not pass gtk-ews (gtk):
Output: http://webkit-commit-queue.appspot.com/results/17339232
Comment 30 EFL EWS Bot 2013-03-28 03:45:47 PDT
Comment on attachment 195498 [details]
Patch

Attachment 195498 [details] did not pass efl-ews (efl):
Output: http://webkit-commit-queue.appspot.com/results/17320281
Comment 31 Build Bot 2013-03-28 04:46:41 PDT
Comment on attachment 195498 [details]
Patch

Attachment 195498 [details] did not pass win-ews (win):
Output: http://webkit-commit-queue.appspot.com/results/17292357
Comment 32 Adam Barth 2013-03-30 11:10:02 PDT
Comment on attachment 195498 [details]
Patch

We should do this without introducing custom bindings.
Comment 33 Alan Cutter 2013-04-01 21:20:20 PDT
(In reply to comment #32)
> (From update of attachment 195498 [details])
> We should do this without introducing custom bindings.

Thanks for the review.
AFAIK avoiding custom bindings here would involve implementing getter, setter, deleter and enumerator interface attributes for the IDL binding code generators. Possibly even a special getter that returns undefined for empty strings.
These would call the getPropertyValue, setProperty, removeProperty and getPropertyNames methods respectively.
Please correct me if I'm incorrect in this approach.
Comment 34 Adam Barth 2013-04-01 22:48:01 PDT
Those are good things to add to the code generators.  We'd eventually like to implement all of WebIDL.
Comment 35 Alan Cutter 2013-04-01 22:50:22 PDT
Created attachment 196074 [details]
Repatch for JSC
Comment 36 Build Bot 2013-04-02 13:01:17 PDT
Comment on attachment 196074 [details]
Repatch for JSC

Attachment 196074 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-commit-queue.appspot.com/results/17360153

New failing tests:
media/video-controls-fullscreen-volume.html
Comment 37 Build Bot 2013-04-02 13:01:22 PDT
Created attachment 196214 [details]
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-12  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.2
Comment 38 Alan Cutter 2013-04-15 23:20:05 PDT
Migrated to Blink: https://code.google.com/p/chromium/issues/detail?id=231791