⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284894 in webkit


Ignore:
Timestamp:
Oct 26, 2021, 2:07:13 PM (5 years ago)
Author:
Chris Dumez
Message:

html/semantics/embedded-content/the-img-element/adoption.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=232320

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

  • web-platform-tests/html/semantics/embedded-content/the-img-element/adoption-expected.txt:

Source/WebCore:

When an <img> moves to a new document, we're supposed to update the image's data.
In HTMLImageElement::didMoveToNewDocument(), we would call HTMLPictureElement::sourcesChanged()
if the <img> element has a parent <picture> element, which would update the image's data.
However, in the absence of a parent <picture> element, we would do nothing. This patch calls
selectImageSource() when the <img> element as a src / srcset attribute to make sure the
image data gets updated.

No new tests, rebaselined existing test.

  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::didMoveToNewDocument):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r284883 r284894  
     12021-10-26  Chris Dumez  <cdumez@apple.com>
     2
     3        html/semantics/embedded-content/the-img-element/adoption.html is timing out
     4        https://bugs.webkit.org/show_bug.cgi?id=232320
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline WPT test that is now passing.
     9
     10        * web-platform-tests/html/semantics/embedded-content/the-img-element/adoption-expected.txt:
     11
    1122021-10-26  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/adoption-expected.txt

    r284667 r284894  
    11
    2 Harness Error (TIMEOUT), message = null
    3 
    4 TIMEOUT img (src only) Test timed out
     2PASS img (src only)
    53PASS img (src only), parent is picture
    64PASS img (src only), previous sibling is source
    7 TIMEOUT img (srcset 1 cand) Test timed out
     5PASS img (srcset 1 cand)
    86PASS img (srcset 1 cand), parent is picture
    97PASS img (srcset 1 cand), previous sibling is source
    10 FAIL adopt a cloned img in template assert_equals: expected "http://localhost:8800/images/green-1x1.png" but got "/images/green-1x1.png"
     8PASS adopt a cloned img in template
    119PASS adoption is from appendChild
    1210
  • trunk/Source/WebCore/ChangeLog

    r284888 r284894  
     12021-10-26  Chris Dumez  <cdumez@apple.com>
     2
     3        html/semantics/embedded-content/the-img-element/adoption.html is timing out
     4        https://bugs.webkit.org/show_bug.cgi?id=232320
     5
     6        Reviewed by Darin Adler.
     7
     8        When an <img> moves to a new document, we're supposed to update the image's data.
     9        In HTMLImageElement::didMoveToNewDocument(), we would call HTMLPictureElement::sourcesChanged()
     10        if the <img> element has a parent <picture> element, which would update the image's data.
     11        However, in the absence of a parent <picture> element, we would do nothing. This patch calls
     12        selectImageSource() when the <img> element as a src / srcset attribute to make sure the
     13        image data gets updated.
     14
     15        No new tests, rebaselined existing test.
     16
     17        * html/HTMLImageElement.cpp:
     18        (WebCore::HTMLImageElement::didMoveToNewDocument):
     19
    1202021-10-26  Tim Horton  <timothy_horton@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r284857 r284894  
    684684    if (RefPtr element = pictureElement())
    685685        element->sourcesChanged();
     686    else if (hasAttribute(srcAttr) || hasAttribute(srcsetAttr))
     687        selectImageSource(RelevantMutation::Yes);
    686688}
    687689
Note: See TracChangeset for help on using the changeset viewer.