[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:48:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 866ff774472b9da183cd35b27e3530bdc82e7879
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jun 30 17:14:58 2004 +0000

    	Need to tighten up JS error checking for requesting drag props
    	in the wrong cases.
    
            Reviewed by John.
    
            * khtml/ecma/kjs_events.cpp:
            (Clipboard::getValueProperty):  Assert if someone somehow set
    	dropEffect or effectAllowed and it's a copy/paste clipboard
    	instead of a dragging clipboard.
            (Clipboard::putValue):  Don't let anyone set dropEffect or
    	effectAllowed on a copy/paste clipboard.
            (ClipboardProtoFunc::tryCall):  Disallow setting dragImage on
    	a copy/paste clipboard.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6953 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a3b252f..8668db6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,21 @@
 2004-06-29  Trey Matteson  <trey at apple.com>
 
+	Need to tighten up JS error checking for requesting drag props
+	in the wrong cases.
+
+        Reviewed by John.
+
+        * khtml/ecma/kjs_events.cpp:
+        (Clipboard::getValueProperty):  Assert if someone somehow set
+	dropEffect or effectAllowed and it's a copy/paste clipboard
+	instead of a dragging clipboard.
+        (Clipboard::putValue):  Don't let anyone set dropEffect or
+	effectAllowed on a copy/paste clipboard.
+        (ClipboardProtoFunc::tryCall):  Disallow setting dragImage on
+	a copy/paste clipboard.
+
+2004-06-29  Trey Matteson  <trey at apple.com>
+
 	DHTML dragging - source should have access to the operation chosen
 	by the destination.
 
diff --git a/WebCore/khtml/ecma/kjs_events.cpp b/WebCore/khtml/ecma/kjs_events.cpp
index 3b7ba69..2334c97 100644
--- a/WebCore/khtml/ecma/kjs_events.cpp
+++ b/WebCore/khtml/ecma/kjs_events.cpp
@@ -940,8 +940,6 @@ static Value stringOrUndefined(const DOM::DOMString &str)
     }
 }
 
-// FIXME lookups of dropEffect and effectAllowed should fail if !clipboard->isForDragging
-
 Value Clipboard::tryGet(ExecState *exec, const Identifier &propertyName) const
 {
     return DOMObjectLookupGetValue<Clipboard,DOMObject>(exec, propertyName, &ClipboardTable, this);
@@ -951,8 +949,10 @@ Value Clipboard::getValueProperty(ExecState *exec, int token) const
 {
     switch (token) {
         case DropEffect:
+            assert(clipboard->isForDragging() || clipboard->dropEffect().isNull());
             return stringOrUndefined(clipboard->dropEffect());
         case EffectAllowed:
+            assert(clipboard->isForDragging() || clipboard->effectAllowed().isNull());
             return stringOrUndefined(clipboard->effectAllowed());
         case Types:
         {
@@ -982,10 +982,14 @@ void Clipboard::putValue(ExecState *exec, int token, const Value& value, int /*a
 {
     switch (token) {
         case DropEffect:
-            clipboard->setDropEffect(value.toString(exec).string());
+            // can never set this when not for dragging, thus getting always returns NULL string
+            if (clipboard->isForDragging())
+                clipboard->setDropEffect(value.toString(exec).string());
             break;
         case EffectAllowed:
-            clipboard->setEffectAllowed(value.toString(exec).string());
+            // can never set this when not for dragging, thus getting always returns NULL string
+            if (clipboard->isForDragging())
+                clipboard->setEffectAllowed(value.toString(exec).string());
             break;
         default:
             kdWarning() << "Clipboard::putValue unhandled token " << token << endl;
@@ -1040,6 +1044,10 @@ Value ClipboardProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &
             }
         case Clipboard::SetDragImage:
         {
+            if (!cb->clipboard->isForDragging()) {
+                return Undefined();
+            }
+
             if (args.size() != 3) {
                 Object err = Error::create(exec, SyntaxError,"setDragImage: Invalid number of arguments");
                 exec->setException(err);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list