- From: Nashorn <notifications@github.com>
- Date: Fri, 21 Dec 2018 12:26:25 +0000 (UTC)
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/webcomponents/issues/509/449375947@github.com>
Playing the role of an HTML guy, why would'nt i want custom semantic elements like a <post-card> or <shopping-cart> ? I dont see your point against this. Are you against custom elements? 2nd, behavior-n-look across platforms using "is" will be broken? I don't see your point. 3rd, re-read what i posted on above ([is attribute is needed!](https://github.com/w3c/webcomponents/issues/509#issuecomment-448194242). You have to consider the use-case for "is", which w3c have weighed and most developer-consumers have not yet. Let me say it again in a different way, (**Safari/iOS devs**, if you're reading - i do hope you see it): There are 4 mechanics of creating new instances of custom elements, here they are: 1. `document.**createElement**("post-card");` 2. `var card = **new** PostCard;` 3. `<post-card>....content here....</post-card>` 4. `<div is="post-card">....content here....</div>` 1 and 2 from above is a programmatic design where 1, doc.createElement() is an Open-Closed dependency inverted design that allows for runtime injection in a dynamic environment from merely strings that look like tag-names (from db). Powerful. The latter is common to us and serves its onw role in the dynamic/static landscape. The 3rd and 4th are 2 declarative ways to achieve inline layout by letting the browser do the work of initialization. Semantics, code readability, and accessibility are achieved here on 1 aspect. The former (3rd bullet), is akin to 2nd bullet -- `new PostCard;`. The latter, 4th bullet, is similar to 1st bullet -- `document.createElement**("post-card")` offering the same SOLID principals as the programmatic `createElement()` method. The "is" attribute allows one to dynamically targeting a div, setting is to some Class and having it "react" accordingly without modifying one bit of declarative (existing html). **IT IS SIMPLY AN ALTERNATIVE MECHANISM FOR INITIALIZATION, BUT FROM A DIFF PERSPECTIVE**. "is" is absolutely necessary as added way to declare usage and complements the 3 existing strategies we have currently. Thing carefully, to get an existing DIV in DOM to react, change it's "is", done!. With "is", one would create a new instance of a custom el, replace the existing DIV with new el, a more drastic dom modification (removal and adding to dom). 2nd, the possibility of causing existing semantics to change and possibly accessibility, whereas "is" preserves those as well. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/509#issuecomment-449375947
Received on Friday, 21 December 2018 12:26:47 UTC