devpunks / snuggsi

snuggsi ツ - Easy Custom Elements in ~1kB
https://snuggsi.com
MIT License
398 stars 17 forks source link

User Settings Being Overridden by <template> settings #87

Closed snuggs closed 7 years ago

snuggs commented 7 years ago

TL;DR; User attribute settings should take prescedence over template defaults.

This issue effects Attributes defined on a custom element within the master document being overridden by template defaults.

Example

Master Document

<link rel=import href=foo-bar.html>

<foo-bar title='I want my title'></foo-bar>

Imported Document

<template title='This is the template title'></template>

<script>
Element `foo-bar`
  (class extends HTMLElement {})
</script>

Resulting Master Document

<link rel=import href=foo-bar.html>

<foo-bar title='This is the template title'></foo-bar>

Expected Master Document

<foo-bar title='I want my title'></foo-bar>
brandondees commented 7 years ago

we gotta have a test case covering this, it's super fundamentally important to preserve

snuggs commented 7 years ago

Seems like this is going to be difficult @brandondees as there is no support...yet...

Had an issue closed down https://github.com/tmpvar/jsdom/issues/1900 And didn't realize already had an issue open. https://github.com/tmpvar/jsdom/issues/1030#issuecomment-263122863 And currently a PR gaining some traction https://github.com/tmpvar/jsdom/pull/1872

brandondees commented 7 years ago

the test case is difficult, or the implementation? if JSDOM doesn't implement specs that's not our problem, we can test on headless chrome or whatever else.

snuggs commented 7 years ago

You've got a point @brandondees ... :thinking:

snuggs commented 7 years ago

Fixed.