Closed Bug 609856 Opened 15 years ago Closed 14 years ago

Implement Node.parentElement

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 685798

People

(Reporter: Ms2ger, Assigned: Ms2ger)

References

()

Details

(Whiteboard: [wdc][needs tests])

Attachments

(1 file)

Web DOM Core formally defines it, and all our colleagues already support it.
Pardon my asking a peanut gallery question, but why is parentElement a good idea? As far as I can tell, it's just the parent node (unless the parent node isn't an element, in which case the parentElement property is null). Sounds more like an optimization (skipping the nodeType check on the parent node) than an actual improvement.
Attached patch Patch v1Splinter Review
Still needs tests.
Attachment #511947 - Flags: review?(jonas)
If we expect people to use this extensively (do we?) we should quickstub and fast-path it....
Comment on attachment 511947 [details] [diff] [review] Patch v1 r=me, though don't land this unless you also have tests checking things like nodes inside documents and nodes inside docfragments. And by nodes I mean both textnodes and elements. But yeah, fast-pathing also seems like something we should do.
Attachment #511947 - Flags: review?(jonas) → review+
Whiteboard: [wdc] → [wdc][needs tests]
Keywords: dev-doc-needed
Dupping forward to bug with better patch.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Keywords: dev-doc-needed
Great, thanks.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: