Changeset 164804 in webkit
- Timestamp:
- Feb 27, 2014 7:52:28 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164795 r164804 1 2014-02-27 Antoine Quint <graouts@webkit.org> 2 3 Respect SVG fragment identifiers in <img> src attribute 4 https://bugs.webkit.org/show_bug.cgi?id=129387 5 6 Reviewed by Antti Koivisto. 7 8 Test that we correctly handle the fragment identifier used in SVG URLs in <img> elements, 9 checking for correct srcset handling as well. 10 11 * svg/css/resources/fragment-identifiers.svg: Added. 12 * svg/css/svg-resource-fragment-identifier-img-src-expected.html: Added. 13 * svg/css/svg-resource-fragment-identifier-img-src.html: Added. 14 1 15 2014-02-27 Mihai Tica <mitica@adobe.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r164802 r164804 1 2014-02-27 Antoine Quint <graouts@webkit.org> 2 3 Respect SVG fragment identifiers in <img> src attribute 4 https://bugs.webkit.org/show_bug.cgi?id=129387 5 6 Reviewed by Antti Koivisto. 7 8 Test: svg/css/svg-resource-fragment-identifier-img-src.html 9 10 When providing an SVG image for a given renderer, check that the URL used to load 11 that image is taken into account in case it featured a fragment identifier, ensuring 12 that the CSS :target pseudo-class is correctly handled for SVG resources. This patch 13 is specific to <img> elements, specific support will also need to be added for various 14 CSS properties that support SVG images. 15 16 * svg/graphics/SVGImageCache.cpp: 17 (WebCore::SVGImageCache::imageForRenderer): 18 Check if the provided renderer is attached to an <img> element and, if so, pass the 19 resolved <img> source URL, taking into account srcset, to the SVGImageForContainer. 20 21 * svg/graphics/SVGImageForContainer.cpp: 22 (WebCore::SVGImageForContainer::setURL): 23 Trigger the FrameView machinery to ensure that the :target pseudo-class is respected 24 should the provided URL feature a fragment identifier. 25 26 * svg/graphics/SVGImageForContainer.h: 27 Declare the new setURL() method. 28 1 29 2014-02-27 Krzysztof Czech <k.czech@samsung.com> 2 30 -
trunk/Source/WebCore/svg/graphics/SVGImageCache.cpp
r163440 r164804 24 24 #include "FrameView.h" 25 25 #include "GraphicsContext.h" 26 #include "HTMLImageElement.h" 26 27 #include "ImageBuffer.h" 27 28 #include "Page.h" … … 89 90 90 91 RefPtr<SVGImageForContainer> imageForContainer = it->value; 92 93 Node* node = renderer->node(); 94 if (node && isHTMLImageElement(node)) { 95 const AtomicString& urlString = toHTMLImageElement(node)->imageSourceURL(); 96 URL url = node->document().completeURL(urlString); 97 imageForContainer->setURL(url); 98 } 99 91 100 ASSERT(!imageForContainer->size().isEmpty()); 92 101 return imageForContainer.get(); -
trunk/Source/WebCore/svg/graphics/SVGImageForContainer.cpp
r163440 r164804 24 24 #include "FloatRect.h" 25 25 #include "FloatSize.h" 26 #include "FrameView.h" 26 27 #include "Image.h" 27 28 #include "SVGImage.h" … … 54 55 } 55 56 57 void SVGImageForContainer::setURL(const URL& url) 58 { 59 m_image->frameView()->scrollToFragment(url); 60 } 61 56 62 } // namespace WebCore -
trunk/Source/WebCore/svg/graphics/SVGImageForContainer.h
r163440 r164804 32 32 #include "Image.h" 33 33 #include "SVGImage.h" 34 #include "URL.h" 34 35 35 36 namespace WebCore { … … 45 46 46 47 virtual IntSize size() const override; 48 49 void setURL(const URL&); 47 50 48 51 virtual bool usesContainerSize() const override { return m_image->usesContainerSize(); }
Note: See TracChangeset
for help on using the changeset viewer.