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

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

Issue 49613005: Have TreeScrope::adoptIfNeeded() take a reference instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | Source/core/dom/TreeScopeAdopter.h » ('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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } 326 }
327 } 327 }
328 return 0; 328 return 0;
329 } 329 }
330 330
331 bool TreeScope::applyAuthorStyles() const 331 bool TreeScope::applyAuthorStyles() const
332 { 332 {
333 return !rootNode()->isShadowRoot() || toShadowRoot(rootNode())->applyAuthorS tyles(); 333 return !rootNode()->isShadowRoot() || toShadowRoot(rootNode())->applyAuthorS tyles();
334 } 334 }
335 335
336 void TreeScope::adoptIfNeeded(Node* node) 336 void TreeScope::adoptIfNeeded(Node& node)
337 { 337 {
338 ASSERT(this); 338 ASSERT(this);
339 ASSERT(node); 339 ASSERT(!node.isDocumentNode());
340 ASSERT(!node->isDocumentNode()); 340 ASSERT_WITH_SECURITY_IMPLICATION(!node.m_deletionHasBegun);
341 ASSERT_WITH_SECURITY_IMPLICATION(!node->m_deletionHasBegun); 341 TreeScopeAdopter adopter(node, *this);
342 TreeScopeAdopter adopter(node, this);
343 if (adopter.needsScopeChange()) 342 if (adopter.needsScopeChange())
344 adopter.execute(); 343 adopter.execute();
345 } 344 }
346 345
347 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFram e) 346 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFram e)
348 { 347 {
349 for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) { 348 for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) {
350 if (focusedFrame->tree().parent() == currentFrame) 349 if (focusedFrame->tree().parent() == currentFrame)
351 return focusedFrame->ownerElement(); 350 return focusedFrame->ownerElement();
352 } 351 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 result = element; 490 result = element;
492 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) { 491 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot; shadowRoot = shadowRoot->olderShadowRoot()) {
493 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) 492 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key))
494 result = shadowResult; 493 result = shadowResult;
495 } 494 }
496 } 495 }
497 return result; 496 return result;
498 } 497 }
499 498
500 } // namespace WebCore 499 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScope.h ('k') | Source/core/dom/TreeScopeAdopter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698