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

weinig at apple.com weinig at apple.com
Wed Dec 22 13:10:26 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9868221da169ab810f7dc02f6c3618720adbe401
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 8 05:56:00 2010 +0000

    DatasetDOMStringMap does not have the right memory model
    https://bugs.webkit.org/show_bug.cgi?id=45358
    
    Reviewed by Dan Bernstein.
    
    WebCore:
    
    Test: fast/dom/dataset-gc.html
    
    * bindings/js/JSElementCustom.cpp:
    (WebCore::JSElement::markChildren):
    Mark the dataset if it exists.
    
    * dom/Element.cpp:
    (WebCore::Element::optionalDataset):
    * dom/Element.h:
    Expose a way to get the dataset or null (depending on if anyone thing
    has forced its creation yet).
    
    LayoutTests:
    
    Test that the dataset persists gc.
    
    * fast/dom/dataset-gc-expected.txt: Added.
    * fast/dom/dataset-gc.html: Added.
    * fast/dom/script-tests/dataset-gc.js: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66954 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 64880e0..d80a552 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-09-07  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        DatasetDOMStringMap does not have the right memory model
+        https://bugs.webkit.org/show_bug.cgi?id=45358
+
+        Test that the dataset persists gc.
+
+        * fast/dom/dataset-gc-expected.txt: Added.
+        * fast/dom/dataset-gc.html: Added.
+        * fast/dom/script-tests/dataset-gc.js: Added.
+
 2010-09-07  Jan E Hanssen  <jhanssen at sencha.com>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/fast/dom/dataset-gc-expected.txt b/LayoutTests/fast/dom/dataset-gc-expected.txt
new file mode 100644
index 0000000..fa3bd08
--- /dev/null
+++ b/LayoutTests/fast/dom/dataset-gc-expected.txt
@@ -0,0 +1,12 @@
+This tests that custom properties on element.dataset persist GC.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS d.dataset.__proto__ is non-null.
+PASS d.dataset.__proto__ is null
+PASS d.dataset.__proto__ is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/dataset-gc.html b/LayoutTests/fast/dom/dataset-gc.html
new file mode 100644
index 0000000..569fb8b
--- /dev/null
+++ b/LayoutTests/fast/dom/dataset-gc.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/dataset-gc.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/script-tests/dataset-gc.js b/LayoutTests/fast/dom/script-tests/dataset-gc.js
new file mode 100644
index 0000000..839f26d
--- /dev/null
+++ b/LayoutTests/fast/dom/script-tests/dataset-gc.js
@@ -0,0 +1,34 @@
+description("This tests that custom properties on element.dataset persist GC.");
+
+function gc()
+{
+    if (window.GCController)
+        return GCController.collect();
+
+    for (var i = 0; i < 10000; i++) {
+        var s = new String("");
+    }
+}
+
+
+var d = document.createElement("div");
+
+// Ensure the dataset is created.
+var dataset = d.dataset;
+
+// Ensure there is a __proto__ before test.
+shouldBeNonNull("d.dataset.__proto__");
+
+// Set __proto__ to non-starting value. (Must be null do to __proto__ restrictions).
+d.dataset.__proto__ = null;
+shouldBeNull("d.dataset.__proto__");
+
+// Null out reference to the dataset. 
+dataset = null;
+
+gc();
+
+// Test that the null persisted the GC.
+shouldBeNull("d.dataset.__proto__");
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5074903..e58c2bb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-07  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        DatasetDOMStringMap does not have the right memory model
+        https://bugs.webkit.org/show_bug.cgi?id=45358
+
+        Test: fast/dom/dataset-gc.html
+
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::JSElement::markChildren):
+        Mark the dataset if it exists.
+
+        * dom/Element.cpp:
+        (WebCore::Element::optionalDataset):
+        * dom/Element.h:
+        Expose a way to get the dataset or null (depending on if anyone thing
+        has forced its creation yet).
+
 2010-09-07  Jan E Hanssen  <jhanssen at sencha.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/bindings/js/JSElementCustom.cpp b/WebCore/bindings/js/JSElementCustom.cpp
index 23eda7e..8a1df5c 100644
--- a/WebCore/bindings/js/JSElementCustom.cpp
+++ b/WebCore/bindings/js/JSElementCustom.cpp
@@ -60,6 +60,8 @@ void JSElement::markChildren(MarkStack& markStack)
     JSGlobalData& globalData = *Heap::heap(this)->globalData();
 
     markDOMObjectWrapper(markStack, globalData, element->attributeMap());
+    markDOMObjectWrapper(markStack, globalData, element->optionalDataset());
+
     if (element->isStyledElement())
         markDOMObjectWrapper(markStack, globalData, static_cast<StyledElement*>(element)->inlineStyleDecl());
 }
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index 69bd160..6ff47e0 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -1558,6 +1558,13 @@ DOMStringMap* Element::dataset()
     return data->m_datasetDOMStringMap.get();
 }
 
+DOMStringMap* Element::optionalDataset() const
+{
+    if (!hasRareData())
+        return 0;
+    return rareData()->m_datasetDOMStringMap.get();
+}
+
 KURL Element::getURLAttribute(const QualifiedName& name) const
 {
 #if !ASSERT_DISABLED
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index 5bbddc2..d13d483 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -270,6 +270,7 @@ public:
     bool webkitMatchesSelector(const String& selectors, ExceptionCode&);
 
     DOMStringMap* dataset();
+    DOMStringMap* optionalDataset() const;
 
     virtual bool isFormControlElement() const { return false; }
     virtual bool isEnabledFormControl() const { return true; }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list