Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: Source/core/page/SpatialNavigation.cpp

Issue 302213002: Convert page-level classes to handle RemoteFrames from FrameTree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 return rect.height() + offset.height() < size.height(); 489 return rect.height() + offset.height() < size.height();
490 default: 490 default:
491 ASSERT_NOT_REACHED(); 491 ASSERT_NOT_REACHED();
492 return false; 492 return false;
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 (LocalFrame* frame = initialFrame; frame; frame = frame->tree().parent() ) { 499 for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) {
500 if (!frame->isLocalFrame())
501 continue;
500 if (Element* element = frame->ownerElement()) { 502 if (Element* element = frame->ownerElement()) {
501 do { 503 do {
502 rect.move(element->offsetLeft(), element->offsetTop()); 504 rect.move(element->offsetLeft(), element->offsetTop());
503 } while ((element = element->offsetParent())); 505 } while ((element = element->offsetParent()));
504 rect.move((-frame->view()->scrollOffset())); 506 rect.move((-toLocalFrame(frame)->view()->scrollOffset()));
505 } 507 }
506 } 508 }
507 return rect; 509 return rect;
508 } 510 }
509 511
510 LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder) 512 LayoutRect nodeRectInAbsoluteCoordinates(Node* node, bool ignoreBorder)
511 { 513 {
512 ASSERT(node && node->renderer() && !node->document().view()->needsLayout()); 514 ASSERT(node && node->renderer() && !node->document().view()->needsLayout());
513 515
514 if (node->isDocumentNode()) 516 if (node->isDocumentNode())
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1); 746 LayoutRect rect = virtualRectForDirection(type, rectToAbsoluteCoordinates(ar ea.document().frame(), area.computeRect(area.imageElement()->renderer())), 1);
745 return rect; 747 return rect;
746 } 748 }
747 749
748 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate) 750 HTMLFrameOwnerElement* frameOwnerElement(FocusCandidate& candidate)
749 { 751 {
750 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v isibleNode) : 0; 752 return candidate.isFrameOwnerElement() ? toHTMLFrameOwnerElement(candidate.v isibleNode) : 0;
751 }; 753 };
752 754
753 } // namespace WebCore 755 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/ScopedPageLoadDeferrer.cpp ('k') | Source/core/page/scrolling/ScrollingCoordinator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698