We currently provide the element rect only when the element is first focused and we use that to clip the selection before drawing. If the element is resized/repositioned via Javascript or CSS, we continue to use the clipping rectangle at the time the element was focused. Pages like google.com or imdb.com show the incorrect clipping of the caret. rdar://problem/20521252
Created attachment 252345 [details] Patch
Did you try a debug build or turning the assertions in postLayoutData() into RELEASE_ASSERTs?
Comment on attachment 252345 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=252345&action=review r=me with nits. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:190 > + Frame& elementFrame = m_page->focusController().focusedOrMainFrame(); I believe this is equivalent to the frame argument of this method. It is initialized in WebPage::editorState() as: Frame& frame = m_page->focusController().focusedOrMainFrame(); So this variable is not needed. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:191 > + postLayoutData.selectionClipRect = elementFrame.view()->contentsToRootView(m_assistedNode->renderer()->absoluteBoundingBoxRect()); postLayoutData.selectionClipRect = view->contentsToRootView(m_assistedNode->renderer()->absoluteBoundingBoxRect()); We already have a variable of the view.
(In reply to comment #3) > Comment on attachment 252345 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=252345&action=review > > r=me with nits. > > > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:190 > > + Frame& elementFrame = m_page->focusController().focusedOrMainFrame(); > > I believe this is equivalent to the frame argument of this method. It is > initialized in WebPage::editorState() as: > Frame& frame = m_page->focusController().focusedOrMainFrame(); > > So this variable is not needed. > > > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:191 > > + postLayoutData.selectionClipRect = elementFrame.view()->contentsToRootView(m_assistedNode->renderer()->absoluteBoundingBoxRect()); > > postLayoutData.selectionClipRect = > view->contentsToRootView(m_assistedNode->renderer()- > >absoluteBoundingBoxRect()); > > We already have a variable of the view. Duh! This is what you get for copy/paste. Thanks for the review. I've fixed it.
Committed revision 183780.