diff options
Diffstat (limited to 'WebCore/bindings/js/JSAttrCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSAttrCustom.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/WebCore/bindings/js/JSAttrCustom.cpp b/WebCore/bindings/js/JSAttrCustom.cpp index c7d3848..b2c9044 100644 --- a/WebCore/bindings/js/JSAttrCustom.cpp +++ b/WebCore/bindings/js/JSAttrCustom.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2007 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,24 +29,35 @@ #include "config.h" #include "JSAttr.h" +#include "Attr.h" +#include "Document.h" +#include "ExceptionCode.h" #include "CSSHelper.h" #include "HTMLFrameElementBase.h" #include "HTMLNames.h" - -using namespace KJS; +#include "PlatformString.h" +#include "kjs_binding.h" +#include "kjs_dom.h" +#ifdef ANDROID_JAVASCRIPT_SECURITY +#include "KURL.h" +#endif namespace WebCore { using namespace HTMLNames; -void JSAttr::setValue(ExecState* exec, JSValue* value) +void JSAttr::setValue(KJS::ExecState* exec, KJS::JSValue* value) { Attr* imp = static_cast<Attr*>(impl()); String attrValue = valueToStringWithNullCheck(exec, value); Element* ownerElement = imp->ownerElement(); if (ownerElement && (ownerElement->hasTagName(iframeTag) || ownerElement->hasTagName(frameTag))) { +#ifdef ANDROID_JAVASCRIPT_SECURITY if (equalIgnoringCase(imp->name(), "src") && protocolIs(parseURL(attrValue), "javascript")) { +#else + if (equalIgnoringCase(imp->name(), "src") && parseURL(attrValue).startsWith("javascript:", false)) { +#endif if (!checkNodeSecurity(exec, static_cast<HTMLFrameElementBase*>(ownerElement)->contentDocument())) return; } @@ -54,7 +65,7 @@ void JSAttr::setValue(ExecState* exec, JSValue* value) ExceptionCode ec = 0; imp->setValue(attrValue, ec); - setDOMException(exec, ec); + KJS::setDOMException(exec, ec); } } // namespace WebCore |