Closed
Bug 290341
Opened 20 years ago
Closed 11 years ago
It should be possible to set the name of the ID and class attributes of XML elements
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
RESOLVED
INVALID
People
(Reporter: smaug, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
|
13.24 KB,
patch
|
Details | Diff | Splinter Review |
It would be useful if for example an XBL binding could set the
name of the ID and class attributes of an XML element.
XHTML/XUL/SVG don't need this feature.
Something like
var scri =
anElement.QueryInterface(Components.interfaces.nsIScriptableStyledContent);
scri.setIdAttributeName("id");
scri.setClassAttributeName("class");
This will be needed by the XForms extension.| Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
So do we want to allow pages to access this? What happens if they do?
| Reporter | ||
Comment 3•20 years ago
|
||
(In reply to comment #2) > So do we want to allow pages to access this? What happens if they do? Yes we do want to allow pages to access this. That is the way how content authors can define their own XBL bindings for (abstract) XForms UI controls and still support ID and class attributes. And what happens... well, the name of the ID and/or class attribute changes :)
Comment 4•20 years ago
|
||
What I mean is, what happens if some content page overrides this on an XForms control? Will the XForms module deal?
| Reporter | ||
Comment 5•20 years ago
|
||
XForms doesn't rely the ID attribute to be 'id'. "A host language must permit an attribute of type xsd:ID on each XForms element." And the current implementation doesn't care which attribute is the ID. Changing class attribute may just break the styling (?), but that is then up to the content author.
| Reporter | ||
Comment 6•20 years ago
|
||
Comment 7•20 years ago
|
||
There is no one attribute that is an ID or one attribute that is a class. It's just that attributes can be class attribute and ID attributes. For example, a language could define an attribute foo:bar that is a class attribute, such that: <html:li foo:bar="a" class="b"> ...is an element in classes "a" and "b". Same with IDs. You can set an attribute to type ID through the DOM, using xml:id, using a DTD internal subset, using namespace-specific knowledge (e.g. we know that <html:* id=""> is an ID attribute). An element can have multiple IDs and multiple classes on multiple class attributes.
| Reporter | ||
Comment 8•20 years ago
|
||
(In reply to comment #7) > There is no one attribute that is an ID or one attribute that is a class. It's > just that attributes can be class attribute and ID attributes. > I'm aware of this, but the XForms extension will need something quite soon, I think. The multiple IDs will be handled in Bug 288513, but that implementation won't probably work as fast as this one. xml:id is Bug 275196. I don't think there is a bug filed to support multiple class attributes.
Updated•15 years ago
|
QA Contact: ian → general
| Reporter | ||
Comment 9•11 years ago
|
||
We don't want this.
Assignee: bugs → nobody
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
| Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•