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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check Created 6 years, 9 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/editing/Editor.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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (focusedFrame->tree().parent() == currentFrame) 338 if (focusedFrame->tree().parent() == currentFrame)
339 return focusedFrame->ownerElement(); 339 return focusedFrame->ownerElement();
340 } 340 }
341 return 0; 341 return 0;
342 } 342 }
343 343
344 Element* TreeScope::adjustedFocusedElement() const 344 Element* TreeScope::adjustedFocusedElement() const
345 { 345 {
346 Document& document = rootNode().document(); 346 Document& document = rootNode().document();
347 Element* element = document.focusedElement(); 347 Element* element = document.focusedElement();
348 // FIXME(kenrb): The toLocalFrame() cast should be removed when RemoteFrames can have FrameTrees.
349 // At that point, focusedFrameOwnerElement should take a Frame instead of a LocalFrame.
348 if (!element && document.page()) 350 if (!element && document.page())
349 element = focusedFrameOwnerElement(document.page()->focusController().fo cusedFrame(), document.frame()); 351 element = focusedFrameOwnerElement(toLocalFrameTemporary(document.page() ->focusController().focusedFrame()), document.frame());
350 if (!element) 352 if (!element)
351 return 0; 353 return 0;
352 354
353 EventPath eventPath(element); 355 EventPath eventPath(element);
354 for (size_t i = 0; i < eventPath.size(); ++i) { 356 for (size_t i = 0; i < eventPath.size(); ++i) {
355 if (eventPath[i].node() == rootNode()) { 357 if (eventPath[i].node() == rootNode()) {
356 // eventPath.at(i).target() is one of the followings: 358 // eventPath.at(i).target() is one of the followings:
357 // - InsertionPoint 359 // - InsertionPoint
358 // - shadow host 360 // - shadow host
359 // - Document::focusedElement() 361 // - Document::focusedElement()
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) { 489 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
488 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot()) 490 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot())
489 root->setNeedsStyleRecalcForViewportUnits(); 491 root->setNeedsStyleRecalcForViewportUnits();
490 RenderStyle* style = element->renderStyle(); 492 RenderStyle* style = element->renderStyle();
491 if (style && style->hasViewportUnits()) 493 if (style && style->hasViewportUnits())
492 element->setNeedsStyleRecalc(LocalStyleChange); 494 element->setNeedsStyleRecalc(LocalStyleChange);
493 } 495 }
494 } 496 }
495 497
496 } // namespace WebCore 498 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698