RESOLVED FIXED 94343
[Chromium] Find-in-page coordinates should use containingBlock
https://bugs.webkit.org/show_bug.cgi?id=94343
Summary [Chromium] Find-in-page coordinates should use containingBlock
Leandro Graciá Gil
Reported 2012-08-17 06:47:06 PDT
The current find-in-page coordinates implementation uses the container method to climb the render tree. However, it would be more correct and convenient to use containerBlock instead.
Attachments
Patch (11.70 KB, patch)
2012-08-17 06:53 PDT, Leandro Graciá Gil
no flags
Patch (11.90 KB, patch)
2012-08-20 14:34 PDT, Leandro Graciá Gil
no flags
Leandro Graciá Gil
Comment 1 2012-08-17 06:49:51 PDT
(In reply to comment #0) > The current find-in-page coordinates implementation uses the container method to climb the render tree. However, it would be more correct and convenient to use containerBlock instead. (In reply to comment #0) > The current find-in-page coordinates implementation uses the container method to climb the render tree. However, it would be more correct and convenient to use containerBlock instead. containerBlock -> containingBlock.
Leandro Graciá Gil
Comment 2 2012-08-17 06:53:55 PDT
Julien Chaffraix
Comment 3 2012-08-20 11:33:44 PDT
Comment on attachment 159112 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=159112&action=review > Source/WebKit/chromium/src/FindInPageCoordinates.cpp:56 > + const RenderBlock* container = renderer->containingBlock(); ASSERT(container || renderer->isRenderView()); ? > Source/WebKit/chromium/src/FindInPageCoordinates.cpp:104 > + FloatRect normalizedBoxRect = toNormalizedRect(renderer->absoluteBoundingBoxRect(), renderer); You don't need to pass renderer->absoluteBoundingBoxRect() here. You could compute it in toNormalizedRect after you passed the |container| NULL-check. > Source/WebKit/chromium/tests/WebFrameTest.cpp:978 > + // Results 13, 12 and 14 should be one above the other in that order because of the rowspan. and because HTML table cells have vertical-align: middle set (CSS table cells have vertical-align: baseline which yields to a different result).
Leandro Graciá Gil
Comment 4 2012-08-20 14:34:47 PDT
Leandro Graciá Gil
Comment 5 2012-08-20 14:35:05 PDT
Comment on attachment 159112 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=159112&action=review >> Source/WebKit/chromium/src/FindInPageCoordinates.cpp:56 >> + const RenderBlock* container = renderer->containingBlock(); > > ASSERT(container || renderer->isRenderView()); ? Done. >> Source/WebKit/chromium/src/FindInPageCoordinates.cpp:104 >> + FloatRect normalizedBoxRect = toNormalizedRect(renderer->absoluteBoundingBoxRect(), renderer); > > You don't need to pass renderer->absoluteBoundingBoxRect() here. You could compute it in toNormalizedRect after you passed the |container| NULL-check. toNormalizedRect is also used above with the input rect from the range. That's why that call is not already inside toNormalizedRect. >> Source/WebKit/chromium/tests/WebFrameTest.cpp:978 >> + // Results 13, 12 and 14 should be one above the other in that order because of the rowspan. > > and because HTML table cells have vertical-align: middle set (CSS table cells have vertical-align: baseline which yields to a different result). True, good point. Thanks.
Leandro Graciá Gil
Comment 6 2012-08-21 11:47:42 PDT
Any pending issues here? (In reply to comment #5) > (From update of attachment 159112 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=159112&action=review > > >> Source/WebKit/chromium/src/FindInPageCoordinates.cpp:56 > >> + const RenderBlock* container = renderer->containingBlock(); > > > > ASSERT(container || renderer->isRenderView()); ? > > Done. > > >> Source/WebKit/chromium/src/FindInPageCoordinates.cpp:104 > >> + FloatRect normalizedBoxRect = toNormalizedRect(renderer->absoluteBoundingBoxRect(), renderer); > > > > You don't need to pass renderer->absoluteBoundingBoxRect() here. You could compute it in toNormalizedRect after you passed the |container| NULL-check. > > toNormalizedRect is also used above with the input rect from the range. That's why that call is not already inside toNormalizedRect. > > >> Source/WebKit/chromium/tests/WebFrameTest.cpp:978 > >> + // Results 13, 12 and 14 should be one above the other in that order because of the rowspan. > > > > and because HTML table cells have vertical-align: middle set (CSS table cells have vertical-align: baseline which yields to a different result). > > True, good point. Thanks.
WebKit Review Bot
Comment 7 2012-08-21 16:05:43 PDT
Comment on attachment 159524 [details] Patch Clearing flags on attachment: 159524 Committed r126204: <http://trac.webkit.org/changeset/126204>
WebKit Review Bot
Comment 8 2012-08-21 16:05:46 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.