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

Misplaced is="..." attribute causes false negatives. #2

Open
mikesamuel opened this issue Jun 22, 2017 · 1 comment
Open

Misplaced is="..." attribute causes false negatives. #2

mikesamuel opened this issue Jun 22, 2017 · 1 comment
Assignees

Comments

@mikesamuel
Copy link
Collaborator

mikesamuel commented Jun 22, 2017

https://gerrit-review.googlesource.com/c/111010/2

<gr-autocomplete
     id="newProject"
     class="newProjectInput"
     is="iron-input"
     ... >

causes polymer-resin to create a <gr-autocomplete> proxy element instead of using the default HTMLElement proxy.

We should recognize when is="..." appears on a non-builtin HTML element, and issue a clear violation report that explains the problem, and then reject the value.

Treat an is attribute as misplaced when the element containing the is attribute

  1. has a valid custom element name, OR
  2. is an instance of HTMLUnknownElement
  3. is a legacy element.
@mikesamuel mikesamuel changed the title Bogus is attribute value causes false negatives. Misplaced is="..." attribute causes false negatives. Jun 22, 2017
@mikesamuel
Copy link
Collaborator Author

Proposed fix

Change the logic that computes a clean proxy in the presence of an is="..." attribute to do the following:

  1. Create a clean proxy as before.
  2. If the clean proxy itself has an is="..." attribute set the bad proxy bit
  3. Run our element classifier on the clean proxy.
  4. If the classification is not (builtin) then classify set the bad proxy bit

Before doing the first in cleanProxy check, check the bad proxy bit, and if it is set, report a misplaced is attribute violation, and return a type-independent innocuous value, possibly null.

@mikesamuel mikesamuel self-assigned this Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant