document.firstElementChild is not defined

RESOLVED FIXED in mozilla25

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Erik Arvidsson, Assigned: bz)

Tracking

({dev-doc-complete})

unspecified
mozilla25
x86_64
Linux
dev-doc-complete
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

4 years ago
http://dom.spec.whatwg.org/#interface-parentnode

Document should implement the ParentNode interface
Yeah, might as well.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Created attachment 778785 [details] [diff] [review]
Implement ParentNode on document fragments and documents and move previousElementSibling and nextElementSibling to ChildNode.
Attachment #778785 - Flags: review?(bugs)

Comment 3

4 years ago
Comment on attachment 778785 [details] [diff] [review]
Implement ParentNode on document fragments and documents and move previousElementSibling and nextElementSibling to ChildNode.

Could you test also .children, and the patch is missing ParentNode.webidl file.
Attachment #778785 - Flags: review?(bugs) → review-
Created attachment 778900 [details] [diff] [review]
With review comments addressed
Attachment #778900 - Flags: review?(bugs)
Attachment #778785 - Attachment is obsolete: true
Created attachment 778901 [details] [diff] [review]
Interdiff

Comment 6

4 years ago
Comment on attachment 778900 [details] [diff] [review]
With review comments addressed

Thanks, the interdiff was good.
Attachment #778900 - Flags: review?(bugs) → review+
Comment on attachment 778900 [details] [diff] [review]
With review comments addressed

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

::: content/base/src/nsINode.cpp
@@ +1407,5 @@
> +Element*
> +nsINode::GetPreviousElementSibling() const
> +{
> +  nsIContent* previousSibling = GetPreviousSibling();
> +  while (previousSibling) {

Nit: a for loop like you have in GetFirstElementChild() seems nicer.
> Nit: a for loop like you have in GetFirstElementChild() seems nicer.

Hmm.. I guess; I just moved the code.

In any case, I pushed this before I saw the nit comment: https://hg.mozilla.org/integration/mozilla-inbound/rev/0a196c0e9f96
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla25
Either this patch or the patch from bug 895974 (pushed at the same time) was causing frequent mochitest-1 asserts on the Ubuntu32 test slaves. Backed out.
https://hg.mozilla.org/integration/mozilla-inbound/rev/3794beed0e34

https://tbpl.mozilla.org/php/getParsedLog.php?id=25574572&tree=Mozilla-Inbound

13:26:23     INFO -  [Parent 2282] ###!!! ASSERTION: Clock should go forwards if the playback rate is > 0.: 'mCurrentFrameTime <= clock_time || mPlaybackRate <= 0', file ../../../content/media/MediaDecoderStateMachine.cpp, line 2435
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::GetClock() [content/media/MediaDecoderStateMachine.cpp:2434]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::AdvanceFrame() [content/media/MediaDecoderStateMachine.cpp:2462]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::RunStateMachine() [content/media/MediaDecoderStateMachine.cpp:2235]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::CallRunStateMachine() [content/media/MediaDecoderStateMachine.cpp:2741]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::Run() [content/media/MediaDecoderStateMachine.cpp:2715]
13:26:23     INFO -  nsThread::ProcessNextEvent(bool, bool*) [xpcom/threads/nsThread.cpp:621]
13:26:23     INFO -  NS_ProcessNextEvent(nsIThread*, bool) [obj-firefox/xpcom/build/nsThreadUtils.cpp:238]
13:26:23     INFO -  nsThread::ThreadFunc(void*) [xpcom/threads/nsThread.cpp:249]
13:26:23     INFO -  _pt_root [nsprpub/pr/src/pthreads/ptthread.c:207]
13:26:23     INFO -  libpthread.so.0 + 0x6d4c
13:26:23     INFO -  [Parent 2282] ###!!! ASSERTION: Should have positive clock time.: 'clock_time >= mStartTime', file ../../../content/media/MediaDecoderStateMachine.cpp, line 2462
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::AdvanceFrame() [content/media/MediaDecoderStateMachine.cpp:2462]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::RunStateMachine() [content/media/MediaDecoderStateMachine.cpp:2235]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::CallRunStateMachine() [content/media/MediaDecoderStateMachine.cpp:2741]
13:26:23     INFO -  mozilla::MediaDecoderStateMachine::Run() [content/media/MediaDecoderStateMachine.cpp:2715]
13:26:23     INFO -  nsThread::ProcessNextEvent(bool, bool*) [xpcom/threads/nsThread.cpp:621]
13:26:23     INFO -  NS_ProcessNextEvent(nsIThread*, bool) [obj-firefox/xpcom/build/nsThreadUtils.cpp:238]
13:26:23     INFO -  nsThread::ThreadFunc(void*) [xpcom/threads/nsThread.cpp:249]
13:26:23     INFO -  _pt_root [nsprpub/pr/src/pthreads/ptthread.c:207]
13:26:23     INFO -  libpthread.so.0 + 0x6d4c
This patch was the one that triggered those assertions, but they're due to bugs in the test.  Annotated the test, and relanded:  https://hg.mozilla.org/integration/mozilla-inbound/rev/5b59f2f35bb3
https://hg.mozilla.org/mozilla-central/rev/5b59f2f35bb3
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Keywords: dev-doc-needed
Depends on: 901632
I updated the documentation:
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode.children
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode.firstElementChild
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode.lastElementChild
https://developer.mozilla.org/en-US/docs/Web/API/ParentNode.childElementCount
https://developer.mozilla.org/en-US/docs/Web/API/ChildNode
https://developer.mozilla.org/en-US/docs/Web/API/ChildNode.previousElementSibling
https://developer.mozilla.org/en-US/docs/Web/API/ChildNode.nextElementSibling
https://developer.mozilla.org/en-US/docs/Web/API/Element
https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment
https://developer.mozilla.org/en-US/docs/Web/API/Document
https://developer.mozilla.org/en-US/docs/Web/API/CharacterData
https://developer.mozilla.org/en-US/docs/Web/API/DocumentType

and
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/25
Keywords: dev-doc-needed → dev-doc-complete

Updated

4 years ago
Depends on: 932501
You need to log in before you can comment on or make changes to this bug.