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

dumi at chromium.org dumi at chromium.org
Wed Dec 22 12:30:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 95948cdf6cac27f9beb32926ac31c27d4c2dc140
Author: dumi at chromium.org <dumi at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 24 21:42:33 2010 +0000

    WebCore: Fix the NodeFilter wrapper and the binding for acceptNode.
    https://bugs.webkit.org/show_bug.cgi?id=44542
    
    Reviewed by Dimitri Glazkov.
    
    * bindings/v8/V8DOMWrapper.cpp:
    (WebCore::V8DOMWrapper::wrapNativeNodeFilter): This function
    should always create a filter. V8NodeFilterCondition::acceptNode()
    will check if the given object can be used as a filter, and throw
    an exception if it can't.
    * bindings/v8/V8NodeFilterCondition.cpp:
    (WebCore::V8NodeFilterCondition::acceptNode): Update this binding
    to do the same thing that the JS binding does.
    
    LayoutTests: acceptNode-filter.html should pass after this patch.
    https://bugs.webkit.org/show_bug.cgi?id=44542
    
    Reviewed by Dimitri Glazkov.
    
    * platform/chromium/test_expectations.txt:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65937 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b58b54d..fde0974 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-24  Dumitru Daniliuc  <dumi at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        acceptNode-filter.html should pass after this patch.
+        https://bugs.webkit.org/show_bug.cgi?id=44542
+
+        * platform/chromium/test_expectations.txt:
+
 2010-08-24  Tony Chang  <tony at chromium.org>
 
         Reviewed by Ojan Vafai.
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index b9c76e4..13e51f4 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3202,9 +3202,6 @@ BUGWK44341 WIN LINUX : svg/clip-path/clip-path-childs-clipped.svg = IMAGE
 // Flaky on Linux
 BUG53131 LINUX : fast/js/array-iterate-backwards.html = CRASH PASS
 
-// http://trac.webkit.org/changeset/65824 didn't add V8 bindings for this test
-BUG53144 : fast/dom/TreeWalker/acceptNode-filter.html = TEXT
-
 // new or failing since WebKit rev. 65740:65800
 BUG21852 MAC : fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html = TEXT
 BUG53073 WIN : fast/repaint/multicol-repaint.html = IMAGE+TEXT
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a351b4a..2f5a889 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-24  Dumitru Daniliuc  <dumi at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix the NodeFilter wrapper and the binding for acceptNode.
+        https://bugs.webkit.org/show_bug.cgi?id=44542
+
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::wrapNativeNodeFilter): This function
+        should always create a filter. V8NodeFilterCondition::acceptNode()
+        will check if the given object can be used as a filter, and throw
+        an exception if it can't.
+        * bindings/v8/V8NodeFilterCondition.cpp:
+        (WebCore::V8NodeFilterCondition::acceptNode): Update this binding
+        to do the same thing that the JS binding does.
+
 2010-08-24  Simon Fraser  <simon.fraser at apple.com>
 
         Reviewed by Tony Chang.
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index 9e44b56..921f957 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -222,9 +222,6 @@ PassRefPtr<NodeFilter> V8DOMWrapper::wrapNativeNodeFilter(v8::Handle<v8::Value>
     // to NodeFilter. NodeFilter has a ref counted pointer to NodeFilterCondition.
     // In NodeFilterCondition, filter object is persisted in its constructor,
     // and disposed in its destructor.
-    if (!filter->IsFunction())
-        return 0;
-
     return NodeFilter::create(V8NodeFilterCondition::create(filter));
 }
 
diff --git a/WebCore/bindings/v8/V8NodeFilterCondition.cpp b/WebCore/bindings/v8/V8NodeFilterCondition.cpp
index 2170698..4e0240d 100644
--- a/WebCore/bindings/v8/V8NodeFilterCondition.cpp
+++ b/WebCore/bindings/v8/V8NodeFilterCondition.cpp
@@ -62,13 +62,24 @@ short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const
 {
     ASSERT(v8::Context::InContext());
 
-    if (!m_filter->IsFunction())
+    if (!m_filter->IsObject())
         return NodeFilter::FILTER_ACCEPT;
 
     v8::TryCatch exceptionCatcher;
 
+    v8::Handle<v8::Function> callback;
+    if (m_filter->IsFunction())
+        callback = v8::Handle<v8::Function>::Cast(m_filter);
+    else {
+        v8::Local<v8::Value> value = m_filter->ToObject()->Get(v8::String::New("acceptNode"));
+        if (!value->IsFunction()) {
+            V8Proxy::throwError(V8Proxy::TypeError, "NodeFilter object does not have an acceptNode function");
+            return NodeFilter::FILTER_REJECT;
+        }
+        callback = v8::Handle<v8::Function>::Cast(value);
+    }
+
     v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
-    v8::Handle<v8::Function> callback = v8::Handle<v8::Function>::Cast(m_filter);
     OwnArrayPtr<v8::Handle<v8::Value> > args(new v8::Handle<v8::Value>[1]);
     args[0] = toV8(node);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list