diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /WebCore/bindings/js/JSElementCustom.cpp | |
parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebCore/bindings/js/JSElementCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSElementCustom.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/WebCore/bindings/js/JSElementCustom.cpp b/WebCore/bindings/js/JSElementCustom.cpp index c725290..7e294bd 100644 --- a/WebCore/bindings/js/JSElementCustom.cpp +++ b/WebCore/bindings/js/JSElementCustom.cpp @@ -36,6 +36,7 @@ #include "HTMLFrameElementBase.h" #include "HTMLNames.h" #include "JSAttr.h" +#include "JSDOMBinding.h" #include "JSHTMLElementWrapperFactory.h" #include "JSNodeList.h" #include "NodeList.h" @@ -63,21 +64,11 @@ void JSElement::markChildren(MarkStack& markStack) markDOMObjectWrapper(markStack, globalData, static_cast<StyledElement*>(element)->inlineStyleDecl()); } -static inline bool allowSettingSrcToJavascriptURL(ExecState* exec, Element* element, const String& name, const String& value) -{ - if ((element->hasTagName(iframeTag) || element->hasTagName(frameTag)) && equalIgnoringCase(name, "src") && protocolIsJavaScript(deprecatedParseURL(value))) { - Document* contentDocument = static_cast<HTMLFrameElementBase*>(element)->contentDocument(); - if (contentDocument && !checkNodeSecurity(exec, contentDocument)) - return false; - } - return true; -} - JSValue JSElement::setAttribute(ExecState* exec, const ArgList& args) { ExceptionCode ec = 0; - AtomicString name = args.at(0).toString(exec); - AtomicString value = args.at(1).toString(exec); + AtomicString name = ustringToAtomicString(args.at(0).toString(exec)); + AtomicString value = ustringToAtomicString(args.at(1).toString(exec)); Element* imp = impl(); if (!allowSettingSrcToJavascriptURL(exec, imp, name, value)) @@ -110,8 +101,8 @@ JSValue JSElement::setAttributeNS(ExecState* exec, const ArgList& args) { ExceptionCode ec = 0; AtomicString namespaceURI = valueToStringWithNullCheck(exec, args.at(0)); - AtomicString qualifiedName = args.at(1).toString(exec); - AtomicString value = args.at(2).toString(exec); + AtomicString qualifiedName = ustringToAtomicString(args.at(1).toString(exec)); + AtomicString value = ustringToAtomicString(args.at(2).toString(exec)); Element* imp = impl(); if (!allowSettingSrcToJavascriptURL(exec, imp, qualifiedName, value)) |