[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
abarth at webkit.org
abarth at webkit.org
Wed Jan 20 22:13:07 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit d060a98a7ba028ad4a30e2e53d2c1008e4518b1c
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 5 19:06:29 2010 +0000
2010-01-05 Nate Chapin <japhet at chromium.org>
Reviewed by Adam Barth.
Move allowSetting{Frame}SrcToJavascriptUrl from V8Custom to BindingSecurity and
remove the v8-specific pieces.
https://bugs.webkit.org/show_bug.cgi?id=33182
* bindings/BindingSecurity.h:
(WebCore::::allowSettingFrameSrcToJavascriptUrl): Moved from V8CustomBinding.cpp.
(WebCore::::allowSettingSrcToJavascriptURL): Moved from V8CustomBinding.cpp.
* bindings/v8/custom/V8AttrCustom.cpp:
(WebCore::V8Attr::valueAccessorSetter):
* bindings/v8/custom/V8CustomBinding.cpp:
* bindings/v8/custom/V8CustomBinding.h:
* bindings/v8/custom/V8ElementCustom.cpp:
(WebCore::V8Element::setAttributeCallback):
(WebCore::V8Element::setAttributeNodeCallback):
(WebCore::V8Element::setAttributeNSCallback):
(WebCore::V8Element::setAttributeNodeNSCallback):
* bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
(WebCore::V8HTMLFrameElement::srcAccessorSetter):
(WebCore::V8HTMLFrameElement::locationAccessorSetter):
* bindings/v8/custom/V8HTMLIFrameElementCustom.cpp:
(WebCore::V8HTMLIFrameElement::srcAccessorSetter):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 649132d..d17f9aa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-01-05 Nate Chapin <japhet at chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move allowSetting{Frame}SrcToJavascriptUrl from V8Custom to BindingSecurity and
+ remove the v8-specific pieces.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33182
+
+ * bindings/BindingSecurity.h:
+ (WebCore::::allowSettingFrameSrcToJavascriptUrl): Moved from V8CustomBinding.cpp.
+ (WebCore::::allowSettingSrcToJavascriptURL): Moved from V8CustomBinding.cpp.
+ * bindings/v8/custom/V8AttrCustom.cpp:
+ (WebCore::V8Attr::valueAccessorSetter):
+ * bindings/v8/custom/V8CustomBinding.cpp:
+ * bindings/v8/custom/V8CustomBinding.h:
+ * bindings/v8/custom/V8ElementCustom.cpp:
+ (WebCore::V8Element::setAttributeCallback):
+ (WebCore::V8Element::setAttributeNodeCallback):
+ (WebCore::V8Element::setAttributeNSCallback):
+ (WebCore::V8Element::setAttributeNodeNSCallback):
+ * bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
+ (WebCore::V8HTMLFrameElement::srcAccessorSetter):
+ (WebCore::V8HTMLFrameElement::locationAccessorSetter):
+ * bindings/v8/custom/V8HTMLIFrameElementCustom.cpp:
+ (WebCore::V8HTMLIFrameElement::srcAccessorSetter):
+
2010-01-05 Adam Barth <abarth at webkit.org>
Reviewed by Dimitri Glazkov.
diff --git a/WebCore/bindings/generic/BindingSecurity.h b/WebCore/bindings/generic/BindingSecurity.h
index cd01403..929b8f4 100644
--- a/WebCore/bindings/generic/BindingSecurity.h
+++ b/WebCore/bindings/generic/BindingSecurity.h
@@ -32,7 +32,10 @@
#define BindingSecurity_h
#include "BindingSecurityBase.h"
+#include "CSSHelper.h"
+#include "Element.h"
#include "GenericBinding.h"
+#include "HTMLFrameElementBase.h"
namespace WebCore {
@@ -51,6 +54,9 @@ public:
// current security context.
static bool checkNodeSecurity(State<Binding>*, Node* target);
+ static bool allowSettingFrameSrcToJavascriptUrl(State<Binding>*, HTMLFrameElementBase*, String value);
+ static bool allowSettingSrcToJavascriptURL(State<Binding>*, Element*, String name, String value);
+
private:
explicit BindingSecurity() {}
~BindingSecurity();
@@ -102,6 +108,25 @@ bool BindingSecurity<Binding>::checkNodeSecurity(State<Binding>* state, Node* no
return canAccessFrame(state, target, true);
}
+template <class Binding>
+bool BindingSecurity<Binding>::allowSettingFrameSrcToJavascriptUrl(State<Binding>* state, HTMLFrameElementBase* frame, String value)
+{
+ if (protocolIsJavaScript(deprecatedParseURL(value))) {
+ Node* contentDoc = frame->contentDocument();
+ if (contentDoc && !checkNodeSecurity(state, contentDoc))
+ return false;
+ }
+ return true;
+}
+
+template <class Binding>
+bool BindingSecurity<Binding>::allowSettingSrcToJavascriptURL(State<Binding>* state, Element* element, String name, String value)
+{
+ if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag)) && equalIgnoringCase(name, "src"))
+ return allowSettingFrameSrcToJavascriptUrl(state, static_cast<HTMLFrameElementBase*>(element), value);
+ return true;
+}
+
}
#endif // BindingSecurity_h
diff --git a/WebCore/bindings/v8/custom/V8AttrCustom.cpp b/WebCore/bindings/v8/custom/V8AttrCustom.cpp
index 929f00b..b85da2e 100644
--- a/WebCore/bindings/v8/custom/V8AttrCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8AttrCustom.cpp
@@ -35,6 +35,7 @@
#include "Element.h"
#include "ExceptionCode.h"
#include "V8Binding.h"
+#include "V8BindingState.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
@@ -46,7 +47,7 @@ void V8Attr::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value
String attrValue = toWebCoreStringWithNullCheck(value);
Element* ownerElement = imp->ownerElement();
- if (ownerElement && !allowSettingSrcToJavascriptURL(ownerElement, imp->name(), attrValue))
+ if (ownerElement && !V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), ownerElement, imp->name(), attrValue))
return;
ExceptionCode ec = 0;
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.cpp b/WebCore/bindings/v8/custom/V8CustomBinding.cpp
index 572a51b..de40fae 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.cpp
@@ -49,23 +49,6 @@
namespace WebCore {
-bool allowSettingFrameSrcToJavascriptUrl(HTMLFrameElementBase* frame, String value)
-{
- if (protocolIs(deprecatedParseURL(value), "javascript")) {
- Node* contentDoc = frame->contentDocument();
- if (contentDoc && !V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), contentDoc))
- return false;
- }
- return true;
-}
-
-bool allowSettingSrcToJavascriptURL(Element* element, String name, String value)
-{
- if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag)) && equalIgnoringCase(name, "src"))
- return allowSettingFrameSrcToJavascriptUrl(static_cast<HTMLFrameElementBase*>(element), value);
- return true;
-}
-
// --------------- Security Checks -------------------------
INDEXED_ACCESS_CHECK(History)
{
diff --git a/WebCore/bindings/v8/custom/V8CustomBinding.h b/WebCore/bindings/v8/custom/V8CustomBinding.h
index 4461d6a..e9b2f1c 100644
--- a/WebCore/bindings/v8/custom/V8CustomBinding.h
+++ b/WebCore/bindings/v8/custom/V8CustomBinding.h
@@ -78,9 +78,6 @@ namespace WebCore {
class String;
class V8Proxy;
- bool allowSettingFrameSrcToJavascriptUrl(HTMLFrameElementBase*, String value);
- bool allowSettingSrcToJavascriptURL(Element*, String name, String value);
-
class V8Custom {
public:
// Constants.
diff --git a/WebCore/bindings/v8/custom/V8ElementCustom.cpp b/WebCore/bindings/v8/custom/V8ElementCustom.cpp
index dee6133..9924aa8 100644
--- a/WebCore/bindings/v8/custom/V8ElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8ElementCustom.cpp
@@ -42,6 +42,7 @@
#include "V8Attr.h"
#include "V8Binding.h"
+#include "V8BindingState.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
@@ -56,7 +57,7 @@ v8::Handle<v8::Value> V8Element::setAttributeCallback(const v8::Arguments& args)
String name = toWebCoreString(args[0]);
String value = toWebCoreString(args[1]);
- if (!allowSettingSrcToJavascriptURL(element, name, value))
+ if (!V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), element, name, value))
return v8::Undefined();
ExceptionCode ec = 0;
@@ -76,7 +77,7 @@ v8::Handle<v8::Value> V8Element::setAttributeNodeCallback(const v8::Arguments& a
Attr* newAttr = V8DOMWrapper::convertDOMWrapperToNode<Attr>(v8::Handle<v8::Object>::Cast(args[0]));
Element* element = V8DOMWrapper::convertDOMWrapperToNode<Element>(args.Holder());
- if (!allowSettingSrcToJavascriptURL(element, newAttr->name(), newAttr->value()))
+ if (!V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), element, newAttr->name(), newAttr->value()))
return v8::Undefined();
ExceptionCode ec = 0;
@@ -95,7 +96,7 @@ v8::Handle<v8::Value> V8Element::setAttributeNSCallback(const v8::Arguments& arg
String qualifiedName = toWebCoreString(args[1]);
String value = toWebCoreString(args[2]);
- if (!allowSettingSrcToJavascriptURL(element, qualifiedName, value))
+ if (!V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), element, qualifiedName, value))
return v8::Undefined();
ExceptionCode ec = 0;
@@ -115,7 +116,7 @@ v8::Handle<v8::Value> V8Element::setAttributeNodeNSCallback(const v8::Arguments&
Attr* newAttr = V8DOMWrapper::convertDOMWrapperToNode<Attr>(v8::Handle<v8::Object>::Cast(args[0]));
Element* element = V8DOMWrapper::convertDOMWrapperToNode<Element>(args.Holder());
- if (!allowSettingSrcToJavascriptURL(element, newAttr->name(), newAttr->value()))
+ if (!V8BindingSecurity::allowSettingSrcToJavascriptURL(V8BindingState::Only(), element, newAttr->name(), newAttr->value()))
return v8::Undefined();
ExceptionCode ec = 0;
diff --git a/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
index 3746001..d459133 100644
--- a/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
@@ -34,6 +34,7 @@
#include "HTMLFrameElement.h"
#include "HTMLNames.h"
#include "V8Binding.h"
+#include "V8BindingState.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
@@ -46,7 +47,7 @@ void V8HTMLFrameElement::srcAccessorSetter(v8::Local<v8::String> name, v8::Local
HTMLFrameElement* frame = V8DOMWrapper::convertDOMWrapperToNode<HTMLFrameElement>(info.Holder());
String srcValue = toWebCoreStringWithNullCheck(value);
- if (!allowSettingFrameSrcToJavascriptUrl(frame, srcValue))
+ if (!V8BindingSecurity::allowSettingFrameSrcToJavascriptUrl(V8BindingState::Only(), frame, srcValue))
return;
frame->setAttribute(srcAttr, srcValue);
@@ -57,7 +58,7 @@ void V8HTMLFrameElement::locationAccessorSetter(v8::Local<v8::String> name, v8::
HTMLFrameElement* frame = V8DOMWrapper::convertDOMWrapperToNode<HTMLFrameElement>(info.Holder());
String locationValue = toWebCoreStringWithNullCheck(value);
- if (!allowSettingFrameSrcToJavascriptUrl(frame, locationValue))
+ if (!V8BindingSecurity::allowSettingFrameSrcToJavascriptUrl(V8BindingState::Only(), frame, locationValue))
return;
frame->setLocation(locationValue);
diff --git a/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp b/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp
index 5071c1f..105beb2 100644
--- a/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLIFrameElementCustom.cpp
@@ -34,6 +34,7 @@
#include "HTMLIFrameElement.h"
#include "HTMLNames.h"
#include "V8Binding.h"
+#include "V8BindingState.h"
#include "V8CustomBinding.h"
#include "V8Proxy.h"
@@ -46,7 +47,7 @@ void V8HTMLIFrameElement::srcAccessorSetter(v8::Local<v8::String> name, v8::Loca
HTMLIFrameElement* iframe = V8DOMWrapper::convertDOMWrapperToNode<HTMLIFrameElement>(info.Holder());
String v = toWebCoreStringWithNullCheck(value);
- if (!allowSettingFrameSrcToJavascriptUrl(iframe, v))
+ if (!V8BindingSecurity::allowSettingFrameSrcToJavascriptUrl(V8BindingState::Only(), iframe, v))
return;
iframe->setAttribute(srcAttr, v);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list