Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2017 00:03:18 +0000 (00:03 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2017 00:03:18 +0000 (00:03 +0000)
commita447f5ad3e241a23f1be64e55a2ab7590601951e
tree22c291b4f643a13e7416f4d2f47cda02a2aaea80
parent24f6331fe0c495a048473c770a33f46332e5d4cf
Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
https://bugs.webkit.org/show_bug.cgi?id=178607

Reviewed by Eric Carlson.

Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
semantically sensisble. Since these elements are only functional when their immediate parents are
HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
some of its ancestor had changed by insertion or removal.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedInto):
(WebCore::HTMLTrackElement::removedFrom):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp