[CSS Shapes] CORS-enabled fetch for shape image values
[WebKit-https.git] / Source / WebCore / rendering / shapes / ShapeInfo.cpp
index c77cd1c..92b897b 100644 (file)
 #include "Shape.h"
 
 namespace WebCore {
+
+
+bool checkShapeImageOrigin(Document& document, CachedImage& cachedImage)
+{
+    if (cachedImage.isOriginClean(document.securityOrigin()))
+        return true;
+
+    const URL& url = cachedImage.url();
+    String urlString = url.isNull() ? "''" : url.stringCenterEllipsizedToLength();
+    document.addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Unsafe attempt to load URL " + urlString + ".");
+
+    return false;
+}
+
 template<class RenderType>
 const Shape* ShapeInfo<RenderType>::computedShape() const
 {