Changeset 214842 in webkit


Ignore:
Timestamp:
Apr 3, 2017 3:06:51 PM (7 years ago)
Author:
Chris Dumez
Message:

REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
https://bugs.webkit.org/show_bug.cgi?id=170285
<rdar://problem/31378543>

Reviewed by Andy Estes.

Source/WebCore:

r206744 caused up to stop trying to resolve relative URLs when trying to load an image
referred to by CSS. We already try to resolve the relative URL when parsing the CSS
property so this will usually work fine. However, in the case when the CSS property
is parsed in detached document and then moved to another document, we will not have
the complete URL.

Test: fast/images/background-image-relative-url-changes-document.html

  • css/CSSImageValue.cpp:

(WebCore::CSSImageValue::loadImage):

LayoutTests:

Add layout test coverage.

  • fast/images/background-image-relative-url-changes-document-expected.html: Added.
  • fast/images/background-image-relative-url-changes-document.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r214834 r214842  
     12017-04-03  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=170285
     5        <rdar://problem/31378543>
     6
     7        Reviewed by Andy Estes.
     8
     9        Add layout test coverage.
     10
     11        * fast/images/background-image-relative-url-changes-document-expected.html: Added.
     12        * fast/images/background-image-relative-url-changes-document.html: Added.
     13
    1142017-04-03  John Wilander  <wilander@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r214831 r214842  
     12017-04-03  Chris Dumez  <cdumez@apple.com>
     2
     3        REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
     4        https://bugs.webkit.org/show_bug.cgi?id=170285
     5        <rdar://problem/31378543>
     6
     7        Reviewed by Andy Estes.
     8
     9        r206744 caused up to stop trying to resolve relative URLs when trying to load an image
     10        referred to by CSS. We already try to resolve the relative URL when parsing the CSS
     11        property so this will usually work fine. However, in the case when the CSS property
     12        is parsed in detached document and then moved to another document, we will not have
     13        the complete URL.
     14
     15        Test: fast/images/background-image-relative-url-changes-document.html
     16
     17        * css/CSSImageValue.cpp:
     18        (WebCore::CSSImageValue::loadImage):
     19
    1202017-04-03  Jeremy Jones  <jeremyj@apple.com>
    221
  • trunk/Source/WebCore/css/CSSImageValue.cpp

    r210828 r214842  
    6767        m_accessedImage = true;
    6868
    69         CachedResourceRequest request(ResourceRequest(m_url), options);
     69        CachedResourceRequest request(ResourceRequest(loader.document()->completeURL(m_url.string())), options);
    7070        if (m_initiatorName.isEmpty())
    7171            request.setInitiator(cachedResourceRequestInitiators().css);
Note: See TracChangeset for help on using the changeset viewer.