mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefDOMNode::GetElementBounds() method
This commit is contained in:
@@ -378,6 +378,23 @@ CefString CefDOMNodeImpl::GetElementInnerText() {
|
||||
return str;
|
||||
}
|
||||
|
||||
CefRect CefDOMNodeImpl::GetElementBounds() {
|
||||
CefRect rect;
|
||||
if (!VerifyContext())
|
||||
return rect;
|
||||
|
||||
if (!node_.isElementNode()) {
|
||||
NOTREACHED();
|
||||
return rect;
|
||||
}
|
||||
|
||||
WebElement element = node_.to<blink::WebElement>();
|
||||
blink::WebRect rc = element.boundsInViewport();
|
||||
rect.Set(rc.x, rc.y, rc.width, rc.height);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
void CefDOMNodeImpl::Detach() {
|
||||
document_ = NULL;
|
||||
node_.assign(WebNode());
|
||||
|
Reference in New Issue
Block a user