-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Labels
cssom-1Current WorkCurrent Work
Description
I tried to implement the resolution from #2149 in Firefox, and we instantly found broken pages because of that.
There are two patterns that show up:
getComputedStyle(something, "height");(or any other property instead ofheight). Seems like a coding error on the given site, but all browsers agree on not throwing there.getComputedStyle(something, false);(which per WebIDL rules gets turned intogetComputedStyle(something, "false");). This is also an error (because the right thing to use if you want to be explicit about the argument isnull, notfalse), but it seems throwing there is more harmful than good.
So I propose we need to at least not throw when the string doesn't start with a colon. All browsers agree on returning the non-pseudo-element style there, so I suggest to just spec reality there.
For the cases the string does start with a colon we could:
- Try to throw (I can come back with data).
- Not throw, returning the non-pseudo-element style instead (WebKit / Blink behavior): It is consistent with the "string doesn't begin with a colon" case, but it seems a bit unfortunate.
- Not throw, returning an empty style (
length = 0) (Firefox behavior).
I think I prefer the third but I'd love to hear opinions.
Metadata
Metadata
Assignees
Labels
cssom-1Current WorkCurrent Work