It is currently Sat Dec 02, 2017 4:17 pm Advanced search
This is already the case as specced.Cerbera wrote:I would propose that an HTML5 UA should treat unrecognised elements in such a way that they respond to CSS and are added to the DOM sanely (e.g. future sectioning and grouping elements). I would also propose that unrecognised attributes be selectable via CSS and work in the DOM (e.g. future type values for <input>).
So I guess that's the part which specifies that unrecognised elements and attributes must be added to the DOM and work sanely?WHATWG wrote:When the steps below require the UA to create an element for a token, the UA must create a node implementing the interface appropriate for the element type corresponding to the tag name of the token [...], with the tag name being the name of that element, with the node being in the HTML namespace, and with the attributes on the node being those given in the given token.
[...]
The interface appropriate for an element that is not defined in this specification is HTMLElement.
(Source: 8.2.4.3.3. Creating and inserting HTML elements.)
<input type=foo>
input[type=foo] {
background: lime;
}
Yes.Cerbera wrote:So if this markup were used in an HTML5 document:And if this CSS was linked to that document:
- Code: Select all
<input type=foo>
Would the CSS be applied to that element?
- Code: Select all
input[type=foo] {
background: lime;
}
Xano wrote:Makes sense to me, just like you say it.
On the other hand, what is exactly is the use of such a feature? The one browser that doesn't support new stuff within a reasonably short period after 'release' would be Internet Explorer and I wouldn't count on its developers implement this forward-compatibility feature.
It already is possible, even in IE (if you use funny enough names, e.g. with colons in them), but it doesn't make it allowed to do so. Custom elements are forbidden to use in HTML5.Sander Aarts wrote:If I understand this correctly then this feature also offers the possibility to create custom elements.
Cerbera wrote:Currently, the market leading browser (Internet Explorer) does not apply CSS to unrecognised elements. Also, its DOM is somewhat messed up for elements which are not recognised.
The CSS parser doesn't behave differently, but the HTML parser does. IE treats such tags pretty much the same as it would with tags that have colons in them -- the elements can have content, the case is preserved, stray end tags are ignored, and the /> syntax has the XML empty-element tag semantics. (Normally, IE creates empty elements for unknown start and end tags what's between the tags end up as siblings to those elements, the element names are uppercased, and the /> syntax is ignored.)legendscrolls wrote:Actually IE does support styling unknown elements in HTML documents at least by, what I call, a DOM Trigger:
Say you want to use <section> and <article> in current IE 6 or higher you can write a little internal or external script in the head that has this code:
document.createElement("section");
document.createElement("article");
This will allow IE's CSS parser to style these elements even though IE doesn't currently, natively support them.
Gecko closes unknown elements at the first block-level element.legendscrolls wrote:Gecko, Presto and Webkit based such as Firefox, Opera and Safari all support styling without this DOM Trigger.
Return to Feedback on the Specs
Users browsing this forum: No registered users and 0 guests