by IgorPartola · 11y ago · 0 comments
<media type="image">
<src href="/foo.png">
<src href="/foo-2x.png" type="high-definition">
</media>
I do like the idea of not having generic <div>'s everywhere. You can already do this with, for example, Angular. Basically, aside from the pre-defined elements (div, span, input, etc.) I want to just use whatever element I choose myself. I should then be able to style it how I want, and by default it can be, let's say, a borderless, 0 margin, 0 padding, transparent, block element. That way I can use add <wrapper> and style it how I want. Saves keystrokes. This gets me into trouble if later browsers decide to actually support <wrapper> with different semantics than I intended, but I am sure we could work around this somehow without resorting to <html:wrapper> namespacing.Lastly, I really would love to be able to define element behavior. I want to say that <calendar> is a link, until you click on it, then it opens a calendar, and fires such and such events, etc. Basically, instead of adding a script tag to the base template that defines how $('.calendar') should work, I want to define it globally, a la Angular's directives, then have this happen for the entire site. If the browser allowed me to have finer grained control over user input (exact keystrokes, position of cursor, etc.), I could then re-create <input type="text">! You might say "well, we already have that, the browser does it", but the beauty of doing it yourself is that you can define more complex rules for it than just "type in text". You could, for example, easily define the format of it without having to resort to ugly hacks (think a mm/dd/yyyy type input, or an insurance subscriber ID with a very specific format).
https://www.polymer-project.org/platform/custom-elements.htm...
http://www.html5rocks.com/en/tutorials/responsive/picture-el...
Treat them like namespaces aka packages aka modules in programming languages and I don't see a downside. Import what you need, allowing defaults. You're able to override terms if you really need to with stacked imports. You're able to use conflicting terms by specifying the namespace. You're able to alias namespaces to convenient short-hand. i.e.:
<acme:video>
<src>https://blah</src>
</acme:video>
Yes writing "html:" explicitly everywhere seems pretty silly. When the domain's primary purpose is writing HTML, that should obviously be the default/root namespace.But adding support for alternatives on top of that...? Not seeing the evil there.
Namespaces are needed for embedding things like SVG, MathML, etc. in HTML or XML documents.
Bzzt, wrong. How would you propose we allow other document types to be embedded in HTML (like SVG)? Just hope the tag names never collide?
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg
https://developer.mozilla.org/en-US/docs/Web/MathML/Element/...
Yes, this is less flexible than XML namespaces. You couldn't do something like XLinks.
A default namespace of 'html', and explicit namespaces for is reasonable. But <html:a> instead of <a> is ridiculous and few people who currently create content for the web will ever use it.