RESOLVED FIXED 47237
Make selection work with vertical text.
https://bugs.webkit.org/show_bug.cgi?id=47237
Summary Make selection work with vertical text.
Dave Hyatt
Reported 2010-10-05 17:58:17 PDT
Make selection work with vertical text.
Attachments
Patch (1.05 MB, patch)
2010-11-05 14:26 PDT, Dave Hyatt
mitz: review+
Patch (1.06 MB, patch)
2010-11-05 22:04 PDT, Dave Hyatt
simon.fraser: review+
Adele Peterson
Comment 1 2010-10-29 15:13:02 PDT
Dave Hyatt
Comment 2 2010-11-05 14:26:00 PDT
Early Warning System Bot
Comment 3 2010-11-05 15:00:50 PDT
mitz
Comment 4 2010-11-05 15:09:56 PDT
Comment on attachment 73118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=73118&action=review Found one mistake. > WebCore/rendering/RenderBlock.cpp:2709 > + if (!paintInfo || (style()->isHorizontalWritingMode() && physicalRect.y() < paintInfo->rect.bottom() && physicalRect.bottom() > paintInfo->rect.y() > + || (!style()->isHorizontalWritingMode() && physicalRect.x() < paintInfo->rect.right() && physicalRect.right() > paintInfo->rect.x()))) Redundant parentheses there. > WebCore/rendering/RenderBlock.h:121 > + IntRect logicalLeftSelectionGap(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + RenderObject* selObj, int logicalLeft, int logicalTop, int logicalHeight, const PaintInfo* paintInfo); > + IntRect logicalRightSelectionGap(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + RenderObject* selObj, int logicalRight, int logicalTop, int logicalHeight, const PaintInfo* paintInfo); Don’t add the argument name “paintInfo”. > WebCore/rendering/RenderBlock.h:541 > + GapRects selectionGaps(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + int& lastLogicalTop, int& lastLogicalLeft, int& lastLogicalRight, const PaintInfo* paintInfo = 0); > + GapRects inlineSelectionGaps(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + int& lastLogicalTop, int& lastLogicalLeft, int& lastLogicalRight, const PaintInfo* paintInfo); > + GapRects blockSelectionGaps(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + int& lastLogicalTop, int& lastLogicalLeft, int& lastLogicalRight, const PaintInfo* paintInfo); > + IntRect blockSelectionGap(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + int lastLogicalTop, int lastLogicalLeft, int lastLogicalRight, int logicalBottom, const PaintInfo* paintInfo); > int logicalLeftSelectionOffset(RenderBlock* rootBlock, int position); Ditto. > WebCore/rendering/RenderBlock.h:543 > + whitespace! > WebCore/rendering/RenderBox.cpp:3245 > + return style()->isHorizontalWritingMode() ? IntSize(offset.width(), logicalHeight() - offset.height()) : IntSize(logicalHeight() - offset.width(), offset.height()); Should be logicalWidth() - offset.width() in the second branch. > WebCore/rendering/RootInlineBox.cpp:254 > +GapRects RootInlineBox::lineSelectionGap(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > + int selTop, int selHeight, const PaintInfo* paintInfo) Can omit “paintInfo”.
mitz
Comment 5 2010-11-05 15:12:00 PDT
(In reply to comment #4) > > WebCore/rendering/RootInlineBox.cpp:254 > > +GapRects RootInlineBox::lineSelectionGap(RenderBlock* rootBlock, const IntPoint& rootBlockPhysicalPosition, const IntSize& offsetFromRootBlock, > > + int selTop, int selHeight, const PaintInfo* paintInfo) > > Can omit “paintInfo”. Ignore this :)
Dave Hyatt
Comment 6 2010-11-05 22:04:25 PDT
Dave Hyatt
Comment 7 2010-11-05 22:06:25 PDT
This new patch addresses Dan's comments, but more importantly it fixes one failing layout test from the previous patch. See the second paragraph of the WebCore ChangeLog for the explanation. The only change is to RootInlineBox::selectionTop() (to now extend selection up to the top content edge of the block now that lineTop no longer always starts there) and changing RenderBlock::positionForPoint to just exactly match selection as far as what line it chooses when you're in between lines.
Dave Hyatt
Comment 8 2010-11-05 22:50:18 PDT
Fixed in r71465.
Csaba Osztrogonác
Comment 9 2010-11-06 01:41:23 PDT
(In reply to comment #8) > Fixed in r71465. It made editing/selection/after-line-break.html fail on Qt bot, I filed a new bug on it: https://bugs.webkit.org/show_bug.cgi?id=49127
Kamil Blank
Comment 11 2011-08-09 07:38:41 PDT
Hi, After this patch and changes made inside RootInlineBox::selectionTop(), I've noticed some problem on BBC site which I reported here: https://bugs.webkit.org/show_bug.cgi?id=65307 Could you please take a look on it? (In reply to comment #7) > This new patch addresses Dan's comments, but more importantly it fixes one failing layout test from the previous patch. See the second paragraph of the WebCore ChangeLog for the explanation. The only change is to RootInlineBox::selectionTop() (to now extend selection up to the top content edge of the block now that lineTop no longer always starts there) and changing RenderBlock::positionForPoint to just exactly match selection as far as what line it chooses when you're in between lines.
Note You need to log in before you can comment on or make changes to this bug.