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

Rename the first argument of defineElement from type to localName #416

Closed
rniwa opened this issue Mar 5, 2016 · 3 comments
Closed

Rename the first argument of defineElement from type to localName #416

rniwa opened this issue Mar 5, 2016 · 3 comments

Comments

@rniwa
Copy link
Collaborator

rniwa commented Mar 5, 2016

defineElement's first argument should be renamed to localName.

type is a very generic term and could refer to anything whereas localName in the context of DOM API is understood to refer to a specific meaning and also matches the definition of createElement.

@domenic
Copy link
Collaborator

domenic commented Mar 5, 2016

Although I agree type is not a great word, I think it's important to distinguish from localName, because of the type extensions/ { is } version.

Assuming #408, then if you do

document.defineElement("super-a", XFoo, { extends: "a" });

document.createElement("a", { is: "super-a" });

then the resulting local name of such elements will be "a", not "super-a".

I also think it's important to have a term for what is currently "valid custom element type".

@annevk
Copy link
Collaborator

annevk commented Mar 5, 2016

Maybe just use "name"? (It does somewhat make sense not to use localName here since it'll have different restrictions placed on it for now per the ASCII issue.) And make "custom element type" not refer to the name, but to a particular brand of element.

@rniwa
Copy link
Collaborator Author

rniwa commented Mar 5, 2016

Oh I see. Yeah, name would be better.

@domenic domenic closed this as completed in 118e8ff Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants