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] What to do when CSSNumericValues form a cycle? #513

Closed
darrnshn opened this issue Nov 9, 2017 · 3 comments
Closed

[css-typed-om] What to do when CSSNumericValues form a cycle? #513

darrnshn opened this issue Nov 9, 2017 · 3 comments

Comments

@darrnshn
Copy link
Collaborator

darrnshn commented Nov 9, 2017

With mutable CSSNumericValues, I think it's possible to form cycles:

let a = new CSSMathNegate(0) // a = (- 0)
let b = new CSSMathNegate(a) // b = (- a)
a.value = b // b = (- a) and a = (- b)

If this is possible, should a.value = b throw an error? Otherwise, type checking will get kinda weird and serialization will be impossible.

Follow up question: If we disallow cycles, we can still form a directed acyclic graph. I'm guessing that's allowed, with type checking propagating through the graph when a node changes their value? (i.e. a node has to notify its 'parents' when its type changes)

@tabatkins
Copy link
Member

Heh, don't even need to invoke a second object:

let a = new CSSMathNegate(0);
a.value = a; // ?????

I think the fix for this is, upon a.value = b (or equivalent construction), crawl b's value and see if the a object lives anywhere in it.

I think this still allows, say, new CSSMathSum(a, a, a, a, a) to work just fine.

Your follow-up question is more difficult, and means the resolution we made today for CSSUnitValues is kinda useless...

@tabatkins
Copy link
Member

Actually, if we solve #494 in the way I want (making .value/.values readonly), this goes away, as you can't construct cycles in the first place.

@darrnshn
Copy link
Collaborator Author

This is pretty much the same as #494. Gonna close this.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 26, 2018
According to below linked issue(#514), CSSVariableReferenceValue
should have a constructor.
and also fallback attribute should be readonly attribute.
constructor was already added in chromium. but readonly keyword
was not added. so add readonly keyword for fallback attribute.
(actually it is related with #513 to add readonly keyword)

w3c/css-houdini-drafts#547
w3c/css-houdini-drafts#514
w3c/css-houdini-drafts#513

Bug: 803687
Change-Id: I91b5d4f21b75cd5d27063bfceba0b39b30977be9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 27, 2018
According to below linked issue(#514), CSSVariableReferenceValue
should have a constructor.
and also fallback attribute should be readonly attribute.
constructor was already added in chromium. but readonly keyword
was not added. so add readonly keyword for fallback attribute.
(actually it is related with #513 to add readonly keyword)

w3c/css-houdini-drafts#547
w3c/css-houdini-drafts#514
w3c/css-houdini-drafts#513

Bug: 803687
Change-Id: I91b5d4f21b75cd5d27063bfceba0b39b30977be9
Reviewed-on: https://chromium-review.googlesource.com/881381
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Cr-Commit-Position: refs/heads/master@{#532167}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jan 27, 2018
According to below linked issue(#514), CSSVariableReferenceValue
should have a constructor.
and also fallback attribute should be readonly attribute.
constructor was already added in chromium. but readonly keyword
was not added. so add readonly keyword for fallback attribute.
(actually it is related with #513 to add readonly keyword)

w3c/css-houdini-drafts#547
w3c/css-houdini-drafts#514
w3c/css-houdini-drafts#513

Bug: 803687
Change-Id: I91b5d4f21b75cd5d27063bfceba0b39b30977be9
Reviewed-on: https://chromium-review.googlesource.com/881381
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Cr-Commit-Position: refs/heads/master@{#532167}
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

3 participants