Skip to content

Cannot define property "title" for element "leaflet-marker" because it has the same name as an HTMLElement property, and not all browsers support overriding that. #18

Open
@michaeloboyle

Description

@michaeloboyle

I get this error when loading leaflet-map.html into my rails project with polymer.

Cannot define property "title" for element "leaflet-marker" because it has the same name as an HTMLElement property, and not all browsers support overriding that. Consider giving it a different name.

Seems like the sort of collision web components is designed to avoid but perhaps browser properties penetrate the shadow dom defenses?

    // polymer.js excerpt

    // Publishing/computing a property where the name might conflict with a
    // browser property is not currently supported to help users of Polymer
    // avoid browser bugs:
    //
    // https://code.google.com/p/chromium/issues/detail?id=43394
    // https://bugs.webkit.org/show_bug.cgi?id=49739
    //
    // We can lift this restriction when those bugs are fixed.
    filterInvalidAccessorNames: function(propertyNames) {
      for (var name in propertyNames) {
        // Check if the name is in our blacklist.
        if (this.propertyNameBlacklist[name]) {
          console.warn('Cannot define property "' + name + '" for element "' +
            this.name + '" because it has the same name as an HTMLElement ' +
            'property, and not all browsers support overriding that. ' +
            'Consider giving it a different name.');
          // Remove the invalid accessor from the list.
          delete propertyNames[name];
        }
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions