Index: third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
index 70f3293c83182cacd79ceca9f8c3eca49c390726..3b96321ad7808abc613c96c413b691496c309035 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
@@ -289,23 +289,20 @@ void V8Window::namedPropertyGetterCustom( |
return; |
} |
- // If the frame is remote, the caller will never be able to access further |
+ // This is a cross-origin interceptor. Check that the caller has access to the |
// named results. |
- if (!frame->isLocalFrame()) |
+ if (!BindingSecurity::shouldAllowAccessTo( |
+ currentDOMWindow(info.GetIsolate()), window, |
+ BindingSecurity::ErrorReportOption::DoNotReport)) { |
+ BindingSecurity::failedAccessCheckFor(info.GetIsolate(), frame); |
return; |
+ } |
// Search named items in the document. |
Document* doc = toLocalFrame(frame)->document(); |
if (!doc || !doc->isHTMLDocument()) |
return; |
- // This is an AllCanRead interceptor. Check that the caller has access to the |
- // named results. |
- if (!BindingSecurity::shouldAllowAccessTo( |
- currentDOMWindow(info.GetIsolate()), window, |
- BindingSecurity::ErrorReportOption::DoNotReport)) |
- return; |
- |
bool hasNamedItem = toHTMLDocument(doc)->hasNamedItem(name); |
bool hasIdItem = doc->hasElementWithId(name); |