Changeset 240195 in webkit
- Timestamp:
- Jan 18, 2019 8:22:41 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240190 r240195 1 2019-01-18 Brian Burg <bburg@apple.com> 2 3 Automation.computeElementLayout should return visual viewport-aware coordinates 4 https://bugs.webkit.org/show_bug.cgi?id=193598 5 <rdar://problem/35325644> 6 7 Reviewed by Simon Fraser. 8 9 * page/FrameView.h: export symbol to be usable from WebKit. 10 * page/FrameView.cpp: 11 (WebCore::FrameView::clientToLayoutViewportRect const): Added. 12 Do the same thing as clientToLayoutViewportPoint with a rect instead. 13 14 1 15 2019-01-18 Eric Carlson <eric.carlson@apple.com> 2 16 -
trunk/Source/WebCore/page/FrameView.cpp
r240139 r240195 4884 4884 } 4885 4885 4886 FloatRect FrameView::clientToLayoutViewportRect(FloatRect rect) const 4887 { 4888 ASSERT(frame().settings().visualViewportEnabled()); 4889 rect.scale(frame().pageZoomFactor()); 4890 return rect; 4891 } 4892 4886 4893 FloatPoint FrameView::clientToLayoutViewportPoint(FloatPoint p) const 4887 4894 { -
trunk/Source/WebCore/page/FrameView.h
r240139 r240195 487 487 488 488 // Unlike client coordinates, layout viewport coordinates are affected by page zoom. 489 FloatPoint clientToLayoutViewportPoint(FloatPoint) const; 489 WEBCORE_EXPORT FloatRect clientToLayoutViewportRect(FloatRect) const; 490 WEBCORE_EXPORT FloatPoint clientToLayoutViewportPoint(FloatPoint) const; 490 491 491 492 bool isFrameViewScrollCorner(const RenderScrollbarPart& scrollCorner) const { return m_scrollCorner.get() == &scrollCorner; } -
trunk/Source/WebKit/ChangeLog
r240183 r240195 1 2019-01-18 Brian Burg <bburg@apple.com> 2 3 Automation.computeElementLayout should return visual viewport-aware coordinates 4 https://bugs.webkit.org/show_bug.cgi?id=193598 5 <rdar://problem/35325644> 6 7 Reviewed by Simon Fraser. 8 9 Previously I added CoordinateSystem::VisualViewport to stub out this for iOS. 10 But I think that it's a mistake for safaridriver to care about VisualViewport 11 being enabled or not, because it is a runtime-switchable setting. 12 13 This patch removes CoordinateSystem::VisualViewport. Make the existing 14 CoordinateSystem::LayoutViewport use visual viewport semantics if needed. 15 16 This is tested by WebDriver element clicking tests. There should not be any 17 difference in behavior until it is possible to zoom with gestures via WebDriver. 18 19 * Shared/CoordinateSystem.h: 20 * UIProcess/Automation/Automation.json: 21 * UIProcess/Automation/WebAutomationSession.cpp: 22 (WebKit::protocolStringToCoordinateSystem): 23 * WebProcess/Automation/WebAutomationSessionProxy.cpp: 24 (WebKit::WebAutomationSessionProxy::computeElementLayout): 25 1 26 2019-01-18 Daniel Bates <dabates@apple.com> 2 27 -
trunk/Source/WebKit/Shared/CoordinateSystem.h
r237110 r240195 32 32 enum class CoordinateSystem : uint8_t { 33 33 Page = 0, 34 LayoutViewport, 35 VisualViewport, 34 LayoutViewport 36 35 }; 37 36 … … 43 42 using values = EnumValues< 44 43 WebKit::CoordinateSystem, 45 WebKit::CoordinateSystem::Page, 46 WebKit::CoordinateSystem::LayoutViewport, 47 WebKit::CoordinateSystem::VisualViewport 44 WebKit::CoordinateSystem::Page 48 45 >; 49 46 }; -
trunk/Source/WebKit/UIProcess/Automation/Automation.json
r239988 r240195 33 33 "enum": [ 34 34 "Page", 35 "LayoutViewport", 36 "VisualViewport" 35 "LayoutViewport" 37 36 ] 38 37 }, -
trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
r239988 r240195 1005 1005 if (coordinateSystemString == "LayoutViewport") 1006 1006 return CoordinateSystem::LayoutViewport; 1007 if (coordinateSystemString == "VisualViewport")1008 return CoordinateSystem::VisualViewport;1009 1007 return WTF::nullopt; 1010 1008 } -
trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
r240014 r240195 568 568 } 569 569 570 if (coordinateSystem == CoordinateSystem::VisualViewport) {571 WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidComputeElementLayout(callbackID, { }, WTF::nullopt, false, notImplementedErrorType), 0);572 return;573 }574 575 570 WebCore::FrameView* frameView = frame->coreFrame()->view(); 576 571 WebCore::FrameView* mainView = frame->coreFrame()->mainFrame().view(); … … 584 579 case CoordinateSystem::LayoutViewport: 585 580 // The element bounds are already in client coordinates. 586 resultElementBounds = rootElementBounds;587 break;588 case CoordinateSystem::VisualViewport:589 ASSERT_NOT_REACHED();581 if (frame->coreFrame()->settings().visualViewportEnabled()) 582 resultElementBounds = WebCore::IntRect(mainView->clientToLayoutViewportRect(WebCore::FloatRect(rootElementBounds))); 583 else 584 resultElementBounds = rootElementBounds; 590 585 break; 591 586 } … … 603 598 case CoordinateSystem::LayoutViewport: 604 599 // The point is already in client coordinates. 605 resultInViewCenterPoint = rootInViewCenterPoint;606 break;607 case CoordinateSystem::VisualViewport:608 ASSERT_NOT_REACHED();600 if (frame->coreFrame()->settings().visualViewportEnabled()) 601 resultInViewCenterPoint = WebCore::IntPoint(mainView->clientToLayoutViewportPoint(rootInViewCenterPoint)); 602 else 603 resultInViewCenterPoint = rootInViewCenterPoint; 609 604 break; 610 605 }
Note: See TracChangeset
for help on using the changeset viewer.