+2012-04-13 Adam Barth <abarth@webkit.org>
+
+ JSDocument::setLocation does too much bare-handed lifting
+ https://bugs.webkit.org/show_bug.cgi?id=83850
+
+ Reviewed by Sam Weinig.
+
+ As part of auditing all the ways of kicking off a navigation, I
+ happened to read JSDocument::setLocation, which uses very old patterns.
+ This patch updates it to do things the "modern" way. There shouldn't
+ be any behavior change.
+
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::setLocation):
+
2012-04-13 Shinya Kawanaka <shinyak@chromium.org>
Background width (or height) is wrong if width (or height) * zoom < 1.
if (!frame)
return;
- String str = ustringToString(value.toString(exec)->value(exec));
-
- Frame* lexicalFrame = asJSDOMWindow(exec->lexicalGlobalObject())->impl()->frame();
-
- // IE and Mozilla both resolve the URL relative to the source frame,
- // not the target frame.
- Frame* activeFrame = asJSDOMWindow(exec->dynamicGlobalObject())->impl()->frame();
- str = activeFrame->document()->completeURL(str).string();
+ UString locationString = value.toString(exec)->value(exec);
+ if (exec->hadException())
+ return;
- bool lockHistory = !ScriptController::processingUserGesture();
- frame->navigationScheduler()->scheduleLocationChange(lexicalFrame->document()->securityOrigin(),
- str, activeFrame->loader()->outgoingReferrer(), lockHistory, false);
+ if (Location* location = frame->domWindow()->location())
+ location->setHref(ustringToString(locationString), activeDOMWindow(exec), firstDOMWindow(exec));
}
JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* document)