Changeset 220314 in webkit
- Timestamp:
- Aug 5, 2017 1:11:11 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220313 r220314 1 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 WebDriver: use in-view center point for clicks instead of bounding box center point 4 https://bugs.webkit.org/show_bug.cgi?id=174863 5 6 Reviewed by Simon Fraser. 7 8 Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add 9 FrameView::clientToDocumentPoint(). 10 11 * WebCore.xcodeproj/project.pbxproj: 12 * dom/Element.h: 13 * page/FrameView.h: 14 * platform/graphics/FloatPoint.h: 15 1 16 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r220311 r220314 431 431 0F43C85D189E10CF00019AE2 /* PerformanceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F43C85C189E10CF00019AE2 /* PerformanceTiming.cpp */; }; 432 432 0F43C85F189E15A600019AE2 /* JSPerformanceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F43C85E189E15A600019AE2 /* JSPerformanceTiming.cpp */; }; 433 0F4710AF1DB56AFC002DCEC3 /* DOMRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710A91DB56AFC002DCEC3 /* DOMRect.h */; };434 0F4710B11DB56AFC002DCEC3 /* DOMRectInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710AB1DB56AFC002DCEC3 /* DOMRectInit.h */; };435 0F4710B31DB56AFC002DCEC3 /* DOMRectReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710AD1DB56AFC002DCEC3 /* DOMRectReadOnly.h */; };433 0F4710AF1DB56AFC002DCEC3 /* DOMRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710A91DB56AFC002DCEC3 /* DOMRect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 434 0F4710B11DB56AFC002DCEC3 /* DOMRectInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710AB1DB56AFC002DCEC3 /* DOMRectInit.h */; settings = {ATTRIBUTES = (Private, ); }; }; 435 0F4710B31DB56AFC002DCEC3 /* DOMRectReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710AD1DB56AFC002DCEC3 /* DOMRectReadOnly.h */; settings = {ATTRIBUTES = (Private, ); }; }; 436 436 0F4710BB1DB56BE8002DCEC3 /* JSDOMRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4710B51DB56BE8002DCEC3 /* JSDOMRect.cpp */; }; 437 437 0F4710BC1DB56BE8002DCEC3 /* JSDOMRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */; }; … … 1956 1956 467302021C4EFE7800BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */; }; 1957 1957 468344DF1EDDFAAA00B7795B /* DOMRectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 468344DD1EDDFA5F00B7795B /* DOMRectList.cpp */; }; 1958 468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 468344DE1EDDFA5F00B7795B /* DOMRectList.h */; };1958 468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 468344DE1EDDFA5F00B7795B /* DOMRectList.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1959 1959 4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; }; 1960 1960 46B63F6C1C6E8D19002E914B /* JSEventTargetCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */; settings = {ATTRIBUTES = (Private, ); }; }; -
trunk/Source/WebCore/dom/Element.h
r220202 r220314 176 176 FloatRect boundingClientRect(); 177 177 178 Ref<DOMRectList> getClientRects();178 WEBCORE_EXPORT Ref<DOMRectList> getClientRects(); 179 179 Ref<DOMRect> getBoundingClientRect(); 180 180 -
trunk/Source/WebCore/page/FrameView.cpp
r220112 r220314 4952 4952 } 4953 4953 4954 FloatPoint FrameView::clientToDocumentPoint(FloatPoint point) const 4955 { 4956 point.move(-documentToClientOffset()); 4957 return point; 4958 } 4959 4954 4960 FloatRect FrameView::layoutViewportToAbsoluteRect(FloatRect rect) const 4955 4961 { -
trunk/Source/WebCore/page/FrameView.h
r220112 r220314 478 478 FloatRect documentToClientRect(FloatRect) const; 479 479 FloatPoint documentToClientPoint(FloatPoint) const; 480 WEBCORE_EXPORT FloatPoint clientToDocumentPoint(FloatPoint) const; 480 481 481 482 FloatRect layoutViewportToAbsoluteRect(FloatRect) const; -
trunk/Source/WebCore/platform/graphics/FloatPoint.h
r218982 r220314 69 69 static FloatPoint zero() { return FloatPoint(); } 70 70 71 static FloatPoint narrowPrecision(double x, double y);71 WEBCORE_EXPORT static FloatPoint narrowPrecision(double x, double y); 72 72 73 73 float x() const { return m_x; } -
trunk/Source/WebDriver/ChangeLog
r220091 r220314 1 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 WebDriver: use in-view center point for clicks instead of bounding box center point 4 https://bugs.webkit.org/show_bug.cgi?id=174863 5 6 Reviewed by Simon Fraser. 7 8 The center of the element bounding box is not always part of the element, like in multiline links, for example. 9 10 11.1 Element Interactability. 11 https://www.w3.org/TR/webdriver/#dfn-in-view-center-point 12 13 * CommandResult.cpp: 14 (WebDriver::CommandResult::httpStatusCode): Add ElementClickIntercepted and ElementNotInteractable errors. 15 (WebDriver::CommandResult::errorString): Ditto. 16 * CommandResult.h: Ditto. 17 * Session.cpp: 18 (WebDriver::Session::computeElementLayout): Get the in-view center point and isObscured from the result too. 19 (WebDriver::Session::getElementRect): Ignore in-view center point and isObscured. 20 (WebDriver::Session::elementClick): Fail in case the element is not interactable or is obscured. 21 * Session.h: 22 1 23 2017-08-01 Michael Catanzaro <mcatanzaro@igalia.com> 2 24 -
trunk/Source/WebDriver/CommandResult.cpp
r219794 r220314 123 123 // https://www.w3.org/TR/webdriver/#handling-errors 124 124 switch (m_errorCode.value()) { 125 case ErrorCode::ElementClickIntercepted: 126 case ErrorCode::ElementNotInteractable: 125 127 case ErrorCode::InvalidArgument: 126 128 case ErrorCode::InvalidElementState: … … 153 155 154 156 switch (m_errorCode.value()) { 157 case ErrorCode::ElementClickIntercepted: 158 return ASCIILiteral("element click intercepted"); 159 case ErrorCode::ElementNotInteractable: 160 return ASCIILiteral("element not interactable"); 155 161 case ErrorCode::InvalidArgument: 156 162 return ASCIILiteral("invalid argument"); -
trunk/Source/WebDriver/CommandResult.h
r219794 r220314 40 40 // https://www.w3.org/TR/webdriver/#handling-errors 41 41 enum class ErrorCode { 42 ElementClickIntercepted, 43 ElementNotInteractable, 42 44 InvalidArgument, 43 45 InvalidElementState, -
trunk/Source/WebDriver/Session.cpp
r219833 r220314 581 581 } 582 582 583 void Session::computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption> options, Function<void (std::optional<Rect>&&, RefPtr<InspectorObject>&&)>&& completionHandler)583 void Session::computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption> options, Function<void (std::optional<Rect>&&, std::optional<Point>&&, bool, RefPtr<InspectorObject>&&)>&& completionHandler) 584 584 { 585 585 ASSERT(m_toplevelBrowsingContext.value()); … … 593 593 m_host->sendCommandToBackend(ASCIILiteral("computeElementLayout"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) mutable { 594 594 if (response.isError || !response.responseObject) { 595 completionHandler(std::nullopt, WTFMove(response.responseObject));595 completionHandler(std::nullopt, std::nullopt, false, WTFMove(response.responseObject)); 596 596 return; 597 597 } 598 598 RefPtr<InspectorObject> rectObject; 599 599 if (!response.responseObject->getObject(ASCIILiteral("rect"), rectObject)) { 600 completionHandler(std::nullopt, nullptr);600 completionHandler(std::nullopt, std::nullopt, false, nullptr); 601 601 return; 602 602 } … … 612 612 } 613 613 if (!elementX || !elementY) { 614 completionHandler(std::nullopt, nullptr);614 completionHandler(std::nullopt, std::nullopt, false, nullptr); 615 615 return; 616 616 } … … 626 626 } 627 627 if (!elementWidth || !elementHeight) { 628 completionHandler(std::nullopt, nullptr);628 completionHandler(std::nullopt, std::nullopt, false, nullptr); 629 629 return; 630 630 } 631 631 Rect rect = { { elementX.value(), elementY.value() }, { elementWidth.value(), elementHeight.value() } }; 632 completionHandler(rect, nullptr); 632 633 bool isObscured; 634 if (!response.responseObject->getBoolean(ASCIILiteral("isObscured"), isObscured)) { 635 completionHandler(std::nullopt, std::nullopt, false, nullptr); 636 return; 637 } 638 RefPtr<InspectorObject> inViewCenterPointObject; 639 if (!response.responseObject->getObject(ASCIILiteral("inViewCenterPoint"), inViewCenterPointObject)) { 640 completionHandler(rect, std::nullopt, isObscured, nullptr); 641 return; 642 } 643 int inViewCenterPointX, inViewCenterPointY; 644 if (!inViewCenterPointObject->getInteger(ASCIILiteral("x"), inViewCenterPointX) 645 || !inViewCenterPointObject->getInteger(ASCIILiteral("y"), inViewCenterPointY)) { 646 completionHandler(std::nullopt, std::nullopt, isObscured, nullptr); 647 return; 648 } 649 Point inViewCenterPoint = { inViewCenterPointX, inViewCenterPointY }; 650 completionHandler(rect, inViewCenterPoint, isObscured, nullptr); 633 651 }); 634 652 } … … 831 849 } 832 850 833 computeElementLayout(elementID, { }, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, RefPtr<InspectorObject>&& error) {851 computeElementLayout(elementID, { }, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, std::optional<Point>&&, bool, RefPtr<InspectorObject>&& error) { 834 852 if (!rect || error) { 835 853 completionHandler(CommandResult::fail(WTFMove(error))); … … 988 1006 OptionSet<ElementLayoutOption> options = ElementLayoutOption::ScrollIntoViewIfNeeded; 989 1007 options |= ElementLayoutOption::UseViewportCoordinates; 990 computeElementLayout(elementID, options, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, RefPtr<InspectorObject>&& error) mutable {1008 computeElementLayout(elementID, options, [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](std::optional<Rect>&& rect, std::optional<Point>&& inViewCenter, bool isObscured, RefPtr<InspectorObject>&& error) mutable { 991 1009 if (!rect || error) { 992 1010 completionHandler(CommandResult::fail(WTFMove(error))); 993 1011 return; 994 1012 } 995 996 // FIXME: the center of the bounding box is not always part of the element. 997 performMouseInteraction(rect.value().origin.x + rect.value().size.width / 2, rect.value().origin.y + rect.value().size.height / 2, 998 MouseButton::Left, MouseInteraction::SingleClick, WTFMove(completionHandler)); 1013 if (isObscured) { 1014 completionHandler(CommandResult::fail(CommandResult::ErrorCode::ElementClickIntercepted)); 1015 return; 1016 } 1017 if (!inViewCenter) { 1018 completionHandler(CommandResult::fail(CommandResult::ErrorCode::ElementNotInteractable)); 1019 return; 1020 } 1021 1022 performMouseInteraction(inViewCenter.value().x, inViewCenter.value().y, MouseButton::Left, MouseInteraction::SingleClick, WTFMove(completionHandler)); 999 1023 1000 1024 waitForNavigationToComplete(WTFMove(completionHandler)); -
trunk/Source/WebDriver/Session.h
r219833 r220314 134 134 UseViewportCoordinates = 1 << 1, 135 135 }; 136 void computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption>, Function<void (std::optional<Rect>&&, RefPtr<Inspector::InspectorObject>&&)>&&);136 void computeElementLayout(const String& elementID, OptionSet<ElementLayoutOption>, Function<void (std::optional<Rect>&&, std::optional<Point>&&, bool, RefPtr<Inspector::InspectorObject>&&)>&&); 137 137 138 138 enum class MouseButton { None, Left, Middle, Right }; -
trunk/Source/WebKit/ChangeLog
r220312 r220314 1 2017-08-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 WebDriver: use in-view center point for clicks instead of bounding box center point 4 https://bugs.webkit.org/show_bug.cgi?id=174863 5 6 Reviewed by Simon Fraser. 7 8 Change computeElementLayout to also return the in-view center point and whether it's obscured by another 9 element. 10 11 * UIProcess/Automation/Automation.json: Add optional inViewCenterPoint to the result and isObscured. 12 * UIProcess/Automation/WebAutomationSession.cpp: 13 (WebKit::WebAutomationSession::didComputeElementLayout): Handle inViewCenterPoint and isObscured. 14 * UIProcess/Automation/WebAutomationSession.h: 15 * UIProcess/Automation/WebAutomationSession.messages.in: 16 * WebProcess/Automation/WebAutomationSessionProxy.cpp: 17 (WebKit::elementInViewClientCenterPoint): Get the client in-view center point and whether it's obscured 18 according to the spec. 19 (WebKit::WebAutomationSessionProxy::computeElementLayout): Pass inViewCenterPoint and isObscured to 20 DidComputeElementLayout message. 21 1 22 2017-08-05 Brian Burg <bburg@apple.com> 2 23 -
trunk/Source/WebKit/UIProcess/Automation/Automation.json
r220115 r220314 423 423 ], 424 424 "returns": [ 425 { "name": "rect", "$ref": "Rect", "description": "The layout rect for the requested element. Specified in page or viewport coordinates based on the useViewportCoordinates parameter." } 425 { "name": "rect", "$ref": "Rect", "description": "The layout rect for the requested element. Specified in page or viewport coordinates based on the useViewportCoordinates parameter." }, 426 { "name": "inViewCenterPoint", "optional": true, "$ref": "Point", "description": "The in-view center point for the requested element. Specified in page or viewport coordinates based on the useViewportCoordinates parameter." }, 427 { "name": "isObscured", "type": "boolean", "description": "If the in-view center point of the requested element is obscured by another element." } 426 428 ], 427 429 "async": true -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
r220312 r220314 744 744 } 745 745 746 void WebAutomationSession::didComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, const String& errorType)746 void WebAutomationSession::didComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, std::optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured, const String& errorType) 747 747 { 748 748 auto callback = m_computeElementLayoutCallbacks.take(callbackID); … … 770 770 .release(); 771 771 772 callback->sendSuccess(WTFMove(rectObject)); 772 if (!inViewCenterPoint) { 773 callback->sendSuccess(WTFMove(rectObject), nullptr, isObscured); 774 return; 775 } 776 777 auto inViewCenterPointObject = Inspector::Protocol::Automation::Point::create() 778 .setX(inViewCenterPoint.value().x()) 779 .setY(inViewCenterPoint.value().y()) 780 .release(); 781 782 callback->sendSuccess(WTFMove(rectObject), WTFMove(inViewCenterPointObject), isObscured); 773 783 } 774 784 -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.h
r220115 r220314 175 175 void didResolveChildFrame(uint64_t callbackID, uint64_t frameID, const String& errorType); 176 176 void didResolveParentFrame(uint64_t callbackID, uint64_t frameID, const String& errorType); 177 void didComputeElementLayout(uint64_t callbackID, WebCore::IntRect, const String& errorType);177 void didComputeElementLayout(uint64_t callbackID, WebCore::IntRect, std::optional<WebCore::IntPoint>, bool isObscured, const String& errorType); 178 178 void didTakeScreenshot(uint64_t callbackID, const ShareableBitmap::Handle&, const String& errorType); 179 179 void didGetCookiesForFrame(uint64_t callbackID, Vector<WebCore::Cookie>, const String& errorType); -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.messages.in
r199091 r220314 27 27 DidResolveParentFrame(uint64_t callbackID, uint64_t frameID, String errorType) 28 28 29 DidComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, String errorType)29 DidComputeElementLayout(uint64_t callbackID, WebCore::IntRect rect, std::optional<WebCore::IntPoint> inViewCenterPoint, bool isObscured, String errorType) 30 30 31 31 DidTakeScreenshot(uint64_t callbackID, WebKit::ShareableBitmap::Handle imageDataHandle, String errorType) -
trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
r219652 r220314 42 42 #include <JavaScriptCore/OpaqueJSString.h> 43 43 #include <WebCore/CookieJar.h> 44 #include <WebCore/DOMRect.h> 45 #include <WebCore/DOMRectList.h> 44 46 #include <WebCore/DOMWindow.h> 45 47 #include <WebCore/Frame.h> … … 471 473 } 472 474 475 static std::optional<WebCore::FloatPoint> elementInViewClientCenterPoint(WebCore::Element& element, bool& isObscured) 476 { 477 // §11.1 Element Interactability. 478 // https://www.w3.org/TR/webdriver/#dfn-in-view-center-point 479 auto* clientRect = element.getClientRects()->item(0); 480 if (!clientRect) 481 return std::nullopt; 482 483 auto clientCenterPoint = WebCore::FloatPoint::narrowPrecision(0.5 * (clientRect->left() + clientRect->right()), 0.5 * (clientRect->top() + clientRect->bottom())); 484 auto elementList = element.treeScope().elementsFromPoint(clientCenterPoint.x(), clientCenterPoint.y()); 485 if (elementList.isEmpty()) { 486 // An element is obscured if the pointer-interactable paint tree at its center point is empty, 487 // or the first element in this tree is not an inclusive descendant of itself. 488 // https://w3c.github.io/webdriver/webdriver-spec.html#dfn-obscured 489 isObscured = true; 490 return clientCenterPoint; 491 } 492 493 auto index = elementList.findMatching([&element] (auto& item) { return item.get() == &element; }); 494 if (index == notFound) 495 return std::nullopt; 496 497 if (index) { 498 // Element is not the first one in the list. 499 auto firstElement = elementList[0]; 500 isObscured = !firstElement->isDescendantOf(element); 501 } 502 503 return clientCenterPoint; 504 } 505 473 506 void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t frameID, String nodeHandle, bool scrollIntoViewIfNeeded, bool useViewportCoordinates, uint64_t callbackID) 474 507 { … … 476 509 if (!page) { 477 510 String windowNotFoundErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::WindowNotFound); 478 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), windowNotFoundErrorType), 0);511 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, windowNotFoundErrorType), 0); 479 512 return; 480 513 } … … 484 517 485 518 WebFrame* frame = frameID ? WebProcess::singleton().webFrame(frameID) : page->mainWebFrame(); 486 if (!frame ) {487 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0);519 if (!frame || !frame->coreFrame() || !frame->coreFrame()->view()) { 520 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, frameNotFoundErrorType), 0); 488 521 return; 489 522 } … … 491 524 WebCore::Element* coreElement = elementForNodeHandle(*frame, nodeHandle); 492 525 if (!coreElement) { 493 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), nodeNotFoundErrorType), 0); 494 return; 495 } 496 497 if (scrollIntoViewIfNeeded) 526 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, std::nullopt, false, nodeNotFoundErrorType), 0); 527 return; 528 } 529 530 if (scrollIntoViewIfNeeded) { 531 // FIXME: Wait in an implementation-specific way up to the session implicit wait timeout for the element to become in view. 498 532 coreElement->scrollIntoViewIfNeeded(false); 533 } 499 534 500 535 WebCore::IntRect rect = coreElement->clientRect(); 501 536 502 WebCore::Frame* coreFrame = frame->coreFrame(); 503 if (!coreFrame) { 504 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0); 505 return; 506 } 507 508 WebCore::FrameView *coreFrameView = coreFrame->view(); 509 if (!coreFrameView) { 510 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, WebCore::IntRect(), frameNotFoundErrorType), 0); 511 return; 512 } 513 537 auto* coreFrameView = frame->coreFrame()->view(); 514 538 if (useViewportCoordinates) 515 539 rect.moveBy(WebCore::IntPoint(0, -coreFrameView->topContentInset())); … … 517 541 rect = coreFrameView->rootViewToContents(rect); 518 542 519 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, rect, String()), 0); 543 bool isObscured = false; 544 std::optional<WebCore::IntPoint> inViewCenter; 545 if (auto clientCenterPoint = elementInViewClientCenterPoint(*coreElement, isObscured)) { 546 inViewCenter = WebCore::IntPoint(coreFrameView->clientToDocumentPoint(clientCenterPoint.value())); 547 if (useViewportCoordinates) 548 inViewCenter = coreFrameView->contentsToRootView(inViewCenter.value()); 549 } 550 551 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, rect, inViewCenter, isObscured, String()), 0); 520 552 } 521 553
Note: See TracChangeset
for help on using the changeset viewer.