[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

beidson at apple.com beidson at apple.com
Wed Apr 7 23:29:59 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 268419a907370e235c3d5830438053699e75df25
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 10 23:36:44 2009 +0000

    Repro crash saving pcmag.com article as a webarchive.
    <rdar://problem/7381219> and https://webkit.org/b/31322
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    Test: http/tests/webarchive/cross-origin-stylesheet-crash.html
    
    * css/CSSStyleSheet.cpp:
    (WebCore::CSSStyleSheet::addSubresourceStyleURLs): Walk the stylesheet itself instead
      of creating a CSSRuleList (and subjecting ourselves to the security origin check)
    
    LayoutTests:
    
    * http/tests/webarchive/cross-origin-stylesheet-crash.html: Added.
    * http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive: Added.
    * http/tests/webarchive/resources/localhost-stylesheet.css: Added.
    * platform/gtk/Skipped: Add this test to the gtk Skipped list which tracks all individual skipped tests
      instead of directories.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9718775..8d2ad66 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-10  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Repro crash saving pcmag.com article as a webarchive.
+        <rdar://problem/7381219> and https://webkit.org/b/31322
+
+        * http/tests/webarchive/cross-origin-stylesheet-crash.html: Added.
+        * http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive: Added.
+        * http/tests/webarchive/resources/localhost-stylesheet.css: Added.
+        * platform/gtk/Skipped: Add this test to the gtk Skipped list which tracks all individual skipped tests
+          instead of directories.
+
 2009-11-10  Brian Weinstein  <bweinstein at apple.com>
 
         Rubber-stamped by Anders Carlsson.
diff --git a/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive b/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive
new file mode 100644
index 0000000..10b1103
--- /dev/null
+++ b/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash-expected.webarchive
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>WebMainResource</key>
+	<dict>
+		<key>WebResourceData</key>
+		<string>&lt;html&gt;&lt;head&gt;
+&lt;script&gt;
+if (window.layoutTestController)
+    layoutTestController.dumpDOMAsWebArchive();
+&lt;/script&gt;
+&lt;link rel="stylesheet" href="http://localhost:8000/webarchive/resources/localhost-stylesheet.css" type="text/css"&gt;
+&lt;/head&gt;&lt;body&gt;
+This HTML links to an external stylesheet from a different security origin.&lt;br&gt;
+Making a webarchive of this page should not crash.
+
+
+&lt;/body&gt;&lt;/html&gt;</string>
+		<key>WebResourceFrameName</key>
+		<string></string>
+		<key>WebResourceMIMEType</key>
+		<string>text/html</string>
+		<key>WebResourceTextEncodingName</key>
+		<string>UTF-8</string>
+		<key>WebResourceURL</key>
+		<string>http://127.0.0.1:8000/webarchive/cross-origin-stylesheet-crash.html</string>
+	</dict>
+	<key>WebSubresources</key>
+	<array>
+		<dict>
+			<key>WebResourceData</key>
+			<string> </string>
+			<key>WebResourceMIMEType</key>
+			<string>text/css</string>
+			<key>WebResourceResponse</key>
+			<dict>
+				<key>MIMEType</key>
+				<string>text/css</string>
+				<key>URL</key>
+				<string>http://localhost:8000/webarchive/resources/localhost-stylesheet.css</string>
+				<key>allHeaderFields</key>
+				<dict>
+					<key>Accept-Ranges</key>
+					<string>bytes</string>
+					<key>Content-Length</key>
+					<string>1</string>
+					<key>Content-Type</key>
+					<string>text/css</string>
+					<key>Date</key>
+					<string>Sun, 16 Nov 2008 17:00:00 GMT</string>
+					<key>Etag</key>
+					<string>"301925-21-45c7d72d3e780"</string>
+					<key>Last-Modified</key>
+					<string>Sun, 16 Nov 2008 16:55:00 GMT</string>
+					<key>Server</key>
+					<string>Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l PHP/5.2.6</string>
+				</dict>
+				<key>expectedContentLength</key>
+				<integer>1</integer>
+				<key>statusCode</key>
+				<integer>200</integer>
+			</dict>
+			<key>WebResourceURL</key>
+			<string>http://localhost:8000/webarchive/resources/localhost-stylesheet.css</string>
+		</dict>
+	</array>
+</dict>
+</plist>
diff --git a/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash.html b/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash.html
new file mode 100644
index 0000000..82a18e3
--- /dev/null
+++ b/LayoutTests/http/tests/webarchive/cross-origin-stylesheet-crash.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpDOMAsWebArchive();
+</script>
+<link rel="stylesheet" href="http://localhost:8000/webarchive/resources/localhost-stylesheet.css" type="text/css">
+</head>
+<body>
+This HTML links to an external stylesheet from a different security origin.<br>
+Making a webarchive of this page should not crash.
+</body>
+</html>
diff --git a/JavaScriptCore/tests/mozilla/js1_6/Array/browser.js b/LayoutTests/http/tests/webarchive/resources/localhost-stylesheet.css
similarity index 100%
copy from JavaScriptCore/tests/mozilla/js1_6/Array/browser.js
copy to LayoutTests/http/tests/webarchive/resources/localhost-stylesheet.css
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 2fbb2f2..087a024 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -3567,6 +3567,7 @@ http/tests/navigation/postredirect-basic.html
 http/tests/navigation/postredirect-frames.html
 http/tests/navigation/postredirect-goback1.html
 http/tests/uri/css-href.php
+http/tests/webarchive/cross-origin-stylesheet-crash.html
 http/tests/webarchive/test-css-url-encoding-shift-jis.html
 http/tests/webarchive/test-css-url-encoding-utf-8.html
 http/tests/webarchive/test-css-url-encoding.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c1002af..13614b5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-10  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Repro crash saving pcmag.com article as a webarchive.
+        <rdar://problem/7381219> and https://webkit.org/b/31322
+
+        Test: http/tests/webarchive/cross-origin-stylesheet-crash.html
+
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::addSubresourceStyleURLs): Walk the stylesheet itself instead
+          of creating a CSSRuleList (and subjecting ourselves to the security origin check)
+
 2009-11-10  Beth Dakin  <bdakin at apple.com>
 
         Attempt 2 to fix Tiger build. No review needed.
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp
index 9e57336..7dc83cf 100644
--- a/WebCore/css/CSSStyleSheet.cpp
+++ b/WebCore/css/CSSStyleSheet.cpp
@@ -230,10 +230,12 @@ void CSSStyleSheet::addSubresourceStyleURLs(ListHashSet<KURL>& urls)
         CSSStyleSheet* styleSheet = styleSheetQueue.first();
         styleSheetQueue.removeFirst();
 
-        RefPtr<CSSRuleList> ruleList = styleSheet->cssRules();
-
-        for (unsigned i = 0; i < ruleList->length(); ++i) {
-            CSSRule* rule = ruleList->item(i);
+        for (unsigned i = 0; i < styleSheet->length(); ++i) {
+            StyleBase* styleBase = styleSheet->item(i);
+            if (!styleBase->isRule())
+                continue;
+            
+            CSSRule* rule = static_cast<CSSRule*>(styleBase);
             if (rule->isImportRule()) {
                 if (CSSStyleSheet* ruleStyleSheet = static_cast<CSSImportRule*>(rule)->styleSheet())
                     styleSheetQueue.append(ruleStyleSheet);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list