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

Side by Side Diff: Source/core/dom/TreeScope.cpp

Issue 33353003: Have Frame::tree() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/TouchController.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. 2 * Copyright (C) 2011 Google Inc. All Rights Reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 ASSERT(node); 339 ASSERT(node);
340 ASSERT(!node->isDocumentNode()); 340 ASSERT(!node->isDocumentNode());
341 ASSERT_WITH_SECURITY_IMPLICATION(!node->m_deletionHasBegun); 341 ASSERT_WITH_SECURITY_IMPLICATION(!node->m_deletionHasBegun);
342 TreeScopeAdopter adopter(node, this); 342 TreeScopeAdopter adopter(node, this);
343 if (adopter.needsScopeChange()) 343 if (adopter.needsScopeChange())
344 adopter.execute(); 344 adopter.execute();
345 } 345 }
346 346
347 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFram e) 347 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFram e)
348 { 348 {
349 for (; focusedFrame; focusedFrame = focusedFrame->tree()->parent()) { 349 for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) {
350 if (focusedFrame->tree()->parent() == currentFrame) 350 if (focusedFrame->tree().parent() == currentFrame)
351 return focusedFrame->ownerElement(); 351 return focusedFrame->ownerElement();
352 } 352 }
353 return 0; 353 return 0;
354 } 354 }
355 355
356 Element* TreeScope::adjustedFocusedElement() 356 Element* TreeScope::adjustedFocusedElement()
357 { 357 {
358 Document& document = rootNode()->document(); 358 Document& document = rootNode()->document();
359 Element* element = document.focusedElement(); 359 Element* element = document.focusedElement();
360 if (!element && document.page()) 360 if (!element && document.page())
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 result = element; 491 result = element;
492 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) { 492 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
493 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) 493 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key))
494 result = shadowResult; 494 result = shadowResult;
495 } 495 }
496 } 496 }
497 return result; 497 return result;
498 } 498 }
499 499
500 } // namespace WebCore 500 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/TouchController.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698