-
Notifications
You must be signed in to change notification settings - Fork 74
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
Document.write and such as names are misleading #260
Comments
Thanks, that's a good point. We're taking the data from the context object in steps 1.1 and 1.2 here, so it should be easy. There is still a potential collision as we're using the DOM local names for Elements for simplification. |
I guess elements will always be lowercase? However, you probably want to distinguish SVG script from HTML script? |
There's probably no conflict possibility for static vs regular operations. In WebIDL 2.5.3:
There's a similar restriction for attributes:
I looked into our implementation, and it doesn't seem like we have the information to distinguish between prototype / static readily avaliable in the exception state. We actually (contrary to the spec) always use the constructor name, so:
alerts It sounds like this might actually be a good outcome - if we always use the constructor name, that suggests to the authors that the sample contains the information about the sink in IDL (which is what the checks will hook on to), regardless on whether it's static or on the prototype. |
I didn't realize IDL forbids conflicts, but I don't think it's a good idea to standardize on this rather misleading naming either. cc @domenic |
+1, as a web developer I find it supremely confusing when browser developers start talking about static methods and properties (like Document.write or HTMLIFrameElement.srcdoc) which do not exist. At the very least, please use a different separator than "." A space would be a huge improvement. |
Agreed that we should not confuse - if changing the separator to a space, or anything else really makes it so devs are not confused that the value is the identifier of the IDL interface and not the ES object, I'm all for it. Space it is. |
Changes to the spec:
It's much better now, thanks all! |
The
Document
class does not have a staticwrite
property. I think we should make thisDocument.prototype.write
or at least something that does not suggest a misleading thing (and which well might conflict in the future).Via whatwg/webidl#841 (comment).
The text was updated successfully, but these errors were encountered: