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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2704933006: Expand FrameSeleciton::rootEditableElement() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T15:42:51 Created 3 years, 10 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 | « no previous file | third_party/WebKit/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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 SelectionBehaviorOnFocus selectionBehavior) { 2686 SelectionBehaviorOnFocus selectionBehavior) {
2687 if (selectionBehavior == SelectionBehaviorOnFocus::None) 2687 if (selectionBehavior == SelectionBehaviorOnFocus::None)
2688 return; 2688 return;
2689 if (isRootEditableElement(*this)) { 2689 if (isRootEditableElement(*this)) {
2690 LocalFrame* frame = document().frame(); 2690 LocalFrame* frame = document().frame();
2691 if (!frame) 2691 if (!frame)
2692 return; 2692 return;
2693 2693
2694 // When focusing an editable element in an iframe, don't reset the selection 2694 // When focusing an editable element in an iframe, don't reset the selection
2695 // if it already contains a selection. 2695 // if it already contains a selection.
2696 if (this == frame->selection().rootEditableElement()) 2696 if (this ==
2697 frame->selection()
2698 .computeVisibleSelectionInDOMTreeDeprecated()
2699 .rootEditableElement())
2697 return; 2700 return;
2698 2701
2699 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 2702 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
2700 // needs to be audited. See http://crbug.com/590369 for more details. 2703 // needs to be audited. See http://crbug.com/590369 for more details.
2701 document().updateStyleAndLayoutIgnorePendingStylesheets(); 2704 document().updateStyleAndLayoutIgnorePendingStylesheets();
2702 2705
2703 // FIXME: We should restore the previous selection if there is one. 2706 // FIXME: We should restore the previous selection if there is one.
2704 // Passing DoNotSetFocus as this function is called after 2707 // Passing DoNotSetFocus as this function is called after
2705 // FocusController::setFocusedElement() and we don't want to change the 2708 // FocusController::setFocusedElement() and we don't want to change the
2706 // focus to a new Element. 2709 // focus to a new Element.
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
4139 } 4142 }
4140 4143
4141 DEFINE_TRACE_WRAPPERS(Element) { 4144 DEFINE_TRACE_WRAPPERS(Element) {
4142 if (hasRareData()) { 4145 if (hasRareData()) {
4143 visitor->traceWrappers(elementRareData()); 4146 visitor->traceWrappers(elementRareData());
4144 } 4147 }
4145 ContainerNode::traceWrappers(visitor); 4148 ContainerNode::traceWrappers(visitor);
4146 } 4149 }
4147 4150
4148 } // namespace blink 4151 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698