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

Indexed getter for readonly CSSStyleDeclaration is broken #26178

Open
jdm opened this issue Apr 13, 2020 · 1 comment
Open

Indexed getter for readonly CSSStyleDeclaration is broken #26178

jdm opened this issue Apr 13, 2020 · 1 comment
Labels
A-content/css Interacting with CSS from web content (parsing, serializing, introspection) A-content/dom Interacting with the DOM from web content C-has-manual-testcase

Comments

@jdm
Copy link
Member

jdm commented Apr 13, 2020

window.getComputedStyle(document.documentElement)[0] returns align-content in Firefox, but undefined in Servo. get_property_value correctly has a different codepath for readonly (ie. computed) style declarations, but IndexedGetter (and Length) do not. It shouldn't be too hard to reuse the get_computed_style code path for the indexed getter as long as we can figure out how to map the array indices to property names, but it's not totally clear how to get the length of the computed styles.

This also has the effect that Object.getOwnPropertyNames(window.getComputedStyle(document.documentElement)) returns an empty object, and this ends up breaking the MotionMark benchmark's browser detection.

@jdm jdm added A-content/css Interacting with CSS from web content (parsing, serializing, introspection) A-content/dom Interacting with the DOM from web content C-has-manual-testcase labels Apr 13, 2020
@jdm
Copy link
Member Author

jdm commented Apr 14, 2020

This should be less work than I initially thought, since c10e839 made it easier to access style data for a node. We'll need the following:

It probably makes sense to generate this map in the same way that we generate CSSStyleDeclaration.webidl, based on the output of the style crate's CSS property generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/css Interacting with CSS from web content (parsing, serializing, introspection) A-content/dom Interacting with the DOM from web content C-has-manual-testcase
Projects
None yet
Development

No branches or pull requests

1 participant