Changeset 171320 in webkit
- Timestamp:
- Jul 21, 2014 4:44:33 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r171316 r171320 1 2014-07-21 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Turn off position:fixed behavior when the keyboard is up 4 https://bugs.webkit.org/show_bug.cgi?id=132537 5 6 Reviewed by Benjamin Poulain. 7 8 Export RenderObject::localToContainerPoint(). 9 10 * WebCore.exp.in: 11 1 12 2014-07-21 Jer Noble <jer.noble@apple.com> 2 13 -
trunk/Source/WebCore/WebCore.exp.in
r171314 r171320 1614 1614 __ZNK7WebCore12RenderObject16repaintRectangleERKNS_10LayoutRectEb 1615 1615 __ZNK7WebCore12RenderObject20localToContainerQuadERKNS_9FloatQuadEPKNS_22RenderLayerModelObjectEjPb 1616 __ZNK7WebCore12RenderObject21localToContainerPointERKNS_10FloatPointEPKNS_22RenderLayerModelObjectEjPb 1616 1617 __ZNK7WebCore12RenderObject23absoluteBoundingBoxRectEb 1617 1618 __ZNK7WebCore12RenderObject39pixelSnappedAbsoluteClippedOverflowRectEv -
trunk/Source/WebKit2/ChangeLog
r171317 r171320 1 2014-07-21 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Turn off position:fixed behavior when the keyboard is up 4 https://bugs.webkit.org/show_bug.cgi?id=132537 5 6 Reviewed by Benjamin Poulain. 7 8 Make interaction with form elements inside position:fixed less terrible by re-laying out 9 fixed elements relative to the document while we have an assisted node. This ensures 10 that all parts of a position:fixed are accessible (e.g. inputs on the right side 11 of a fixed-width top bar). 12 13 * Shared/AssistedNodeInformation.cpp: Add a flag for being inside postion:fixed, 14 and encode/decode it. 15 (WebKit::AssistedNodeInformation::encode): 16 (WebKit::AssistedNodeInformation::decode): 17 * Shared/AssistedNodeInformation.h: 18 (WebKit::AssistedNodeInformation::AssistedNodeInformation): 19 * UIProcess/PageClient.h: Add isAssistingNode(). 20 * UIProcess/ios/PageClientImplIOS.h: 21 * UIProcess/ios/PageClientImplIOS.mm: 22 (WebKit::PageClientImpl::isAssistingNode): 23 * UIProcess/ios/WebPageProxyIOS.mm: 24 (WebKit::WebPageProxy::computeCustomFixedPositionRect): If we have an assisted 25 node, just use the document rect as the custom fixed position rect. 26 * WebProcess/WebPage/ios/WebPageIOS.mm: 27 (WebKit::WebPage::getAssistedNodeInformation): Get the selection rect first, 28 since we have to fix it up for position:fixed. If the element is inside fixed 29 position in the main frame, re-set the fixed position rect to the document rect 30 (which forces a layout), re-fetch elementRect, then set it back. This ensures 31 that the UI process gets an elementRect which it can zoom to correctly. 32 1 33 2014-07-21 Timothy Horton <timothy_horton@apple.com> 2 34 -
trunk/Source/WebKit2/Shared/AssistedNodeInformation.cpp
r170321 r171320 80 80 encoder << isReadOnly; 81 81 encoder << allowsUserScaling; 82 encoder << insideFixedPosition; 82 83 encoder << value; 83 84 encoder << valueAsNumber; … … 135 136 return false; 136 137 138 if (!decoder.decode(result.insideFixedPosition)) 139 return false; 140 137 141 if (!decoder.decode(result.value)) 138 142 return false; -
trunk/Source/WebKit2/Shared/AssistedNodeInformation.h
r170321 r171320 103 103 , isReadOnly(false) 104 104 , allowsUserScaling(false) 105 , insideFixedPosition(false) 105 106 , autocapitalizeType(WebAutocapitalizeTypeDefault) 106 107 , elementType(InputType::None) … … 121 122 bool isReadOnly; 122 123 bool allowsUserScaling; 124 bool insideFixedPosition; 123 125 WebAutocapitalizeType autocapitalizeType; 124 126 InputType elementType; -
trunk/Source/WebKit2/UIProcess/PageClient.h
r171154 r171320 260 260 virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) = 0; 261 261 virtual void stopAssistingNode() = 0; 262 virtual bool isAssistingNode() = 0; 262 263 virtual void selectionDidChange() = 0; 263 264 virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r171154 r171320 120 120 virtual void startAssistingNode(const AssistedNodeInformation&, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) override; 121 121 virtual void stopAssistingNode() override; 122 virtual bool isAssistingNode() override; 122 123 virtual void selectionDidChange() override; 123 124 virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) override; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r171154 r171320 531 531 } 532 532 533 bool PageClientImpl::isAssistingNode() 534 { 535 return [m_contentView isAssistingNode]; 536 } 537 533 538 void PageClientImpl::stopAssistingNode() 534 539 { -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r171203 r171320 38 38 #import "WKInspectorNodeSearchGestureRecognizer.h" 39 39 #import "WKWebViewConfiguration.h" 40 #import "WKWebViewInternal.h" 40 41 #import "WKWebViewPrivate.h" 41 42 #import "WebEvent.h" … … 2549 2550 break; 2550 2551 } 2552 2553 if (information.insideFixedPosition) 2554 [_webView _updateVisibleContentRects]; 2555 2551 2556 [self reloadInputViews]; 2552 2557 [self _displayFormNodeInputView]; -
trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
r171154 r171320 221 221 FloatRect documentRect = FloatRect(FloatPoint(), contentsSize); 222 222 223 if (m_pageClient.isAssistingNode()) 224 return documentRect; 225 223 226 if (constraint == UnobscuredRectConstraint::ConstrainedToDocumentRect) 224 227 constrainedUnobscuredRect.intersect(documentRect); -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r171280 r171320 1990 1990 layoutIfNeeded(); 1991 1991 1992 // FIXME: This should return the selection rect, but when this is called at focus time 1993 // we don't have a selection yet. Using the last interaction location is a reasonable approximation for now. 1994 // FIXME: should the selection rect always be inside the elementRect? 1995 information.selectionRect = IntRect(m_lastInteractionLocation, IntSize(1, 1)); 1996 1992 1997 if (RenderObject* renderer = m_assistedNode->renderer()) { 1993 information.elementRect = m_page->focusController().focusedOrMainFrame().view()->contentsToRootView(renderer->absoluteBoundingBoxRect()); 1998 Frame& elementFrame = m_page->focusController().focusedOrMainFrame(); 1999 information.elementRect = elementFrame.view()->contentsToRootView(renderer->absoluteBoundingBoxRect()); 1994 2000 information.nodeFontSize = renderer->style().fontDescription().computedSize(); 2001 2002 bool inFixed = false; 2003 renderer->localToContainerPoint(FloatPoint(), nullptr, 0, &inFixed); 2004 information.insideFixedPosition = inFixed; 2005 2006 if (inFixed && elementFrame.isMainFrame()) { 2007 FrameView* frameView = elementFrame.view(); 2008 IntRect currentFixedPositionRect = frameView->customFixedPositionLayoutRect(); 2009 frameView->setCustomFixedPositionLayoutRect(frameView->renderView()->documentRect()); 2010 information.elementRect = frameView->contentsToRootView(renderer->absoluteBoundingBoxRect()); 2011 frameView->setCustomFixedPositionLayoutRect(currentFixedPositionRect); 2012 2013 if (!information.elementRect.contains(information.selectionRect)) 2014 information.selectionRect.setLocation(information.elementRect.location()); 2015 } 1995 2016 } else 1996 2017 information.elementRect = IntRect(); 1997 // FIXME: This should return the selection rect, but when this is called at focus time 1998 // we don't have a selection yet. Using the last interaction location is a reasonable approximation for now. 1999 information.selectionRect = IntRect(m_lastInteractionLocation, IntSize(1, 1)); 2018 2000 2019 information.minimumScaleFactor = m_viewportConfiguration.minimumScale(); 2001 2020 information.maximumScaleFactor = m_viewportConfiguration.maximumScale();
Note: See TracChangeset
for help on using the changeset viewer.