Commit 99da9f7f authored by Dave Tapuska's avatar Dave Tapuska Committed by Chromium LUCI CQ

Change WebElement BoundsInViewport to gfx::Rect from WebRect.

No behavioral changes intended.

BUG=738465

Change-Id: I6849f610370625fec5cec7267404e1fb56c70da6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639223
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845794}
parent c725a5cf
...@@ -47,7 +47,8 @@ class RenderWidgetTest : public RenderViewTest { ...@@ -47,7 +47,8 @@ class RenderWidgetTest : public RenderViewTest {
gfx::PointF GetCenterPointOfElement(const blink::WebString& id) { gfx::PointF GetCenterPointOfElement(const blink::WebString& id) {
auto rect = auto rect =
GetMainFrame()->GetDocument().GetElementById(id).BoundsInViewport(); GetMainFrame()->GetDocument().GetElementById(id).BoundsInViewport();
return gfx::PointF(rect.x + rect.width / 2, rect.y + rect.height / 2); return gfx::PointF(rect.x() + rect.width() / 2,
rect.y() + rect.height() / 2);
} }
// Returns Compositor scrolling ElementId for a given id. If id is empty it // Returns Compositor scrolling ElementId for a given id. If id is empty it
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "v8/include/v8.h" #include "v8/include/v8.h"
namespace gfx { namespace gfx {
class Rect;
class Size; class Size;
} }
...@@ -45,7 +46,6 @@ namespace blink { ...@@ -45,7 +46,6 @@ namespace blink {
class Element; class Element;
class Image; class Image;
struct WebRect;
// Provides access to some properties of a DOM element node. // Provides access to some properties of a DOM element node.
class BLINK_EXPORT WebElement : public WebNode { class BLINK_EXPORT WebElement : public WebNode {
...@@ -96,7 +96,7 @@ class BLINK_EXPORT WebElement : public WebNode { ...@@ -96,7 +96,7 @@ class BLINK_EXPORT WebElement : public WebNode {
// Returns the bounds of the element in Visual Viewport. The bounds // Returns the bounds of the element in Visual Viewport. The bounds
// have been adjusted to include any transformations, including page scale. // have been adjusted to include any transformations, including page scale.
// This function will update the layout if required. // This function will update the layout if required.
WebRect BoundsInViewport() const; gfx::Rect BoundsInViewport() const;
// Returns the image contents of this element or a null SkBitmap // Returns the image contents of this element or a null SkBitmap
// if there isn't any. // if there isn't any.
......
...@@ -93,6 +93,7 @@ struct WebIsolatedWorldInfo; ...@@ -93,6 +93,7 @@ struct WebIsolatedWorldInfo;
struct WebPrintPageDescription; struct WebPrintPageDescription;
struct WebPrintParams; struct WebPrintParams;
struct WebPrintPresetOptions; struct WebPrintPresetOptions;
struct WebRect;
struct WebScriptSource; struct WebScriptSource;
namespace mojom { namespace mojom {
......
...@@ -157,7 +157,7 @@ WebNode WebElement::OpenOrClosedShadowRoot() { ...@@ -157,7 +157,7 @@ WebNode WebElement::OpenOrClosedShadowRoot() {
return WebNode(root); return WebNode(root);
} }
WebRect WebElement::BoundsInViewport() const { gfx::Rect WebElement::BoundsInViewport() const {
return ConstUnwrap<Element>()->BoundsInViewport(); return ConstUnwrap<Element>()->BoundsInViewport();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment