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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 1463723003: Return VisualViewport coords in boundsInViewportSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 4110 matching lines...) Expand 10 before | Expand all | Expand 10 after
4121 { 4121 {
4122 // FIXME: If we don't subtract 1 from the x- and y-coordinates of the 4122 // FIXME: If we don't subtract 1 from the x- and y-coordinates of the
4123 // selection bounds, selectRange() will select the *next* element. That's 4123 // selection bounds, selectRange() will select the *next* element. That's
4124 // strictly correct, as hit-testing checks the pixel to the lower-right of 4124 // strictly correct, as hit-testing checks the pixel to the lower-right of
4125 // the input coordinate, but it's a wart on the API. 4125 // the input coordinate, but it's a wart on the API.
4126 return WebPoint(rect.x + rect.width - 1, rect.y + rect.height - 1); 4126 return WebPoint(rect.x + rect.width - 1, rect.y + rect.height - 1);
4127 } 4127 }
4128 4128
4129 static WebRect elementBounds(WebFrame* frame, const WebString& id) 4129 static WebRect elementBounds(WebFrame* frame, const WebString& id)
4130 { 4130 {
4131 return frame->document().getElementById(id).boundsInViewportSpace(); 4131 return frame->document().getElementById(id).boundsInViewport();
4132 } 4132 }
4133 4133
4134 static std::string selectionAsString(WebFrame* frame) 4134 static std::string selectionAsString(WebFrame* frame)
4135 { 4135 {
4136 return frame->selectionAsText().utf8(); 4136 return frame->selectionAsText().utf8();
4137 } 4137 }
4138 4138
4139 TEST_P(ParameterizedWebFrameTest, SelectRange) 4139 TEST_P(ParameterizedWebFrameTest, SelectRange)
4140 { 4140 {
4141 WebFrame* frame; 4141 WebFrame* frame;
(...skipping 4218 matching lines...) Expand 10 before | Expand all | Expand 10 after
8360 8360
8361 TEST_F(WebFrameTest, CallbackOrdering) 8361 TEST_F(WebFrameTest, CallbackOrdering)
8362 { 8362 {
8363 registerMockedHttpURLLoad("foo.html"); 8363 registerMockedHttpURLLoad("foo.html");
8364 FrameTestHelpers::WebViewHelper webViewHelper; 8364 FrameTestHelpers::WebViewHelper webViewHelper;
8365 CallbackOrderingWebFrameClient client; 8365 CallbackOrderingWebFrameClient client;
8366 webViewHelper.initializeAndLoad(m_baseURL + "foo.html", true, &client); 8366 webViewHelper.initializeAndLoad(m_baseURL + "foo.html", true, &client);
8367 } 8367 }
8368 8368
8369 } // namespace blink 8369 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698