Closed
Bug 288513
Opened 20 years ago
Closed 13 years ago
add support for DOM 3 Attr.isId and setIdAttribute*
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: smaug, Assigned: smaug)
References
()
Details
Attachments
(1 file, 1 obsolete file)
|
12.01 KB,
patch
|
jst
:
approval-branch-1.8.1+
|
Details | Diff | Splinter Review |
.
Why? How?
| Assignee | ||
Comment 2•20 years ago
|
||
(In reply to comment #1) > Why? How? This is related to Bug 258238. If someone wants to implement something like X+V, we should support namespaced ID attributes. Also Bug 275196 is relevant. And don't we want to support DOM 3 Core? The current idea is to set an ID flag to the nsDOMAttribute, there should be some spare bits. Of course Bug 235512 should be fixed first.
Comment 3•19 years ago
|
||
The W3C REC for elements shows setIdAttribute, setIdAttributeNS, and setIdAttributeNode -- nothing about getIdAttribute*. What getters are you referring to?
| Assignee | ||
Comment 4•19 years ago
|
||
oops, it should be Attr.isId.
Summary: add support for DOM 3 getIdAttribute* / setIdAttribute* → add support for DOM 3 Attr.isId and setIdAttribute*
Comment 5•19 years ago
|
||
Okay, that makes more sense. I was about to file a bug for Attr.isId. To support "mutation-resistant" XPath generators that don't happily live in content (aka "external parties"), they need to know if an attribute attached to an element is an ID-type attribute. To implement this, we need interfaces for nsIDOM3Attr and nsIDOM3TypeInfo (the latter so we don't break idl).
Blocks: XPathGenerator
Comment 6•19 years ago
|
||
This patch adds nsIDOM3Attr and nsIDOM3TypeInfo from W3C DOM Level 3 Core (as nsIDOMAttr is frozen), and leaves schemaTypeInfo under NS_ERROR_NOT_IMPLEMENTED. Tested on http://www.mozilla.org/projects/seamonkey/start/ : document.body.attributes[0].nodeName == "class" document.body.attributes[0].isId == false document.body.attributes[1].nodeName == "id" document.body.attributes[1].isId == true
Attachment #209657 -
Flags: superreview?(jst)
Attachment #209657 -
Flags: review?(jst)
Comment 7•19 years ago
|
||
Comment on attachment 209657 [details] [diff] [review] Implement nsIDOM3Attr::IsId() - In nsDOMAttribute::GetIsId(PRBool* aReturn): + nsAutoString name; + GetName(name); + + *aReturn = idAtom->Equals(name); This will make attributes in a namespace whose name happen to match the id attribute name ('id') also appear to be id's, even if they're not. The check here needs to be: *aReturn = mNodeInfo->Equals(idAtom, kNameSpaceID_None); This will do the right thing, since for now we don't support having ID's in a namespace (and this is faster and less code too, e.g. no string). r+sr=jst with that fixed. This obviously only fixes part of this bug (the easy part), the other part requires some non-trivial getElementById() plumbing changes to get right.
Attachment #209657 -
Flags: superreview?(jst)
Attachment #209657 -
Flags: superreview+
Attachment #209657 -
Flags: review?(jst)
Attachment #209657 -
Flags: review+
Comment 8•19 years ago
|
||
Attachment #209657 -
Attachment is obsolete: true
Comment 9•19 years ago
|
||
Checked in that patch.
Comment 10•19 years ago
|
||
Comment on attachment 209796 [details] [diff] [review] Updated IsId() patch to jst's comments. +#include "nsIDOM3TypeInfo.idl" why not forward-declare this, to avoid unnecessary includes and speed up compilation time (a little bit at least)?
Comment 11•19 years ago
|
||
Comment on attachment 209796 [details] [diff] [review] Updated IsId() patch to jst's comments. I believe this patch to be relatively safe for Fx2/SM1.5; it simply implements nsIDOM3Attr::IsId() for attribute nodes. The patch has been on the trunk for a couple of weeks.
Attachment #209796 -
Flags: branch-1.8.1?(jst)
Updated•19 years ago
|
Attachment #209796 -
Flags: approval-branch-1.8.1?(jst) → approval-branch-1.8.1+
Updated•15 years ago
|
QA Contact: ian → general
Comment 12•13 years ago
|
||
This functionality is removed in DOM4.
Awesome
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
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
•