diff options
Diffstat (limited to 'WebCore/bindings/js/JSLocationCustom.cpp')
-rw-r--r-- | WebCore/bindings/js/JSLocationCustom.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/WebCore/bindings/js/JSLocationCustom.cpp b/WebCore/bindings/js/JSLocationCustom.cpp index c76a2b1..6c8e032 100644 --- a/WebCore/bindings/js/JSLocationCustom.cpp +++ b/WebCore/bindings/js/JSLocationCustom.cpp @@ -102,14 +102,9 @@ bool JSLocation::getOwnPropertyDescriptorDelegate(ExecState* exec, const Identif return true; } - // When accessing Location cross-domain, functions are always the native built-in ones. - // See JSDOMWindow::getOwnPropertySlotDelegate for additional details. - - // Our custom code is only needed to implement the Window cross-domain scheme, so if access is - // allowed, return false so the normal lookup will take place. - String message; - if (allowsAccessFromFrame(exec, frame, message)) - return false; + // throw out all cross domain access + if (!allowsAccessFromFrame(exec, frame)) + return true; // Check for the few functions that we allow, even when called cross-domain. const HashEntry* entry = JSLocationPrototype::s_info.propHashTable(exec)->entry(exec, propertyName); @@ -133,8 +128,7 @@ bool JSLocation::getOwnPropertyDescriptorDelegate(ExecState* exec, const Identif // FIXME: Other implementers of the Window cross-domain scheme (Window, History) allow toString, // but for now we have decided not to, partly because it seems silly to return "[Object Location]" in // such cases when normally the string form of Location would be the URL. - - printErrorMessageForFrame(frame, message); + descriptor.setUndefined(); return true; } @@ -257,8 +251,9 @@ void JSLocation::setPort(ExecState* exec, JSValue value) const UString& portString = value.toString(exec); int port = charactersToInt(portString.data(), portString.size()); if (port < 0 || port > 0xFFFF) - port = 0; - url.setPort(port); + url.removePort(); + else + url.setPort(port); navigateIfAllowed(exec, frame, url, !frame->script()->anyPageIsProcessingUserGesture(), false); } |