-
rdar://problem/10786000mitz@apple.com authored
Source/WebCore: <rdar://problem/10786000> Selection highlights of lines in adjoining blocks can overlap https://bugs.webkit.org/show_bug.cgi?id=84489 Reviewed by Anders Carlsson. Test: fast/block/line-layout/selection-highlight-overlap.html * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::selectionRect): Changed to use selection{Top,Height}AdjustedForPrecedingBlock(). * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintSelection): Ditto. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::inlineSelectionGaps): Ditto. (WebCore::RenderBlock::blockBeforeWithinSelectionRoot): Added. Returns the block which is likely to contain the selected line just before the first line in this block, if it is within the same selection root. * rendering/RenderBlock.h: * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock): Added. If the selection starts before our block, finds the last line in the preceding block and adjusts the selection top to avoid overlap with that line’s selection bottom. * rendering/RootInlineBox.h: (WebCore::RootInlineBox::selectionHeightAdjustedForPrecedingBlock): Added. Like selectionHeight(), but uses selectionTopAdjustedForPrecedingBlock(). LayoutTests: Selection highlights of lines in adjoining blocks can overlap https://bugs.webkit.org/show_bug.cgi?id=84489 Reviewed by Anders Carlsson. * fast/block/line-layout/selection-highlight-overlap-expected.html: Added. * fast/block/line-layout/selection-highlight-overlap.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
e2068b8e