| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) |
| 3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> | 3 * Copyright (C) 2009 Antonio Gomes <tonikitoo@webkit.org> |
| 4 * | 4 * |
| 5 * All rights reserved. | 5 * All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
utRect& initialRect) | 360 static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
utRect& initialRect) |
| 361 { | 361 { |
| 362 LayoutRect rect = initialRect; | 362 LayoutRect rect = initialRect; |
| 363 for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) { | 363 for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) { |
| 364 if (!frame->isLocalFrame()) | 364 if (!frame->isLocalFrame()) |
| 365 continue; | 365 continue; |
| 366 // FIXME: Spatial navigation is broken for OOPI. | 366 // FIXME: Spatial navigation is broken for OOPI. |
| 367 Element* element = frame->deprecatedLocalOwner(); | 367 Element* element = frame->deprecatedLocalOwner(); |
| 368 if (element) { | 368 if (element) { |
| 369 for (; element; element = element->offsetParent()) | 369 do { |
| 370 rect.move(element->offsetLeft(), element->offsetTop()); | 370 rect.move(element->offsetLeft(), element->offsetTop()); |
| 371 LayoutObject* layoutObject = element->layoutObject(); |
| 372 element = layoutObject ? layoutObject->offsetParent() : nullptr; |
| 373 } while (element); |
| 371 rect.move((-toLocalFrame(frame)->view()->scrollOffset())); | 374 rect.move((-toLocalFrame(frame)->view()->scrollOffset())); |
| 372 } | 375 } |
| 373 } | 376 } |
| 374 return rect; | 377 return rect; |
| 375 } | 378 } |
| 376 | 379 |
| 377 LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder) | 380 LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder) |
| 378 { | 381 { |
| 379 ASSERT(node && node->layoutObject() && !node->document().view()->needsLayout
()); | 382 ASSERT(node && node->layoutObject() && !node->document().view()->needsLayout
()); |
| 380 | 383 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar
ea.document().frame(), area.computeRect(area.imageElement()->layoutObject())), 1
); | 625 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar
ea.document().frame(), area.computeRect(area.imageElement()->layoutObject())), 1
); |
| 623 return rect; | 626 return rect; |
| 624 } | 627 } |
| 625 | 628 |
| 626 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) | 629 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) |
| 627 { | 630 { |
| 628 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v
isibleNode) : nullptr; | 631 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v
isibleNode) : nullptr; |
| 629 }; | 632 }; |
| 630 | 633 |
| 631 } // namespace blink | 634 } // namespace blink |
| OLD | NEW |