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

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 12:56:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit dce3761b3030f6b8da4d5b90477c67ae142c6030
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 2 10:49:55 2010 +0000

    2010-09-01  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Darin Adler.
    
            DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document
            https://bugs.webkit.org/show_bug.cgi?id=44595
    
            Spec links:
            http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse
            http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren
    
            Test: fast/dom/Selection/wrong-document-err.html
    
            * page/DOMSelection.cpp:
            (WebCore::DOMSelection::collapse):
            (WebCore::DOMSelection::selectAllChildren):
    2010-09-01  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Darin Adler.
    
            DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document
            https://bugs.webkit.org/show_bug.cgi?id=44595
    
            Spec links:
            http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse
            http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren
    
            * fast/dom/Selection/script-tests/wrong-document-err.js: Added.
            * fast/dom/Selection/wrong-document-err-expected.txt: Added.
            * fast/dom/Selection/wrong-document-err.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66655 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index dfe4fb0..a7c01c8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-01  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document
+        https://bugs.webkit.org/show_bug.cgi?id=44595
+
+        Spec links:
+        http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse
+        http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren
+
+        * fast/dom/Selection/script-tests/wrong-document-err.js: Added.
+        * fast/dom/Selection/wrong-document-err-expected.txt: Added.
+        * fast/dom/Selection/wrong-document-err.html: Added.
+
 2010-09-02  Tony Gentilcore  <tonyg at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fad10df..cd24a83 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-09-01  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        DOM Selection: collapse() and selectAllChildren() should throw WRONG_DOCUMENT_ERR if node belongs to other document
+        https://bugs.webkit.org/show_bug.cgi?id=44595
+
+        Spec links:
+        http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-collapse
+        http://www.whatwg.org/specs/web-apps/current-work/#dom-selection-selectallchildren
+
+        Test: fast/dom/Selection/wrong-document-err.html
+
+        * page/DOMSelection.cpp:
+        (WebCore::DOMSelection::collapse):
+        (WebCore::DOMSelection::selectAllChildren):
+
 2010-09-02  Eric Seidel  <eric at webkit.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebCore/page/DOMSelection.cpp b/WebCore/page/DOMSelection.cpp
index 6c25103..0412be7 100644
--- a/WebCore/page/DOMSelection.cpp
+++ b/WebCore/page/DOMSelection.cpp
@@ -200,14 +200,22 @@ int DOMSelection::rangeCount() const
 
 void DOMSelection::collapse(Node* node, int offset, ExceptionCode& ec)
 {
-    if (!m_frame)
+    Document* selectionDocument = m_frame ? m_frame->document() : 0;
+    Document* nodeDocument = node ? node->document() : 0;
+
+    if (selectionDocument != nodeDocument) {
+        ec = WRONG_DOCUMENT_ERR;
         return;
+    }
 
     if (offset < 0) {
         ec = INDEX_SIZE_ERR;
         return;
     }
 
+    if (!m_frame)
+        return;
+
     if (!isValidForPosition(node))
         return;
 
@@ -488,6 +496,13 @@ void DOMSelection::selectAllChildren(Node* n, ExceptionCode& ec)
     if (!n)
         return;
 
+    Document* selectionDocument = m_frame ? m_frame->document() : 0;
+
+    if (selectionDocument != n->document()) {
+        ec = WRONG_DOCUMENT_ERR;
+        return;
+    }
+
     // This doesn't (and shouldn't) select text node characters.
     setBaseAndExtent(n, 0, n, n->childNodeCount(), ec);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list