haikuwebkit/LayoutTests/fast/images/imagemap-in-shadow-tree-exp...

6 lines
170 B
Plaintext
Raw Permalink Normal View History

Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add https://bugs.webkit.org/show_bug.cgi?id=185238 Reviewed by Antti Koivisto. Source/WebCore: The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope. Test: fast/images/imagemap-in-nested-shadow-tree.html fast/images/imagemap-in-shadow-tree.html * dom/Document.cpp: (WebCore::Document::addImageElementByUsemap): Moved to TreeScope. (WebCore::Document::removeImageElementByUsemap): Ditto. (WebCore::Document::imageElementByUsemap const): Ditto. * dom/Document.h: * dom/TreeScope.cpp: (WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName. (WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap() which used to call this function with the raw value of the usemap content attribute now calls it via HTMLImageElement::associatedMapElement(), which uses the parsed usemap. (WebCore::TreeScope::addImageElementByUsemap): Moved from Document. (WebCore::TreeScope::removeImageElementByUsemap): Ditto. (WebCore::TreeScope::imageElementByUsemap const): Ditto. * dom/TreeScope.h: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element if it's connected to a document. (WebCore::HTMLImageElement::removedFromAncestor): (WebCore::HTMLImageElement::associatedMapElement const): * html/HTMLImageElement.h: * html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::imageElement): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageMap const): LayoutTests: * fast/images/imagemap-in-nested-shadow-tree-expected.txt: Added. * fast/images/imagemap-in-nested-shadow-tree.html: Added. * fast/images/imagemap-in-shadow-tree-expected.txt: Added. * fast/images/imagemap-in-shadow-tree.html: Added. Canonical link: https://commits.webkit.org/200762@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-05-03 21:34:10 +00:00
This tests activing an image map area inside a shadow tree. WebKit should not hit any assertions.
To manually test, click on green box on the left upper quadrant.
PASS