summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp b/WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp
index 309c932..0f9f5a5 100644
--- a/WebCore/bindings/js/JSHTMLIFrameElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLIFrameElementCustom.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,25 +29,35 @@
#include "config.h"
#include "JSHTMLIFrameElement.h"
+#include "Document.h"
#include "CSSHelper.h"
#include "HTMLIFrameElement.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 {
-void JSHTMLIFrameElement::setSrc(ExecState* exec, JSValue* value)
+void JSHTMLIFrameElement::setSrc(KJS::ExecState* exec, KJS::JSValue* value)
{
HTMLIFrameElement* imp = static_cast<HTMLIFrameElement*>(impl());
String srcValue = valueToStringWithNullCheck(exec, value);
+#ifdef ANDROID_JAVASCRIPT_SECURITY
if (protocolIs(parseURL(srcValue), "javascript")) {
+#else
+ if (parseURL(srcValue).startsWith("javascript:", false)) {
+#endif
if (!checkNodeSecurity(exec, imp->contentDocument()))
return;
}
imp->setSrc(srcValue);
+ return;
}
} // namespace WebCore