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

Unified Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 886463010: Make arguments to window.{move,resize}{To,By} non-optional (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index f2f19e14a2b9bbe4f84ae0b3309272fea0222c2e..1b9443643d25404cb34628c168a39db834fc1a1f 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -1414,7 +1414,7 @@ void LocalDOMWindow::moveBy(int x, int y) const
host->chrome().setWindowRect(adjustWindowRect(*frame(), windowRect));
}
-void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
+void LocalDOMWindow::moveTo(int x, int y) const
{
if (!frame() || !frame()->isMainFrame())
return;
@@ -1424,7 +1424,7 @@ void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
return;
IntRect windowRect = host->chrome().windowRect();
- windowRect.setLocation(IntPoint(hasX ? x : windowRect.x(), hasY ? y : windowRect.y()));
+ windowRect.setLocation(IntPoint(x, y));
// Security check (the spec talks about UniversalBrowserWrite to disable this check...)
host->chrome().setWindowRect(adjustWindowRect(*frame(), windowRect));
}
@@ -1444,7 +1444,7 @@ void LocalDOMWindow::resizeBy(int x, int y) const
host->chrome().setWindowRect(adjustWindowRect(*frame(), update));
}
-void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeight) const
+void LocalDOMWindow::resizeTo(int width, int height) const
{
if (!frame() || !frame()->isMainFrame())
return;
@@ -1454,7 +1454,7 @@ void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeig
return;
IntRect fr = host->chrome().windowRect();
- IntSize dest = IntSize(hasWidth ? width : fr.width(), hasHeight ? height : fr.height());
+ IntSize dest = IntSize(width, height);
IntRect update(fr.location(), dest);
host->chrome().setWindowRect(adjustWindowRect(*frame(), update));
}

Powered by Google App Engine
This is Rietveld 408576698