Last Comment Bug 685798 - Node.parentElement not implemented
: Node.parentElement not implemented
Status: RESOLVED FIXED
: addon-compat, dev-doc-complete
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla9
Assigned To: Olli Pettay [:smaug]
:
: Andrew Overholt [:overholt]
Mentors:
http://host0001.webd.pl/bugs/firefox/...
: 609856 (view as bug list)
Depends on: 748725
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-09 00:48 PDT by bugzilla33
Modified: 2012-04-25 05:02 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (905 bytes, text/html)
2011-09-09 00:48 PDT, bugzilla33
no flags Details
patch (8.95 KB, patch)
2011-09-09 06:56 PDT, Olli Pettay [:smaug]
bzbarsky: review+
Details | Diff | Splinter Review
+iid updates (134.87 KB, patch)
2011-09-11 16:09 PDT, Olli Pettay [:smaug]
no flags Details | Diff | Splinter Review

Description bugzilla33 2011-09-09 00:48:01 PDT
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
Comment 1 bugzilla33 2011-09-09 00:48:33 PDT
Created attachment 559394 [details]
testcase
Comment 2 bugzilla33 2011-09-09 00:49:23 PDT
Note: document.documentElement.parentElement MUST alerts null unlike document.documentElement.parentNode
Comment 3 bugzilla33 2011-09-09 00:50:27 PDT
IE, Chrome, Safari, Opera and Konqueror support parentElement
Comment 4 Olli Pettay [:smaug] 2011-09-09 02:08:16 PDT
(Opera at least doesn't seem to support parentElement in all the nodes. Chrome does. Don't know about others)
Comment 5 Anne (:annevk) 2011-09-09 05:59:12 PDT
Opera has an open bug on moving parentElement elsewhere. We are waiting on feedback from Gecko (or an implementation) before moving ahead.
Comment 6 Olli Pettay [:smaug] 2011-09-09 06:56:13 PDT
Created attachment 559443 [details] [diff] [review]
patch
Comment 7 Mounir Lamouri (:mounir) 2011-09-09 07:03:39 PDT
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?
Comment 8 Olli Pettay [:smaug] 2011-09-09 07:14:14 PDT
I should be clear in the context it is in.
But I can change the text.
Comment 9 Alex Vincent [:WeirdAl] 2011-09-09 08:03:03 PDT
We already have a bug on file for this...

*** This bug has been marked as a duplicate of bug 609856 ***
Comment 10 Boris Zbarsky [:bz] (still a bit busy) 2011-09-09 08:57:09 PDT
Ms2ger, you planning to land that patch?  ;)
Comment 11 Boris Zbarsky [:bz] (still a bit busy) 2011-09-09 08:59:23 PDT
Actually, reopening this bug, since this patch is better than the old one.
Comment 12 Boris Zbarsky [:bz] (still a bit busy) 2011-09-09 09:00:10 PDT
*** Bug 609856 has been marked as a duplicate of this bug. ***
Comment 13 Boris Zbarsky [:bz] (still a bit busy) 2011-09-09 09:01:40 PDT
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.
Comment 14 Olli Pettay [:smaug] 2011-09-11 16:09:59 PDT
Created attachment 559798 [details] [diff] [review]
+iid updates
Comment 16 Eric Shepherd [:sheppy] 2011-11-08 06:27:56 PST
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.

Note You need to log in before you can comment on or make changes to this bug.