Changeset 276679 in webkit
- Timestamp:
- Apr 27, 2021 4:40:17 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/img-picture-ancestor-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/img-picture-ancestor.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLImageElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/parser/HTMLConstructionSite.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r276656 r276679 1 2021-04-27 Cameron McCormack <heycam@apple.com> 2 3 Associate a picture element with an img only if the img is a direct child. 4 https://bugs.webkit.org/show_bug.cgi?id=225044 5 6 Reviewed by Ryosuke Niwa. 7 8 * web-platform-tests/html/semantics/embedded-content/the-img-element/img-picture-ancestor-expected.txt: Added. 9 * web-platform-tests/html/semantics/embedded-content/the-img-element/img-picture-ancestor.html: Added. 10 1 11 2021-04-27 Alexey Shvayka <shvaikalesh@gmail.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r276678 r276679 1 2021-04-27 Cameron McCormack <heycam@apple.com> 2 3 Associate a picture element with an img only if the img is a direct child. 4 https://bugs.webkit.org/show_bug.cgi?id=225044 5 6 Reviewed by Ryosuke Niwa. 7 8 Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/img-picture-ancestor.html 9 10 * html/HTMLImageElement.cpp: 11 (WebCore::HTMLImageElement::insertedIntoAncestor): 12 (WebCore::HTMLImageElement::removedFromAncestor): 13 * html/parser/HTMLConstructionSite.cpp: 14 (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): 15 1 16 2021-04-27 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r275076 r276679 383 383 treeScope().addImageElementByUsemap(*m_parsedUsemap.impl(), *this); 384 384 385 if (is<HTMLPictureElement>(&parentOfInsertedTree)) { 385 if (is<HTMLPictureElement>(&parentOfInsertedTree) && &parentOfInsertedTree == parentElement()) { 386 // FIXME: When the hack in HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface to eagerly call setPictureElement is removed, we can just assert !pictureElement(). 387 ASSERT(!pictureElement() || pictureElement() == &parentOfInsertedTree); 386 388 setPictureElement(&downcast<HTMLPictureElement>(parentOfInsertedTree)); 389 // FIXME: We should unconditionally call selectImageSource so that source selection is performed even for <img> elements outside the document. 387 390 if (insertionType.connectedToDocument) { 388 391 selectImageSource(RelevantMutation::Yes); … … 412 415 oldParentOfRemovedTree.treeScope().removeImageElementByUsemap(*m_parsedUsemap.impl(), *this); 413 416 414 if (is<HTMLPictureElement>(oldParentOfRemovedTree)) { 417 if (is<HTMLPictureElement>(oldParentOfRemovedTree) && !parentElement()) { 418 ASSERT(pictureElement() == &oldParentOfRemovedTree); 415 419 setPictureElement(nullptr); 420 // FIXME: We should call selectImageSource so that source selection is performed, now that we no longer have a <picture> context. 416 421 m_imageLoader->updateFromElementIgnoringPreviousError(RelevantMutation::Yes); 417 422 } -
trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp
r259523 r276679 696 696 // FIXME: This is a hack to connect images to pictures before the image has 697 697 // been inserted into the document. It can be removed once asynchronous image 698 // loading is working. 698 // loading is working. When this hack is removed, the assertion just before 699 // the setPictureElement() call in HTMLImageElement::insertedIntoAncestor 700 // can be simplified. 699 701 if (is<HTMLPictureElement>(currentNode()) && is<HTMLImageElement>(*element)) 700 702 downcast<HTMLImageElement>(*element).setPictureElement(&downcast<HTMLPictureElement>(currentNode()));
Note: See TracChangeset
for help on using the changeset viewer.