[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:38:34 UTC 2010


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

            Reviewed by Darin Adler.
    
            https://bugs.webkit.org/show_bug.cgi?id=50165
            CSS style rules don't GC protect parents
    
            Tests: fast/dom/StyleSheet/gc-parent-rule.html
                   fast/dom/StyleSheet/gc-parent-stylesheet.html
    
            * bindings/js/JSCSSRuleCustom.cpp: (WebCore::JSCSSRule::markChildren): Mark parents. The code
            is super naive compared to what we have for nodes - but CSSOM has shallow hierarchies, so
            it should be OK.
    
            * css/CSSRule.idl: Added CustomMarkFunction.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72819 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d13ab66..980ee63 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/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=50165
+        CSS style rules don't GC protect parents
+
+        * fast/dom/StyleSheet/gc-parent-rule-expected.txt: Added.
+        * fast/dom/StyleSheet/gc-parent-rule.html: Added.
+        * fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt: Added.
+        * fast/dom/StyleSheet/gc-parent-stylesheet.html: Added.
+
 2010-11-29  Ojan Vafai  <ojan at chromium.org>
 
         Unreviewed. Build fix.
diff --git a/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt b/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt
new file mode 100644
index 0000000..e35d26d
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt
@@ -0,0 +1,10 @@
+Test that CSS rules don't lose custom properties on GC when only reachable through child rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS rule.parentRule.foo is "bar"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/StyleSheet/gc-parent-rule.html b/LayoutTests/fast/dom/StyleSheet/gc-parent-rule.html
new file mode 100644
index 0000000..b8f9bab
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/gc-parent-rule.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<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 child rules.");
+
+function test()
+{
+    var sheet = document.implementation.createCSSStyleSheet("title", "screen");
+    sheet.insertRule("@media all { div { color:black } }", 0);
+    rule = sheet.rules[0].cssRules[0];
+    rule.parentRule.foo = "bar";
+    sheet = null;
+
+    gc();
+    setTimeout(function() {
+        gc();
+        shouldBe('rule.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/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt b/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt
new file mode 100644
index 0000000..16514ee
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt
@@ -0,0 +1,10 @@
+Test that CSS stylesheets don't lose custom properties on GC when only reachable through child rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS rule.parentStyleSheet.foo is "0"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet.html b/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet.html
new file mode 100644
index 0000000..51426e9
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<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 stylesheets don't lose custom properties on GC when only reachable through child rules.");
+
+function test()
+{
+    var sheet = document.implementation.createCSSStyleSheet("title", "screen");
+    sheet.foo = "0";
+    sheet.insertRule("div { color:black }", 0);
+    rule = sheet.rules[0];
+    sheet = null;
+    
+    gc();
+    setTimeout(function() {
+        gc();
+        shouldBe('rule.parentStyleSheet.foo', '"0"');
+        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 de53492..fe8f9f6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-29  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=50165
+        CSS style rules don't GC protect parents
+
+        Tests: fast/dom/StyleSheet/gc-parent-rule.html
+               fast/dom/StyleSheet/gc-parent-stylesheet.html
+
+        * bindings/js/JSCSSRuleCustom.cpp: (WebCore::JSCSSRule::markChildren): Mark parents. The code
+        is super naive compared to what we have for nodes - but CSSOM has shallow hierarchies, so
+        it should be OK.
+
+        * css/CSSRule.idl: Added CustomMarkFunction.
+
 2010-11-29  Gavin Peters  <gavinp at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/bindings/js/JSCSSRuleCustom.cpp b/WebCore/bindings/js/JSCSSRuleCustom.cpp
index 20b3ab4..4d226d0 100644
--- a/WebCore/bindings/js/JSCSSRuleCustom.cpp
+++ b/WebCore/bindings/js/JSCSSRuleCustom.cpp
@@ -47,6 +47,17 @@ using namespace JSC;
 
 namespace WebCore {
 
+void JSCSSRule::markChildren(MarkStack& markStack)
+{
+    Base::markChildren(markStack);
+
+    if (CSSStyleSheet* parentStyleSheet = impl()->parentStyleSheet())
+        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), parentStyleSheet);
+
+    if (CSSRule* parentRule = impl()->parentRule())
+        markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), parentRule);
+}
+
 JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, CSSRule* rule)
 {
     if (!rule)
diff --git a/WebCore/css/CSSRule.idl b/WebCore/css/CSSRule.idl
index 82a1dee..170a801 100644
--- a/WebCore/css/CSSRule.idl
+++ b/WebCore/css/CSSRule.idl
@@ -22,6 +22,7 @@ module css {
 
     // Introduced in DOM Level 2:
     interface [
+        CustomMarkFunction,
         CustomToJS,
         Polymorphic
     ] CSSRule {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list