The default bug view has changed. See this FAQ.

Node.parentElement not implemented

RESOLVED FIXED in mozilla9

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: bugzilla33, Assigned: smaug)

Tracking

({addon-compat, dev-doc-complete})

Trunk
mozilla9
addon-compat, dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0.2) Gecko/20100101 Firefox/6.0.2
Build ID: 20110902133214

Steps to reproduce:

1. open testcase
2. click TEST button


Actual results:

Node.parentElement not implemented


Expected results:

alerts: HTMLHtmlElement, null
(Reporter)

Comment 1

6 years ago
Created attachment 559394 [details]
testcase
(Reporter)

Updated

6 years ago
(Reporter)

Comment 2

6 years ago
Note: document.documentElement.parentElement MUST alerts null unlike document.documentElement.parentNode
(Reporter)

Comment 3

6 years ago
IE, Chrome, Safari, Opera and Konqueror support parentElement
(Assignee)

Comment 4

6 years ago
(Opera at least doesn't seem to support parentElement in all the nodes. Chrome does. Don't know about others)
(Assignee)

Updated

6 years ago
Assignee: nobody → Olli.Pettay
OS: Windows 7 → All
Hardware: x86 → All
Version: 7 Branch → Trunk
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 5

6 years ago
Opera has an open bug on moving parentElement elsewhere. We are waiting on feedback from Gecko (or an implementation) before moving ahead.
(Assignee)

Updated

6 years ago
Attachment #559394 - Attachment mime type: text/plain → text/html
(Assignee)

Comment 6

6 years ago
Created attachment 559443 [details] [diff] [review]
patch
Attachment #559443 - Flags: review?(bzbarsky)
Comment on attachment 559443 [details] [diff] [review]
patch

Review of attachment 559443 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/test/test_bug685798.html
@@ +35,5 @@
> +is(df.firstChild.firstChild.parentElement, df.firstChild,
> +   "Text node's parent should be element.");
> +
> +is(document.createTextNode("foo").parentElement, null,
> +   "Text node shouldn't have parent element.");

The test isn't clear: is it because it is a text node or because it is out of any document and has no parent?
(Assignee)

Comment 8

6 years ago
I should be clear in the context it is in.
But I can change the text.
We already have a bug on file for this...
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 609856
Ms2ger, you planning to land that patch?  ;)
Actually, reopening this bug, since this patch is better than the old one.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Duplicate of this bug: 609856
Comment on attachment 559443 [details] [diff] [review]
patch

Should the new prop go at the end of the interface to reduce the chance of people running into vtable issues?  Maybe it doesn't matter...

You need to rev the iids of all interfaces inheriting from nsIDOMNode.  Use http://people.mozilla.org/~sfink/uploads/update-uuids for that.

r=me with the latter fixed and the former at least considered.
Attachment #559443 - Flags: review?(bzbarsky) → review+

Updated

6 years ago
Keywords: dev-doc-needed
(Assignee)

Comment 14

6 years ago
Created attachment 559798 [details] [diff] [review]
+iid updates
(Assignee)

Comment 15

6 years ago
http://hg.mozilla.org/mozilla-central/rev/569a45bfb71c
http://hg.mozilla.org/mozilla-central/rev/5eba835c23a7
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Keywords: addon-compat
Documentation written:

https://developer.mozilla.org/en/DOM/Node.parentElement

Updated:

https://developer.mozilla.org/en/DOM/Node

Also listed on Firefox 9 for developers.
Keywords: dev-doc-needed → dev-doc-complete

Updated

5 years ago
Target Milestone: --- → mozilla9
Depends on: 748725
You need to log in before you can comment on or make changes to this bug.