Closed Bug 895974 Opened 11 years ago Closed 11 years ago

document.firstElementChild is not defined

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: erik, Assigned: bzbarsky)

References

Details

(Keywords: dev-doc-complete)

Attachments

(2 files, 1 obsolete file)

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

Document should implement the ParentNode interface
Yeah, might as well.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
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-
Attachment #778900 - Flags: review?(bugs)
Attachment #778785 - Attachment is obsolete: true
Attached patch InterdiffSplinter Review
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
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 901632
Depends on: 932501
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: