RESOLVED FIXED 65722
Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local*
https://bugs.webkit.org/show_bug.cgi?id=65722
Summary Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local*
Simon Fraser (smfr)
Reported 2011-08-04 15:02:45 PDT
RenderText::absoluteQuadsForRange() has: FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight); if (!rect.isZero()) quads.append(localToAbsoluteQuad(rect)); This is converting local to absolute twice.
Attachments
Patch (2.59 KB, patch)
2011-08-05 13:47 PDT, Emil A Eklund
no flags
Patch (8.40 KB, patch)
2011-08-05 16:13 PDT, Emil A Eklund
no flags
Simon Fraser (smfr)
Comment 1 2011-08-04 15:03:02 PDT
Emil A Eklund
Comment 2 2011-08-05 10:58:24 PDT
Actually I think it's just an unfortunate (and incorrect) name. absoluteQuadForTextBox doesn't convert to absolute, I'll make sure this is the case and rename it to localQuadForTextBox.
Emil A Eklund
Comment 3 2011-08-05 13:47:02 PDT
Simon Fraser (smfr)
Comment 4 2011-08-05 13:51:37 PDT
Comment on attachment 103101 [details] Patch Not sure this is right. quadForTextBox() calls selectionRect(), which uses selectionRectForRepaint(). The 'for repaint' indicates that it's already been converted to the coordinate system of the repaintContainer (or the root). If there aren't repaint tests for this code, you should make some.
Emil A Eklund
Comment 5 2011-08-05 14:41:41 PDT
The change 91763 didn't change change any logic apart from replacing a check for (!r.isEmpty()) with (r.height()) to match absoluteRectsForRange. Just as before it calls selectionRect and then adjust the rect and converts it to the absolute coordinate space using localToAbsoluteQuad. As far as I can tell quadForTextBox calls InlineTextBox::selectionRect which in turn returns the selection rect in the local coordinate space. There are a couple of tests that cover this code already and they helped me catch a a mistake in the first version of my patch. If you still do not trust this to be correct I'd gladly revert change 91763.
Simon Fraser (smfr)
Comment 6 2011-08-05 14:47:06 PDT
Ah, InlineTextBox::selectionRect() is in local coords, RenderObject::selectionRect() is in "repaint" coords. The former should be renamed ("localSelectionRect()"?)
Emil A Eklund
Comment 7 2011-08-05 14:57:47 PDT
(In reply to comment #6) > Ah, InlineTextBox::selectionRect() is in local coords, RenderObject::selectionRect() is in "repaint" coords. The former should be renamed ("localSelectionRect()"?) Makes sense, I'll make the change. Thanks!
Emil A Eklund
Comment 8 2011-08-05 16:13:50 PDT
Emil A Eklund
Comment 9 2011-08-05 16:21:06 PDT
Thanks Simon!
WebKit Review Bot
Comment 10 2011-08-08 13:11:36 PDT
Comment on attachment 103128 [details] Patch Clearing flags on attachment: 103128 Committed r92625: <http://trac.webkit.org/changeset/92625>
WebKit Review Bot
Comment 11 2011-08-08 13:11:40 PDT
All reviewed patches have been landed. Closing bug.
Simon Fraser (smfr)
Comment 12 2012-10-23 15:55:00 PDT
RenderText::absoluteRectsForRange still has: // FIXME: This code is wrong. It's converting local to absolute twice. http://webkit.org/b/65722
Tim Horton
Comment 13 2013-04-12 01:16:01 PDT
The confusing comment remains and I have no idea if it's true or not anymore (but it seems not).
Tim Horton
Comment 14 2017-07-21 16:09:34 PDT
It's still there :(
Tim Horton
Comment 15 2017-07-21 17:13:31 PDT
Note You need to log in before you can comment on or make changes to this bug.