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

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

Issue 900203002: Add use counters for missing arguments to window.{move,resize}{To,By} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 21ea7a4fd548428bda10d12abae0ed2e024e0215..4a9822fcbb98ec33e5b01290a1706766d895cac3 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -1403,8 +1403,11 @@ void LocalDOMWindow::scrollTo(const ScrollToOptions& scrollToOptions) const
scrollViewportTo(frame(), DoublePoint(scaledX, scaledY), scrollBehavior);
}
-void LocalDOMWindow::moveBy(int x, int y) const
+void LocalDOMWindow::moveBy(int x, int y, bool hasX, bool hasY) const
{
+ if (!hasX || !hasY)
+ UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
philipj_slow 2015/02/05 10:13:58 It could well be that there's only a single 1-argu
Jens Widell 2015/02/05 10:19:52 I reasoned that the possible outcomes were to eith
+
if (!frame() || !frame()->isMainFrame())
return;
@@ -1420,6 +1423,9 @@ void LocalDOMWindow::moveBy(int x, int y) const
void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
{
+ if (!hasX || !hasY)
+ UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
+
if (!frame() || !frame()->isMainFrame())
return;
@@ -1433,8 +1439,11 @@ void LocalDOMWindow::moveTo(int x, int y, bool hasX, bool hasY) const
host->chrome().setWindowRect(adjustWindowRect(*frame(), windowRect));
}
-void LocalDOMWindow::resizeBy(int x, int y) const
+void LocalDOMWindow::resizeBy(int x, int y, bool hasX, bool hasY) const
{
+ if (!hasX || !hasY)
+ UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
+
if (!frame() || !frame()->isMainFrame())
return;
@@ -1450,6 +1459,9 @@ void LocalDOMWindow::resizeBy(int x, int y) const
void LocalDOMWindow::resizeTo(int width, int height, bool hasWidth, bool hasHeight) const
{
+ if (!hasWidth || !hasHeight)
+ UseCounter::count(document(), UseCounter::WindowMoveResizeMissingArguments);
+
if (!frame() || !frame()->isMainFrame())
return;
« 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