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

Make duplicate attribute names an error #604

Merged
merged 3 commits into from
May 21, 2019

Commits on May 21, 2019

  1. Make dupliate attribute names an error

    This came up in the context of disucssion around #5071.
    
    Browsers use a 'first attribute wins' rule for evaluating attributes and
    building the DOM - though duplicate attributes are considered to be a
    spec violation.
    
    Blazor wants to use 'last attribute wins' rules because that's most
    sensible when you consider evaluation order and splatting.
    
    This means that we have to have the markup block pass do the same thing
    as the Blazor runtime when duplicates appear. However, since this is a
    spec violation I'm proposing that we just make it an error (like we do
    for malformed tags). There's no useful purpose for duplicate attributes
    since browsers ignore it.
    
    Since we're not going to allow this for elements. Let's go all of the
    way and block it for components as well. And while we're here, lets
    block some of the invalid cases where users try to mix onchange and
    bind. These don't work today, so we should make them an error. If we
    decide to add support for this case to the runtime that would require
    compiler work anyway.
    Ryan Nowak committed May 21, 2019
    Configuration menu
    Copy the full SHA
    bfaffaf View commit details
    Browse the repository at this point in the history
  2. update baselines

    Ryan Nowak committed May 21, 2019
    Configuration menu
    Copy the full SHA
    716e380 View commit details
    Browse the repository at this point in the history
  3. PR feedback

    Ryan Nowak committed May 21, 2019
    Configuration menu
    Copy the full SHA
    f8eaa40 View commit details
    Browse the repository at this point in the history