Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-typed-om-1] Is it intentional that only existing items in a CSSUnparsedValue can be mutated? #664

Closed
bzbarsky opened this issue Feb 15, 2018 · 4 comments

Comments

@bzbarsky
Copy link

There is an indexed setter, but no indexed creator. So you can mutate the existing list of values, but not extend the list.

(There is also no deleter, but Web IDL no longer supports indexed deleters to start with, so that would be a bit complicated. In an ideal world, though, one could change the length of the list in various ways.)

@tabatkins
Copy link
Member

Both of the readwrite indexed things need another pass by me to fill in these details. It's unclear from the WebIDL spec how one is supposed to handle these, and specs disagree in ways that confuse me.

In particular, a lot of indexed-getter/setter interfaces have the getter return a nullable value, presumably with the idea that if you request a non-existent index you get back null. But the behavior of Arrays is to return undefined, and it looks like WebIDL might automatically handle this case for you anyway (if it's not in the list of supported property indexes, your method never gets called at all?).

@bzbarsky
Copy link
Author

Your typical nullable-supporting indexed getter looks something like this:

getter Node? item(unsigned long index);

That means it can be invoked as foo[5] or foo.item(5).

When invoked as foo[5] the getter operation is never even called, and undefined is returned, if 5 is out of range.

When invoked as foo.item(5) the operation is explicitly invoked and the fact that it's a getter is not even relevant. It just needs to return whatever type it returns given the input value and it's common to return null on out-of-bounds.

In your case, since your getters are identifier-less, you don't need to worry about the direct call case and can assume you will always be invoked with in-range indices.

@bzbarsky
Copy link
Author

In other words, if the getter above were:

getter Node (unsigned long index);

then it could not be invoked other than as foo[5] and would not need the nullability.

@tabatkins
Copy link
Member

Ahhhh, that explains some stuff. Thanks!

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 19, 2018
This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 19, 2018
This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537691}
aarongable pushed a commit to chromium/chromium that referenced this issue Feb 19, 2018
This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537691}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 20, 2018
This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537691}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 1, 2018
…rsedValue., a=testonly

Automatic update from web-platform-tests[css-typed-om] Allow mutations of CSSUnparsedValue.

This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537691}

wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572
wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 2, 2019
…rsedValue., a=testonly

Automatic update from web-platform-tests[css-typed-om] Allow mutations of CSSUnparsedValue.

This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainarchromium.org>
Commit-Queue: Darren Shen <shendchromium.org>
Cr-Commit-Position: refs/heads/master{#537691}

wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572
wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572

UltraBlame original commit: 2618adb9143793bed62609bbe12f803f7e605711
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 2, 2019
…rsedValue., a=testonly

Automatic update from web-platform-tests[css-typed-om] Allow mutations of CSSUnparsedValue.

This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainarchromium.org>
Commit-Queue: Darren Shen <shendchromium.org>
Cr-Commit-Position: refs/heads/master{#537691}

wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572
wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572

UltraBlame original commit: 2618adb9143793bed62609bbe12f803f7e605711
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 2, 2019
…rsedValue., a=testonly

Automatic update from web-platform-tests[css-typed-om] Allow mutations of CSSUnparsedValue.

This patch allows CSSUnparsedValue items to be mutated/appended.
See w3c/css-houdini-drafts#664

Bug: 812919
Change-Id: I3e3c1d91fa9bfaa3a1a4adde45202c36c9bdb37f
Reviewed-on: https://chromium-review.googlesource.com/923670
Reviewed-by: nainar <nainarchromium.org>
Commit-Queue: Darren Shen <shendchromium.org>
Cr-Commit-Position: refs/heads/master{#537691}

wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572
wpt-commits: 8fed98324bc133df221d778c62cbff210d43b0ce
wpt-pr: 9572

UltraBlame original commit: 2618adb9143793bed62609bbe12f803f7e605711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants