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] Clarification on the behavior of StylePropertyMapReadOnly.get() (disagreement between spec and WPT) #1133

Open
weinig opened this issue Nov 13, 2024 · 0 comments

Comments

@weinig
Copy link

weinig commented Nov 13, 2024

The current CSS Typed OM spec specifies StylePropertyMapReadOnly's get() as:

(undefined or CSSStyleValue) get(USVString property);

However, the WTP tests for this all seem to expect null to be the return value when property is not in a rule. For example, in this test, https://github.com/web-platform-tests/wpt/blob/b6027abc9f/css/css-typed-om/the-stylepropertymap/declared/get.html#L14, the first test case is:

test(t => {
  const styleMap = createDeclaredStyleMap(t, '--foo: auto');
  assert_equals(styleMap.get('--Foo'), null);
}, 'Getting a custom property not in the CSS rule returns null');

It seems both Safari and Chrome implement this as returning null, not undefined. Should the spec change? Or should the tests (and implementations) update?

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

No branches or pull requests

1 participant