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

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: Improved downcast checking. 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
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (focusedFrame->tree().parent() == currentFrame) 344 if (focusedFrame->tree().parent() == currentFrame)
345 return focusedFrame->ownerElement(); 345 return focusedFrame->ownerElement();
346 } 346 }
347 return 0; 347 return 0;
348 } 348 }
349 349
350 Element* TreeScope::adjustedFocusedElement() const 350 Element* TreeScope::adjustedFocusedElement() const
351 { 351 {
352 Document& document = rootNode().document(); 352 Document& document = rootNode().document();
353 Element* element = document.focusedElement(); 353 Element* element = document.focusedElement();
354 // FIXME(kenrb): The toLocalFrame() cast should be removed when RemoteFrames can have FrameTrees.
dcheng 2014/03/17 18:17:44 I don't really understand what this comment has to
kenrb 2014/03/18 20:01:19 I've expanded the comment. focusedFrameOwnerElemen
354 if (!element && document.page()) 355 if (!element && document.page())
355 element = focusedFrameOwnerElement(document.page()->focusController().fo cusedFrame(), document.frame()); 356 element = focusedFrameOwnerElement(toLocalFrame(document.page()->focusCo ntroller().focusedFrame()), document.frame());
356 if (!element) 357 if (!element)
357 return 0; 358 return 0;
358 359
359 EventPath eventPath(element); 360 EventPath eventPath(element);
360 for (size_t i = 0; i < eventPath.size(); ++i) { 361 for (size_t i = 0; i < eventPath.size(); ++i) {
361 if (eventPath[i].node() == rootNode()) { 362 if (eventPath[i].node() == rootNode()) {
362 // eventPath.at(i).target() is one of the followings: 363 // eventPath.at(i).target() is one of the followings:
363 // - InsertionPoint 364 // - InsertionPoint
364 // - shadow host 365 // - shadow host
365 // - Document::focusedElement() 366 // - Document::focusedElement()
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) { 494 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
494 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot()) 495 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot())
495 root->setNeedsStyleRecalcForViewportUnits(); 496 root->setNeedsStyleRecalcForViewportUnits();
496 RenderStyle* style = element->renderStyle(); 497 RenderStyle* style = element->renderStyle();
497 if (style && style->hasViewportUnits()) 498 if (style && style->hasViewportUnits())
498 element->setNeedsStyleRecalc(LocalStyleChange); 499 element->setNeedsStyleRecalc(LocalStyleChange);
499 } 500 }
500 } 501 }
501 502
502 } // namespace WebCore 503 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698