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

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: rebased Created 5 years, 6 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
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/RemoteDOMWindow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index fffbde3f68d59d622622d270ffda3fc649a69b17..32ca890eac6bc062dadc4e5249153d328d153875 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -1228,11 +1228,8 @@ void LocalDOMWindow::scrollTo(const ScrollToOptions& scrollToOptions) const
view->scrollableArea()->setScrollPosition(DoublePoint(scaledX, scaledY), ProgrammaticScroll, scrollBehavior);
}
-void LocalDOMWindow::moveBy(int x, int y, bool hasX, bool hasY) const
+void LocalDOMWindow::moveBy(int x, int y) const
{
- if (!hasX || !hasY)
- UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
philipj_slow 2015/06/12 09:16:04 Oh wait, can you remove the now-unused counters?
philipj_slow 2015/06/12 09:23:13 Too late, but no need for a follow-up if you don't
-
if (!frame() || !frame()->isMainFrame())
return;
@@ -1246,11 +1243,8 @@ void LocalDOMWindow::moveBy(int x, int y, bool hasX, bool hasY) const
host->chromeClient().setWindowRectWithAdjustment(windowRect);
}
-void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
+void LocalDOMWindow::moveTo(int x, int y) const
{
- if (!hasX || !hasY)
- UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
-
if (!frame() || !frame()->isMainFrame())
return;
@@ -1259,16 +1253,13 @@ void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
return;
IntRect windowRect = host->chromeClient().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->chromeClient().setWindowRectWithAdjustment(windowRect);
}
-void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const
+void LocalDOMWindow::resizeBy(int x, int y) const
{
- if (!hasX || !hasY)
- UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
-
if (!frame() || !frame()->isMainFrame())
return;
@@ -1282,11 +1273,8 @@ void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const
host->chromeClient().setWindowRectWithAdjustment(update);
}
-void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeight) const
+void LocalDOMWindow::resizeTo(int width, int height) const
{
- if (!hasWidth || !hasHeight)
- UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
-
if (!frame() || !frame()->isMainFrame())
return;
@@ -1295,7 +1283,7 @@ void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeig
return;
IntRect fr = host->chromeClient().windowRect();
- IntSize dest = IntSize(hasWidth ? width : fr.width(), hasHeight ? height : fr.height());
+ IntSize dest = IntSize(width, height);
IntRect update(fr.location(), dest);
host->chromeClient().setWindowRectWithAdjustment(update);
}
« no previous file with comments | « Source/core/frame/LocalDOMWindow.h ('k') | Source/core/frame/RemoteDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698