You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is relatively complex, since it requires porting support for PutForwards in CodegenRust.py and the WebIDL parser. I'm still having trouble reading the spec and figuring out where the named CSS properties on the style object come from.
The PutForwards is not needed for web compat, fwiw; I think Gecko is the only engine implementing it so far.
The CSS props come from the spec text that says:
For each CSS property property that is a supported CSS property, the following partial interface
applies where camel-cased attribute is obtained by running the CSS property to IDL attribute
algorithm for property.
and following IDL.
In general, the CSSOM spec is ... unreliable and you shouldn't trust it too much. :(
Oh, yeah, that too. CSSStyleDeclaration is misused in current browser CSSOM for things inside font-face rules, which is why the props all live on CSS2Properties instead. There are a bunch of open issues on this spec. :(
Create CSS2Properties.webidl (inheriting from CSSStyleDeclaration) and dom::CSS2Properties (handwritten to include only some very common ones like color, background, display, etc.).
So much progress! The value serialization is still largely incorrect, but the getters and setters appear to work as expected! I haven't come up with a nice way to share the list of supported properties between libstyle and CSS2Properties.webidl, though, so I welcome suggestions. Lots of tests need to be written, too, and I should investigate what's already available in wpt.
I haven't come up with a nice way to share the list of supported properties between libstyle and CSS2Properties.webidl, though, so I welcome suggestions.
That’d be nice, but in the meantime do we get build errors if the lists don’t match?
Activity
jdm commentedon Feb 20, 2014
http://heycam.github.io/webidl/#PutForwards
bzbarsky commentedon Feb 20, 2014
The PutForwards is not needed for web compat, fwiw; I think Gecko is the only engine implementing it so far.
The CSS props come from the spec text that says:
and following IDL.
In general, the CSSOM spec is ... unreliable and you shouldn't trust it too much. :(
jdm commentedon Feb 20, 2014
Aha, so Gecko generates a WebIDL interface that inherits from CSSStyleDeclaration: http://mxr.mozilla.org/mozilla-central/source/dom/webidl/CSS2Properties.webidl.in and http://mxr.mozilla.org/mozilla-central/source/dom/bindings/GenerateCSS2PropertiesWebIDL.py. We probably should do the same. This task can leave aside PutForwards support, in that case.
(Also relevant are http://mxr.mozilla.org/mozilla-central/source/dom/bindings/Makefile.in#43 and http://mxr.mozilla.org/mozilla-central/source/dom/webidl/CSS2PropertiesProps.h which show more of the machinery used to generate the list)
bzbarsky commentedon Feb 20, 2014
Oh, yeah, that too. CSSStyleDeclaration is misused in current browser CSSOM for things inside font-face rules, which is why the props all live on CSS2Properties instead. There are a bunch of open issues on this spec. :(
jdm commentedon Apr 21, 2014
I propose the following to get us off the ground:
styleinPrivateLayoutDatawith a newSharedLayoutData(defined in script/) that contains the oldstylefield.cssText,getPropertyValue,setProperty, andsetPropertyValue.color,background,display, etc.).getPropertyValueandsetProperty(http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-camel-cased-attribute)lengthanditemwhich reflect the actual style declarations associated with the owning element (http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-length)auto merge of #2388 : zwarich/servo/cssom, r=jdm
Add the basic CSSStyleDeclaration CSSOM interface.
jdm commentedon Sep 18, 2014
I'm doing the exploratory work to get this off the ground. Follow along at https://github.com/jdm/servo/tree/cssom.
jdm commentedon Sep 21, 2014
So much progress! The value serialization is still largely incorrect, but the getters and setters appear to work as expected! I haven't come up with a nice way to share the list of supported properties between libstyle and CSS2Properties.webidl, though, so I welcome suggestions. Lots of tests need to be written, too, and I should investigate what's already available in wpt.
bzbarsky commentedon Sep 21, 2014
Please note that for web compat you'll need the "dashed" versions of the properties as well.
SimonSapin commentedon Sep 21, 2014
That’d be nice, but in the meantime do we get build errors if the lists don’t match?
jdm commentedon Sep 21, 2014
No build errors yet, just property undefined errors if one's missing from the WebIDL or an empty string if it's missing from libstyle.
jdm commentedon Sep 21, 2014
@bzbarsky Can you elaborate? Firefox doesn't appear to support element.style['font-style'] as described in http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-dashed-attribute.
bzbarsky commentedon Sep 21, 2014
@jdm Try an inbound build from sometime in the last two days. See also https://bugzilla.mozilla.org/show_bug.cgi?id=958887
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Add the basic CSSStyleDeclaration CSSOM interface.
Support for Separated Read Write