Release assert when removing element with a map element in the shadow tree
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2019 22:38:24 +0000 (22:38 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2019 22:38:24 +0000 (22:38 +0000)
commit204fff80b382779b3963fa873e42ce269c205cbe
treed0dce74fbc98c203a188602cbc8d1336166ed845
parent54ba62ba368f4cbec10f023cb72e3b458cd08f43
Release assert when removing element with a map element in the shadow tree
https://bugs.webkit.org/show_bug.cgi?id=193351
<rdar://problem/47208807>

Reviewed by Ryosuke Niwa.

Source/WebCore:

When a shadow host that has a map element in the shadow tree is removed from the document, we try
to remove the map from the scope of the host.

Test: fast/shadow-dom/image-map-tree-scope.html

* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::insertedIntoAncestor):
(WebCore::HTMLMapElement::removedFromAncestor):

Add and remove image maps when the scope changes, not when the document changes.
This matches how id/name/etc updates work in the HTMLElement.

LayoutTests:

* fast/shadow-dom/image-map-tree-scope-expected.txt: Added.
* fast/shadow-dom/image-map-tree-scope.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/shadow-dom/image-map-tree-scope-expected.txt [new file with mode: 0644]
LayoutTests/fast/shadow-dom/image-map-tree-scope.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMapElement.cpp