[webkit-reviews] review denied: [Bug 5401] [WebCoreBridge firstRectForDOMRange:] works incorrectly for the first character after a line wrap : [Attachment 4383] proposed patch

bugzilla-request-daemon at opendarwin.org bugzilla-request-daemon at opendarwin.org
Tue Oct 18 17:19:41 PDT 2005


Justin Garcia <justin.garcia at apple.com> has denied Maciej Stachowiak
<mjs at apple.com>'s request for review:
Bug 5401: [WebCoreBridge firstRectForDOMRange:] works incorrectly for the first
character after a line wrap
http://bugzilla.opendarwin.org/show_bug.cgi?id=5401

Attachment 4383: proposed patch
http://bugzilla.opendarwin.org/attachment.cgi?id=4383&action=edit

------- Additional Comments from Justin Garcia <justin.garcia at apple.com>
I'm not sure that this patch is right.

Alexey, you write that the rects returned by firstRectForDOMRange for ranges
after a line wrap are all positioned at the spot where the line wraps. 
However, in your test case, the sequence that you use doesn't wrap because it
uses a hard hyphen "aaaaaaaaaa–aaaaaaaaaaaaaaaaaaaaaaa".  The sequence just
spills outside its width:100px containing block.

The test case still illustrates a bug, I think, which is that the rects
returned from firstRectForDOMRange should reflect text that has overflowed. 
The rects returned are probably only approrpriate for
overflow:hidden/scroll/auto.  I think that the bug is in
RenderText::caretRect(...):

RenderBlock *cb = containingBlock();
int availableWidth = cb->lineWidth(top);
if (style()->whiteSpace() == NORMAL)
	left = kMin(left, absx + box->m_x + availableWidth - 1);

Perhaps we should only do the kMin if overflow is not "none".  What do you
think?



More information about the webkit-reviews mailing list