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

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

Issue 219903002: Revert 170347 "Convert HTMLFrameOwnerElement and FocusController..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1917/
Patch Set: Created 6 years, 8 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/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.
350 if (!element && document.page()) 348 if (!element && document.page())
351 element = focusedFrameOwnerElement(toLocalFrameTemporary(document.page() ->focusController().focusedFrame()), document.frame()); 349 element = focusedFrameOwnerElement(document.page()->focusController().fo cusedFrame(), document.frame());
352 if (!element) 350 if (!element)
353 return 0; 351 return 0;
354 352
355 EventPath eventPath(element); 353 EventPath eventPath(element);
356 for (size_t i = 0; i < eventPath.size(); ++i) { 354 for (size_t i = 0; i < eventPath.size(); ++i) {
357 if (eventPath[i].node() == rootNode()) { 355 if (eventPath[i].node() == rootNode()) {
358 // eventPath.at(i).target() is one of the followings: 356 // eventPath.at(i).target() is one of the followings:
359 // - InsertionPoint 357 // - InsertionPoint
360 // - shadow host 358 // - shadow host
361 // - Document::focusedElement() 359 // - Document::focusedElement()
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) { 487 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
490 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot()) 488 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot())
491 root->setNeedsStyleRecalcForViewportUnits(); 489 root->setNeedsStyleRecalcForViewportUnits();
492 RenderStyle* style = element->renderStyle(); 490 RenderStyle* style = element->renderStyle();
493 if (style && style->hasViewportUnits()) 491 if (style && style->hasViewportUnits())
494 element->setNeedsStyleRecalc(LocalStyleChange); 492 element->setNeedsStyleRecalc(LocalStyleChange);
495 } 493 }
496 } 494 }
497 495
498 } // namespace WebCore 496 } // 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