Extend the protector of a CSS style sheet. Because checkLoaded() can recursively...
authorgavinp@chromium.org <gavinp@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jul 2011 23:53:30 +0000 (23:53 +0000)
committergavinp@chromium.org <gavinp@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jul 2011 23:53:30 +0000 (23:53 +0000)
parent style elements, the protector should be extended to include the parent call.

https://bugs.webkit.org/show_bug.cgi?id=64736

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/css/css-imports-2.html

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::checkLoaded):

LayoutTests:

* fast/css/css-imports-2-expected.txt: Added.
* fast/css/css-imports-2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@91531 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css/css-imports-2-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/css-imports-2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSheet.cpp

index ae2f027..47f5e7b 100644 (file)
@@ -1,3 +1,15 @@
+2011-07-21  Gavin Peters  <gavinp@chromium.org>
+
+        Extend the protector of a CSS style sheet.  Because checkLoaded() can recursively delete
+        parent style elements, the protector should be extended to include the parent call.
+
+        https://bugs.webkit.org/show_bug.cgi?id=64736
+
+        Reviewed by Simon Fraser.
+
+        * fast/css/css-imports-2-expected.txt: Added.
+        * fast/css/css-imports-2.html: Added.
+
 2011-07-21  Ryosuke Niwa  <rniwa@webkit.org>
 
         Temporarily add failing test expectation for multi column tests after r91497.
diff --git a/LayoutTests/fast/css/css-imports-2-expected.txt b/LayoutTests/fast/css/css-imports-2-expected.txt
new file mode 100644 (file)
index 0000000..7ef22e9
--- /dev/null
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/css/css-imports-2.html b/LayoutTests/fast/css/css-imports-2.html
new file mode 100644 (file)
index 0000000..3b02c26
--- /dev/null
@@ -0,0 +1,9 @@
+<p><style>
+    @import url('resources/css-imports.css');
+</style>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+document.body.innerHTML = "PASS";
+</script>
+
index 1d43fbf..7d4a7d1 100644 (file)
@@ -1,3 +1,17 @@
+2011-07-21  Gavin Peters  <gavinp@chromium.org>
+
+        Extend the protector of a CSS style sheet.  Because checkLoaded() can recursively delete
+        parent style elements, the protector should be extended to include the parent call.
+
+        https://bugs.webkit.org/show_bug.cgi?id=64736
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/css/css-imports-2.html
+
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::checkLoaded):
+
 2011-07-21  Kenneth Russell  <kbr@google.com>
 
         Update webglcontextlost / webglcontextrestored delivery to match spec changes
index 2fc3f48..27c01e3 100644 (file)
@@ -220,13 +220,13 @@ void CSSStyleSheet::checkLoaded()
 {
     if (isLoading())
         return;
-    if (parent())
-        parent()->checkLoaded();
 
     // Avoid |this| being deleted by scripts that run via
     // ScriptableDocumentParser::executeScriptsWaitingForStylesheets().
     // See <rdar://problem/6622300>.
     RefPtr<CSSStyleSheet> protector(this);
+    if (parent())
+        parent()->checkLoaded();
     m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true;
 }