[css-houdini-drafts] [css-typed-om] Clarification on the behavior of StylePropertyMapReadOnly.get() (disagreement between spec and WPT) (#1133)

weinig has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] Clarification on the behavior of StylePropertyMapReadOnly.get() (disagreement between spec and WPT) ==
The current CSS Typed OM spec specifies [StylePropertyMapReadOnly's](https://drafts.css-houdini.org/css-typed-om-1/#stylepropertymapreadonly) `[get()](https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymapreadonly-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:

```javascript
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?

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1133 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 13 November 2024 18:12:04 UTC