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

Browsers do not consistently seem to check this? #958

Closed
annevk opened this issue Feb 23, 2021 · 4 comments
Closed

Browsers do not consistently seem to check this? #958

annevk opened this issue Feb 23, 2021 · 4 comments

Comments

@annevk
Copy link
Member

annevk commented Feb 23, 2021

var x = Object.create(getComputedStyle(document.documentElement));
document.write('display: ' + x.display);

In Firefox x.display throws, but it does not in Chrome/Safari (it yields "block"). For a similar test with Location all browsers throw.

I thought that per 1.1.2.3.2 of https://heycam.github.io/webidl/#dfn-attribute-getter this throws, but perhaps I'm holding it wrong? Or maybe it's some magic with CSS2Properties that ends up violating IDL?

(Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1315409.)

@domenic
Copy link
Member

domenic commented Feb 23, 2021

Or maybe it's some magic with CSS2Properties that ends up violating IDL?

This seems quite likely. From what I understand we're currently working on aligning CSS2Properties with Firefox: https://groups.google.com/a/chromium.org/g/blink-dev/c/MfR5PmnS77U . (Although that talks about CSSStyleDecoration? Not sure on the relation.) /cc @andruud

Testing Text instead gives the appropriate error in Chrome: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8954

@andruud
Copy link

andruud commented Feb 23, 2021

Yeah, we're working to align with Firefox in terms on exposing the property attributes (e.g. display) on the prototype rather than as "own" properties. Safari also made the same change actually, but reverted it due to binary size issues (details in the I2S).

Not sure on the relation.

CSS2Properties is non-standard Firefox thing which derives from CSSStyleDeclaration. Emilio is trying to standardize it, and we'll try to align when that happens. It's a separate issue from the I2S you linked to though.

@annevk
Copy link
Member Author

annevk commented Feb 23, 2021

I guess this can be closed then. Thanks everyone!

@annevk annevk closed this as completed Feb 23, 2021
@andruud
Copy link

andruud commented Feb 25, 2021

Correction: CSS2Properties apparently isn't a non-standard Firefox thing, it's just an obsolete representation from DOM2.

https://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties

(In case this kept anyone awake at night).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants