[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

ap at apple.com ap at apple.com
Wed Dec 22 16:39:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 795b2ad5b30ccdf9ba3e24a070fbbaee1a78b502
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 29 22:24:12 2010 +0000

            Reviewed by Darin Adler.
    
            https://bugs.webkit.org/show_bug.cgi?id=50181
            CSS style declarations don't GC protect parents
    
            Test: fast/dom/StyleSheet/gc-declaration-parent-rule.html
    
            * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::markChildren):
            Protect the parent rule.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72833 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f8291bf..94de420 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-29  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50181
+        CSS style declarations don't GC protect parents
+
+        * fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt: Added.
+        * fast/dom/StyleSheet/gc-declaration-parent-rule.html: Added.
+
 2010-11-29  Gavin Peters  <gavinp at chromium.org>
 
         Reviewed by Ojan Vafai.
diff --git a/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt b/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt
new file mode 100644
index 0000000..90bd866
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt
@@ -0,0 +1,10 @@
+Test that CSS rules don't lose custom properties on GC when only reachable through its declarations.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS style.parentRule.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule.html b/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule.html
new file mode 100644
index 0000000..564fc27
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<style>
+div { color:black }
+</style>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css" type="text/css" title="js-test-style" />
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body onload="test()">
+<p id="description"></p>
+<div id="console"></div>
+<script>
+window.jsTestIsAsync = true;
+description("Test that CSS rules don't lose custom properties on GC when only reachable through its declarations.");
+
+function test()
+{
+    var sheet = document.styleSheets[0];
+    style = sheet.cssRules[0].style;
+    style.parentRule.foo = "bar";
+    document.getElementsByTagName("head")[0].removeChild(document.getElementsByTagName("style")[0]);
+    sheet = null;
+
+    gc();
+    setTimeout(function() {
+        gc();
+        shouldBe('style.parentRule.foo', '"bar"');
+        finishJSTest();
+    }, 0);
+}
+
+var successfullyParsed = true;
+</script>
+<foo id="mystyle" style="display:none">.div { color: white; }</foo>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 90feb55..d5625c5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-29  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50181
+        CSS style declarations don't GC protect parents
+
+        Test: fast/dom/StyleSheet/gc-declaration-parent-rule.html
+
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::markChildren):
+        Protect the parent rule.
+
 2010-11-29  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
index 458ad5b..1a448ee 100644
--- a/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
+++ b/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
@@ -47,6 +47,9 @@ void JSCSSStyleDeclaration::markChildren(MarkStack& markStack)
     CSSStyleDeclaration* declaration = impl();
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
+    if (CSSRule* parentRule = declaration->parentRule())
+        markDOMObjectWrapper(markStack, globalData, parentRule);
+
     if (declaration->isMutableStyleDeclaration()) {
         CSSMutableStyleDeclaration* mutableDeclaration = static_cast<CSSMutableStyleDeclaration*>(declaration);
         CSSMutableStyleDeclaration::const_iterator end = mutableDeclaration->end();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list