This bugs track a number of issues in block selections in WK2: - incorrect block detections shrinking a block selection - crashes when extending a selection across frame boundaries - bugs in switching from text to block selection. <rdar://problem/16817263>
Created attachment 234117 [details] Patch
Comment on attachment 234117 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=234117&action=review > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:760 > + // Make sure the block is selectable. Probably not useful. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:764 > + if (renderer->childrenInline() && (renderer->isRenderBlock() && toRenderBlock(renderer)->inlineElementContinuation() == nil) && !renderer->isTable()) { This "== nil" probably comes from UIKit, you can update this to the WebKit style. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:770 > + // If all we could find is a block whose height is veriy close to the height Typo: "veriy" > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:772 > + const float factor = .97; Maybe find a better name for this? > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:774 > + boundingRectInScrollViewCoordinates.scale(m_page->pageScaleFactor()); This is unlikely correct. The absoluteBoundingBoxRect and unobscuredContentRect should be in the same coordinate system already. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:776 > + if (boundingRectInScrollViewCoordinates.height() > m_page->mainFrame().view()->unobscuredContentRect().height() * factor) You may want to use the exposedContentRect() here to make the behavior more predictable. Otherwise the behavior would change depending if the bars are in or out. It probably does not matter much. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1258 > - newRange = Range::create(newRange->startContainer()->document(), newRange->startPosition(), currentRange->endPosition()); > + newRange = Range::create(newRange->startContainer()->document(), newRange->endPosition(), currentRange->endPosition()); > else > - newRange = Range::create(newRange->startContainer()->document(), currentRange->startPosition(), newRange->endPosition()); > + newRange = Range::create(newRange->startContainer()->document(), currentRange->startPosition(), newRange->startPosition()); Can you add an explanation for this fix in the ChangeLog?
Committed revision 170620.