Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp

Issue 22985006: Throw an exception when denying access to 'Frame's 'location' setter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/V8ThrowException.cpp ('k') | Source/core/dom/DOMException.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
diff --git a/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
index f589ef99e3968e85ca5a9c9bbf86026f7053c8ad..4fbed3494ac3ec11621aa373fc8a4fc3ab933894 100644
--- a/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp
@@ -33,8 +33,10 @@
#include "HTMLNames.h"
#include "bindings/v8/BindingSecurity.h"
+#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "core/html/HTMLFrameElement.h"
+#include "core/html/parser/HTMLParserIdioms.h"
namespace WebCore {
@@ -45,8 +47,11 @@ void V8HTMLFrameElement::locationAttrSetterCustom(v8::Local<v8::String> name, v8
HTMLFrameElement* frame = V8HTMLFrameElement::toNative(info.Holder());
String locationValue = toWebCoreStringWithNullCheck(value);
- if (!BindingSecurity::allowSettingFrameSrcToJavascriptUrl(frame, locationValue))
+ ExceptionState es(info.GetIsolate());
+ if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(locationValue)) && !BindingSecurity::shouldAllowAccessToFrame(frame->contentFrame(), es)) {
+ es.throwIfNeeded();
return;
+ }
frame->setLocation(locationValue);
}
« no previous file with comments | « Source/bindings/v8/V8ThrowException.cpp ('k') | Source/core/dom/DOMException.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698