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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2706033011: Expand FrameSeleciton::rootEditableElement() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T12:50:05 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 | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 IntPoint locationInRootFrame; 1832 IntPoint locationInRootFrame;
1833 1833
1834 Element* focusedElement = 1834 Element* focusedElement =
1835 overrideTargetElement ? overrideTargetElement : doc->focusedElement(); 1835 overrideTargetElement ? overrideTargetElement : doc->focusedElement();
1836 FrameSelection& selection = m_frame->selection(); 1836 FrameSelection& selection = m_frame->selection();
1837 Position start = 1837 Position start =
1838 selection.computeVisibleSelectionInDOMTreeDeprecated().start(); 1838 selection.computeVisibleSelectionInDOMTreeDeprecated().start();
1839 VisualViewport& visualViewport = frameHost()->visualViewport(); 1839 VisualViewport& visualViewport = frameHost()->visualViewport();
1840 1840
1841 if (!overrideTargetElement && start.anchorNode() && 1841 if (!overrideTargetElement && start.anchorNode() &&
1842 (selection.rootEditableElement() || 1842 (selection.computeVisibleSelectionInDOMTreeDeprecated()
1843 .rootEditableElement() ||
1843 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange())) { 1844 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange())) {
1844 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1845 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1845 // needs to be audited. See http://crbug.com/590369 for more details. 1846 // needs to be audited. See http://crbug.com/590369 for more details.
1846 doc->updateStyleAndLayoutIgnorePendingStylesheets(); 1847 doc->updateStyleAndLayoutIgnorePendingStylesheets();
1847 1848
1848 IntRect firstRect = m_frame->editor().firstRectForRange( 1849 IntRect firstRect = m_frame->editor().firstRectForRange(
1849 selection.computeVisibleSelectionInDOMTree() 1850 selection.computeVisibleSelectionInDOMTree()
1850 .toNormalizedEphemeralRange()); 1851 .toNormalizedEphemeralRange());
1851 1852
1852 int x = rightAligned ? firstRect.maxX() : firstRect.x(); 1853 int x = rightAligned ? firstRect.maxX() : firstRect.x();
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 } 2136 }
2136 2137
2137 FrameHost* EventHandler::frameHost() const { 2138 FrameHost* EventHandler::frameHost() const {
2138 if (!m_frame->page()) 2139 if (!m_frame->page())
2139 return nullptr; 2140 return nullptr;
2140 2141
2141 return &m_frame->page()->frameHost(); 2142 return &m_frame->page()->frameHost();
2142 } 2143 }
2143 2144
2144 } // namespace blink 2145 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698