Changeset 61250 in webkit
- Timestamp:
- Jun 16, 2010 4:46:51 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r61248 r61250 1 2010-06-16 Antonio Gomes <tonikitoo@webkit.org> 2 3 Reviewed by Kenneth Christiansen. 4 5 Spatial Navigation: using offset{Left,Top} is not enough to get the proper inner frames position 6 https://bugs.webkit.org/show_bug.cgi?id=39439 7 8 * fast/events/spatial-navigation/snav-iframe-recursive-offset-parent-expected.txt: Added. 9 * fast/events/spatial-navigation/snav-iframe-recursive-offset-parent.html: Added. 10 1 11 2010-06-16 Eric Seidel <eric@webkit.org> 2 12 -
trunk/WebCore/ChangeLog
r61249 r61250 1 2010-06-16 Antonio Gomes <tonikitoo@webkit.org> 2 3 Reviewed by Kenneth Christiansen. 4 5 Spatial Navigation: using offset{Left,Top} is not enough to get the proper inner frames position 6 https://bugs.webkit.org/show_bug.cgi?id=39439 7 8 As pointed out by Darin Adler in https://bugs.webkit.org/show_bug.cgi?id=18662#c20, 9 "It's not correct to use the offsetLeft and offsetTop of the frame owner element's renderer because 10 that's just the distance from the offsetParent, not the absolute position". 11 12 Patch fixes that behavior by now considering the offsetTop and offsetLeft the offsetParent recursively, 13 starting from the HtmlFrameOwnerElement. Previously, only calling offsetTop and offsetLeft works 14 because all tests were done in htmls where the {i}frame element was a directly a child of the body, 15 e.g. <html>...<body><iframe src=xxx>....<body></html>. 16 17 Test: fast/events/spatial-navigation/snav-iframe-recursive-offset-parent.html 18 19 * page/SpatialNavigation.cpp: 20 (WebCore::renderRectRelativeToRootDocument): 21 1 22 2010-06-16 Dan Bernstein <mitz@apple.com> 2 23 -
trunk/WebCore/page/SpatialNavigation.cpp
r61134 r61250 126 126 // Handle nested frames. 127 127 for (Frame* frame = render->document()->frame(); frame; frame = frame->tree()->parent()) { 128 if (HTMLFrameOwnerElement* ownerElement = frame->ownerElement()) 129 rect.move(ownerElement->offsetLeft(), ownerElement->offsetTop()); 128 if (Element* element = static_cast<Element*>(frame->ownerElement())) { 129 do { 130 rect.move(element->offsetLeft(), element->offsetTop()); 131 } while ((element = element->offsetParent())); 132 } 130 133 } 131 134
Note: See TracChangeset
for help on using the changeset viewer.