WebKit Bugzilla
Attachment 358990 Details for
Bug 193378
: Release assert with <img usemap> in shadow tree
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
usemap-scope-2.patch (text/plain), 4.49 KB, created by
Antti Koivisto
on 2019-01-12 01:02:33 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-01-12 01:02:33 PST
Size:
4.49 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 239896) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2019-01-11 Antti Koivisto <antti@apple.com> >+ >+ Release assert with <img usemap> in shadow tree >+ https://bugs.webkit.org/show_bug.cgi?id=193378 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try >+ to remove the map from the scope of the host. >+ >+ * html/HTMLImageElement.cpp: >+ (WebCore::HTMLImageElement::parseAttribute): >+ (WebCore::HTMLImageElement::insertedIntoAncestor): >+ (WebCore::HTMLImageElement::removedFromAncestor): >+ >+ Tree scope changes are relevant, not the connection to the document. >+ > 2019-01-11 Myles C. Maxfield <mmaxfield@apple.com> > > [WHLSL] Implement the NameResolver >Index: Source/WebCore/html/HTMLImageElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLImageElement.cpp (revision 239896) >+++ Source/WebCore/html/HTMLImageElement.cpp (working copy) >@@ -227,12 +227,12 @@ void HTMLImageElement::parseAttribute(co > } else if (name == srcAttr || name == srcsetAttr || name == sizesAttr) > selectImageSource(); > else if (name == usemapAttr) { >- if (isConnected() && !m_parsedUsemap.isNull()) >+ if (isInTreeScope() && !m_parsedUsemap.isNull()) > treeScope().removeImageElementByUsemap(*m_parsedUsemap.impl(), *this); > > m_parsedUsemap = parseHTMLHashNameReference(value); > >- if (isConnected() && !m_parsedUsemap.isNull()) >+ if (isInTreeScope() && !m_parsedUsemap.isNull()) > treeScope().addImageElementByUsemap(*m_parsedUsemap.impl(), *this); > } else if (name == compositeAttr) { > // FIXME: images don't support blend modes in their compositing attribute. >@@ -356,7 +356,7 @@ Node::InsertedIntoAncestorResult HTMLIma > if (insertionType.connectedToDocument && hasEditableImageAttribute()) > insertNotificationRequest = InsertedIntoAncestorResult::NeedsPostInsertionCallback; > >- if (insertionType.connectedToDocument && !m_parsedUsemap.isNull()) >+ if (insertionType.treeScopeChanged && !m_parsedUsemap.isNull()) > treeScope().addImageElementByUsemap(*m_parsedUsemap.impl(), *this); > > if (is<HTMLPictureElement>(parentNode())) { >@@ -383,7 +383,7 @@ void HTMLImageElement::removedFromAncest > if (m_form) > m_form->removeImgElement(this); > >- if (removalType.disconnectedFromDocument && !m_parsedUsemap.isNull()) >+ if (removalType.treeScopeChanged && !m_parsedUsemap.isNull()) > oldParentOfRemovedTree.treeScope().removeImageElementByUsemap(*m_parsedUsemap.impl(), *this); > > if (is<HTMLPictureElement>(parentNode())) >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 239896) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,12 @@ >+2019-01-11 Antti Koivisto <antti@apple.com> >+ >+ Release assert with <img usemap> in shadow tree >+ https://bugs.webkit.org/show_bug.cgi?id=193378 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/shadow-dom/image-map-tree-scope.html: >+ > 2019-01-11 John Wilander <wilander@apple.com> > > Compile out Web API Statistics Collection >Index: LayoutTests/fast/shadow-dom/image-map-tree-scope-expected.txt >=================================================================== >--- LayoutTests/fast/shadow-dom/image-map-tree-scope-expected.txt (revision 239896) >+++ LayoutTests/fast/shadow-dom/image-map-tree-scope-expected.txt (working copy) >@@ -1 +1 @@ >-This test passes if it doesn't crash. >+This test passes if it doesn't crash. >Index: LayoutTests/fast/shadow-dom/image-map-tree-scope.html >=================================================================== >--- LayoutTests/fast/shadow-dom/image-map-tree-scope.html (revision 239896) >+++ LayoutTests/fast/shadow-dom/image-map-tree-scope.html (working copy) >@@ -6,7 +6,7 @@ if (window.testRunner) > > function test() { > var shadow = host.attachShadow({mode: "open"}); >- shadow.innerHTML = '<map name="bar">'; >+ shadow.innerHTML = '<map name="bar"></map><img usemap="#bar">'; > host.remove(); > } > </script> >@@ -14,6 +14,7 @@ function test() { > <body onload="test()"> > This test passes if it doesn't crash. > <map id="map" name="foo"></map> >+<img usemap="#foo"> > <div id="host"></div> > </body> > </html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193378
:
358985
|
358988
|
358989
| 358990