Re: [csswg-drafts] [cssom] Add `toString` method on `CSSStyleSheet` (#7171)

Nope, that keyword is all you need.

(If you don't have an attribute already containing the text you have to write the definition *slightly* different to have an independent stringifier, but it's literally just a few words difference in invocation.)

And yeah, adding a stringifier to both would be ideal (but it increases the testing cost slightly). Relying on the current stringification  seems not too likely. (In theory someone could be using it for dirty type-testing since it currently stringifies to `"[Object CSSRule]"`, but doing that generically requires you to specifically use `Object.prototype.toString.call()` precisely *because* a lot of objects have stringifiers, so it's likely such uses are relying on that and won't be affected.)

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7171#issuecomment-1116737784 using your GitHub account


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

Received on Tuesday, 3 May 2022 23:00:23 UTC