Closed Bug 1110129 Opened 10 years ago Closed 10 years ago

repetitive appendChild of a <video> to the same element stops the video

Categories

(Core :: Audio/Video, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: yury, Unassigned)

References

Details

Attachments

(1 file)

I found difference between Firefox and Chrome behavior while fixing the bug 1108796. Looks like Chrome does not perform anything in appendChild if the child element is already in its place in the DOM; e.g. div.appendChild(video); will not stop the video if it is already appended to the div. For comparison, the video stops in Firefox.
Component: DOM: Core & HTML → Video/Audio
Per spec, div.appendChild(video) must have exactly the same observable behavior as doing these steps: video.remove(); div.appendChild(video); Is that not the case in Chrome?
Flags: needinfo?(ydelendik)
(In reply to Boris Zbarsky (Vacation Dec 15-31) [:bz] from comment #1) > > Is that not the case in Chrome? It is not. It looks like Chromium is doing if-already-last-child-of optimization [1]. You are right -- the spec does not define this type of optimization. won't fix? [1] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/dom/ContainerNode.cpp&rcl=1418267803&l=693
That blink behavior is totally nuts. Please file a chromium bug.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(ydelendik)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: