Title: [208102] trunk
Revision
208102
Author
[email protected]
Date
2016-10-29 06:46:52 -0700 (Sat, 29 Oct 2016)

Log Message

REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=163922

Patch by Youenn Fablet <[email protected]> on 2016-10-29
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/security/cached-svg-image-with-css-cross-domain.html

Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients.
Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data.

* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::setBodyDataFrom):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setBodyDataFrom):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::mayTryReplaceEncodedData):

LayoutTests:

* http/tests/security/cached-svg-image-with-css-cross-domain-expected.html: Added.
* http/tests/security/cached-svg-image-with-css-cross-domain.html: Added.
* platform/mac/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (208101 => 208102)


--- trunk/LayoutTests/ChangeLog	2016-10-29 13:44:27 UTC (rev 208101)
+++ trunk/LayoutTests/ChangeLog	2016-10-29 13:46:52 UTC (rev 208102)
@@ -1,5 +1,16 @@
 2016-10-29  Youenn Fablet  <[email protected]>
 
+        REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=163922
+
+        Reviewed by Alex Christensen.
+
+        * http/tests/security/cached-svg-image-with-css-cross-domain-expected.html: Added.
+        * http/tests/security/cached-svg-image-with-css-cross-domain.html: Added.
+        * platform/mac/TestExpectations:
+
+2016-10-29  Youenn Fablet  <[email protected]>
+
         REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds
         https://bugs.webkit.org/show_bug.cgi?id=163814
         <rdar://problem/28917420>

Added: trunk/LayoutTests/http/tests/security/cached-svg-image-with-css-cross-domain-expected.html (0 => 208102)


--- trunk/LayoutTests/http/tests/security/cached-svg-image-with-css-cross-domain-expected.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/security/cached-svg-image-with-css-cross-domain-expected.html	2016-10-29 13:46:52 UTC (rev 208102)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <link rel="stylesheet" type="text/css" href=""
+  </head>
+  <body>
+    <h1>WebKit bug</h1>
+    <h3>SVG circle with different-origin CSS. Ensure reuse caching over different origins work</h3>
+    <p>Expected: 2 orange circles.</p>
+    <p>
+      <span class="image">
+        <svg height="68" width="68" viewBox="-34 -34 68 68">
+          <circle cx="0" cy="0" r="24" stroke="red" stroke-width="2" fill="orange" />
+        </svg>	
+      </span>
+    </p>
+    <p>
+      <span class="image">
+        <svg height="68" width="68" viewBox="-34 -34 68 68">
+          <circle cx="0" cy="0" r="24" stroke="red" stroke-width="2" fill="orange" />
+        </svg>	
+      </span>
+    </p>
+  </body>
+</html>

Added: trunk/LayoutTests/http/tests/security/cached-svg-image-with-css-cross-domain.html (0 => 208102)


--- trunk/LayoutTests/http/tests/security/cached-svg-image-with-css-cross-domain.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/security/cached-svg-image-with-css-cross-domain.html	2016-10-29 13:46:52 UTC (rev 208102)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <link rel="stylesheet" type="text/css" href=""
+  </head>
+   <body>
+    <h1>WebKit bug</h1>
+    <h3>SVG circle with different-origin CSS. Ensure reuse caching over different origins work</h3>
+    <p>Expected: 2 orange circles.</p>
+    <script>
+function onFirstFrameLoaded()
+{
+    document.getElementById("frame2").innerHTML =
+        '<iframe src="" width="68" height="68" sandbox="" _onload_="onSecondFrameLoaded()"></iframe>';
+}
+
+function onSecondFrameLoaded()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+if (window.testRunner)
+    testRunner.waitUntilDone();
+    </script>
+    <p id="frame1">
+      <iframe src="" width="68" height="68" _onload_="onFirstFrameLoaded()"></iframe>
+    </p>
+    <p id="frame2">
+    </p>
+  </body>
+</html>

Modified: trunk/LayoutTests/platform/mac/TestExpectations (208101 => 208102)


--- trunk/LayoutTests/platform/mac/TestExpectations	2016-10-29 13:44:27 UTC (rev 208101)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2016-10-29 13:46:52 UTC (rev 208102)
@@ -1456,7 +1456,5 @@
 webkit.org/b/163307 [ Debug ] loader/stateobjects/replacestate-size-iframe.html [ Skip ]
 webkit.org/b/163307 [ Debug ] loader/stateobjects/replacestate-size.html [ Skip ]
 
-webkit.org/b/163922 http/tests/security/svg-image-with-css-cross-domain.html [ Pass ImageOnlyFailure ]
-
 webkit.org/b/164088 [ Yosemite ] media/modern-media-controls/scrubber-support/scrubber-support-click.html [ Skip ]
 webkit.org/b/164088 [ Yosemite ] media/modern-media-controls/scrubber-support/scrubber-support-drag.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (208101 => 208102)


--- trunk/Source/WebCore/ChangeLog	2016-10-29 13:44:27 UTC (rev 208101)
+++ trunk/Source/WebCore/ChangeLog	2016-10-29 13:46:52 UTC (rev 208102)
@@ -1,5 +1,24 @@
 2016-10-29  Youenn Fablet  <[email protected]>
 
+        REGRESSION (r207754): LayoutTest http/tests/security/svg-image-with-css-cross-domain.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=163922
+
+        Reviewed by Alex Christensen.
+
+        Test: http/tests/security/cached-svg-image-with-css-cross-domain.html
+
+        Raw data was not copied in cloned CachedCSSStyleSheet while it is used by some of its clients.
+        Updated CachedCSSStyleSheet and CachedImage cloning to copy its raw data.
+
+        * loader/cache/CachedCSSStyleSheet.cpp:
+        (WebCore::CachedCSSStyleSheet::setBodyDataFrom):
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::setBodyDataFrom):
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::mayTryReplaceEncodedData):
+
+2016-10-29  Youenn Fablet  <[email protected]>
+
         REGRESSION (Safari 10 / r189445): WKWebView and WebView no longer allow async XMLHttpRequest timeout to exceed 60 seconds
         https://bugs.webkit.org/show_bug.cgi?id=163814
         <rdar://problem/28917420>

Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (208101 => 208102)


--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp	2016-10-29 13:44:27 UTC (rev 208101)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp	2016-10-29 13:46:52 UTC (rev 208102)
@@ -92,6 +92,8 @@
     ASSERT(resource.type() == type());
     const CachedCSSStyleSheet& sheet = static_cast<const CachedCSSStyleSheet&>(resource);
 
+    CachedResource::setBodyDataFrom(resource);
+
     m_decoder = sheet.m_decoder;
     m_decodedSheetText = sheet.m_decodedSheetText;
     if (sheet.m_parsedStyleSheetCache)

Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (208101 => 208102)


--- trunk/Source/WebCore/loader/cache/CachedImage.cpp	2016-10-29 13:44:27 UTC (rev 208101)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp	2016-10-29 13:46:52 UTC (rev 208102)
@@ -96,6 +96,8 @@
     ASSERT(resource.type() == type());
     const CachedImage& image = static_cast<const CachedImage&>(resource);
 
+    CachedResource::setBodyDataFrom(resource);
+
     m_image = image.m_image;
 
     if (m_image && is<SVGImage>(*m_image))

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (208101 => 208102)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2016-10-29 13:44:27 UTC (rev 208101)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2016-10-29 13:46:52 UTC (rev 208102)
@@ -282,6 +282,8 @@
 
     virtual void didReplaceSharedBufferContents() { }
 
+    virtual void setBodyDataFrom(const CachedResource&);
+
     // FIXME: Make the rest of these data members private and use functions in derived classes instead.
     HashCountedSet<CachedResourceClient*> m_clients;
     ResourceRequest m_resourceRequest;
@@ -301,7 +303,6 @@
 
     virtual void checkNotify();
     virtual bool mayTryReplaceEncodedData() const { return false; }
-    virtual void setBodyDataFrom(const CachedResource&);
 
     std::chrono::microseconds freshnessLifetime(const ResourceResponse&) const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to