| 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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 | 495 |
| 496 static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
utRect& initialRect) | 496 static LayoutRect rectToAbsoluteCoordinates(LocalFrame* initialFrame, const Layo
utRect& initialRect) |
| 497 { | 497 { |
| 498 LayoutRect rect = initialRect; | 498 LayoutRect rect = initialRect; |
| 499 for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) { | 499 for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) { |
| 500 if (!frame->isLocalFrame()) | 500 if (!frame->isLocalFrame()) |
| 501 continue; | 501 continue; |
| 502 // FIXME: Spatial navigation is broken for OOPI. | 502 // FIXME: Spatial navigation is broken for OOPI. |
| 503 if (Element* element = frame->deprecatedLocalOwner()) { | 503 Element* element = frame->deprecatedLocalOwner(); |
| 504 do { | 504 if (element) { |
| 505 for (; element; element = element->offsetParent()) |
| 505 rect.move(element->offsetLeft(), element->offsetTop()); | 506 rect.move(element->offsetLeft(), element->offsetTop()); |
| 506 } while ((element = element->offsetParent())); | |
| 507 rect.move((-toLocalFrame(frame)->view()->scrollOffset())); | 507 rect.move((-toLocalFrame(frame)->view()->scrollOffset())); |
| 508 } | 508 } |
| 509 } | 509 } |
| 510 return rect; | 510 return rect; |
| 511 } | 511 } |
| 512 | 512 |
| 513 LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder) | 513 LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder) |
| 514 { | 514 { |
| 515 ASSERT(node && node->renderer() && !node->document().view()->needsLayout()); | 515 ASSERT(node && node->renderer() && !node->document().view()->needsLayout()); |
| 516 | 516 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar
ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); | 747 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar
ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); |
| 748 return rect; | 748 return rect; |
| 749 } | 749 } |
| 750 | 750 |
| 751 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) | 751 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) |
| 752 { | 752 { |
| 753 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v
isibleNode) : 0; | 753 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v
isibleNode) : 0; |
| 754 }; | 754 }; |
| 755 | 755 |
| 756 } // namespace WebCore | 756 } // namespace WebCore |
| OLD | NEW |