summaryrefslogtreecommitdiffstats
path: root/webkit/port/bindings/v8
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 17:58:00 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 17:58:00 +0000
commiteb0c1e406f837d590055021a753015feb67b6fc9 (patch)
tree68cba799e7116f4cae39bf014fe8ded65f705037 /webkit/port/bindings/v8
parent6d5168ee11a27e4db3047883eddfac80a9f98c9d (diff)
downloadchromium_src-eb0c1e406f837d590055021a753015feb67b6fc9.zip
chromium_src-eb0c1e406f837d590055021a753015feb67b6fc9.tar.gz
chromium_src-eb0c1e406f837d590055021a753015feb67b6fc9.tar.bz2
Fix several issues with popup window locations:
1) Remove ConstrainedWindow::GenerateInitialBounds(), which is old and crufty and no longer relevant now that there are no unsuppressed, constrained popup windows. 2) Move the browser side positioning logic into Browser::BuildPopupWindow(). 3) Fix the window.open() handler so that when we aren't given top=/left= coordinates, we don't set the window origin (allowing the browser to do something more intelligent). BUG=1290758 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/bindings/v8')
-rw-r--r--webkit/port/bindings/v8/v8_custom.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp
index 63b9d24..866c0cd 100644
--- a/webkit/port/bindings/v8/v8_custom.cpp
+++ b/webkit/port/bindings/v8/v8_custom.cpp
@@ -1184,8 +1184,13 @@ CALLBACK_FUNC_DECL(DOMWindowOpen) {
// In the case of a named frame or a new window, we'll use the createWindow()
// helper.
- WindowFeatures window_features(
+
+ // Parse the values, and then work with a copy of the parsed values
+ // so we can restore the values we may not want to overwrite after
+ // we do the multiple monitor fixes.
+ WindowFeatures raw_features(
valueToStringWithNullOrUndefinedCheck(args[2]));
+ WindowFeatures window_features(raw_features);
FloatRect screen_rect = screenAvailableRect(page->mainFrame()->view());
// Set default size and location near parent window if none were specified.
@@ -1215,12 +1220,22 @@ CALLBACK_FUNC_DECL(DOMWindowOpen) {
window_rect.move(screen_rect.x(), screen_rect.y());
WebCore::DOMWindow::adjustWindowRect(screen_rect, window_rect, window_rect);
- // createWindow expects the location to be specified relative to the parent.
- window_features.x = window_rect.x() - parent->screenX();
- window_features.y = window_rect.y() - parent->screenY();
+ window_features.x = window_rect.x();
+ window_features.y = window_rect.y();
window_features.height = window_rect.height();
window_features.width = window_rect.width();
+ // If either of the origin coordinates weren't set in the original
+ // string, make sure they aren't set now.
+ if (!raw_features.xSet) {
+ window_features.x = 0;
+ window_features.xSet = false;
+ }
+ if (!raw_features.ySet) {
+ window_features.y = 0;
+ window_features.ySet = false;
+ }
+
frame = createWindow(frame, url_string, frame_name,
window_features, v8::Local<v8::Value>());