[cssom][all] Add CSSOMString and replace DOMString usage with it - #1266
Conversation
As resolved by CSS WG on 2017-04-19, because they are URLs. This is consistent with HTML: whatwg/html#1282
Implementations can choose one or the other. CSSWG resolution: w3c#1217 (comment)
|
|
||
| Or, alternatively: | ||
|
|
||
| <pre class="def lang-webidl"> |
There was a problem hiding this comment.
Can use class="idl extract" here instead.
There was a problem hiding this comment.
With that Bikeshed gives:
FATAL ERROR: Multiple local 'typedef' <dfn>s have the same linking text 'CSSOMString'.
There was a problem hiding this comment.
I haven't added the "extract" support yet. (The bug is still open!)
(And in any case, I think it's probably better to do exactly this - instead of claiming something is WebIDL and then opting out, just ask it to be highlighted as WebIDL but otherwise be meaningless text.)
| This choice effectively allows implementations to do this replacement, | ||
| but does not require it. | ||
|
|
||
| This enables an implementation to use UTF-8 internally to represent strings in memory. |
There was a problem hiding this comment.
s/This/Using {{USVString}}/
|
|
||
| On the other hand, | ||
| implementations that internally represent strings as 16-bit <a>code units</a> | ||
| may prefer to avoid the cost of doing this replacement. |
There was a problem hiding this comment.
Replaced with “might”.
|
(Thanks for fixing link errors in cssom!) |
I did hesitate about this one, it just seemed more “within style system territory”. I don’t feel strongly about it, though. In Stylo we can (and possibly already do) keep this on the C++ side rather than the Rust side of the bindings. (And Servo needs to decide what to do about every |
|
So I'm open to changing how this works, but since the string will exist as a |
|
Changed |
CSSWG resolution: w3c#1217 (comment) Fix w3c#1217. Each occurrence is one of: * CSS syntax * A name (for example a property name) that also occurs in CSS syntax * `Stylesheet::type`, which is always `text/css`. Not replaced: * `Stylesheet::title`, which is set from the eponymous HTML content attribute of [`<style>`](https://html.spec.whatwg.org/multipage/semantics.html#attr-style-title) and [`<link>`](https://html.spec.whatwg.org/multipage/semantics.html#attr-link-title) elements. These contant attributes are reflected as `HTMLElement::title` DOM attributes, where they are `DOMString`.
|
Filed web-platform-tests/wpt#5641 to follow up on tests. The |
CSSOMStringis an IDLtypedefof eitherUSVStringorDOMString, chosen by implementations.CSSWG resolution: #1217 (comment). Fixes #1217.
Each replaced occurrence is one of:
Stylesheet::type, which is alwaystext/css.Stylesheet::title, which is set from the eponymous HTML content attribute of<style>and<link>elements.