[css-houdini-drafts] [css-properties-values-api] should registerProperty throw as a result of an @property existing? (#942)

dbaron has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-properties-values-api] should registerProperty throw as a result of an @property existing? ==
This is sort of followup from #845 and #902, though I got here from w3ctag/design-reviews#402.

We were trying to understand the precedence rules in the spec for `@property` and `registerProperty`, and based on the spec it seemed like:
* if there's a `registerProperty` call after an `@property` for the same name exists then `InvalidModificationError` is thrown because there's only a single `[[registeredPropertySet]]` for the document
* if there's an `@property` that is in a stylesheet that is parsed (?) after a `registerProperty` call runs, then the `registerProperty` wins.

This seems problematic because it's (a) not super-clear how well the ordering is defined and (b) it may even be sort of intentional that the relative order of stylesheet and script processing isn't defined as long as the scripts don't require flushing style.  So in other words, you could end up in situations where something throws in some implementations and works in others.

That said -- it's not clear to me that this situation was intentional.  Reading #845 it feels like the intent was to have two separate sets of registered properties, so that `registerProperty` wouldn't throw if there was already an existing `@property` rule.  But I don't think the spec actually does that.

cc @tabatkins @emilio @andruud 

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/942 using your GitHub account

Received on Tuesday, 10 September 2019 04:11:09 UTC