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

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

Issue 2708703003: Expand FrameSeleciton::isRange() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T23:48:22 rebase 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
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() || selection.isRange())) { 1842 (selection.rootEditableElement() ||
1843 selection.computeVisibleSelectionInDOMTreeDeprecated().isRange())) {
1843 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 1844 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1844 // needs to be audited. See http://crbug.com/590369 for more details. 1845 // needs to be audited. See http://crbug.com/590369 for more details.
1845 doc->updateStyleAndLayoutIgnorePendingStylesheets(); 1846 doc->updateStyleAndLayoutIgnorePendingStylesheets();
1846 1847
1847 IntRect firstRect = m_frame->editor().firstRectForRange( 1848 IntRect firstRect = m_frame->editor().firstRectForRange(
1848 selection.computeVisibleSelectionInDOMTree() 1849 selection.computeVisibleSelectionInDOMTree()
1849 .toNormalizedEphemeralRange()); 1850 .toNormalizedEphemeralRange());
1850 1851
1851 int x = rightAligned ? firstRect.maxX() : firstRect.x(); 1852 int x = rightAligned ? firstRect.maxX() : firstRect.x();
1852 // In a multiline edit, firstRect.maxY() would end up on the next line, so 1853 // In a multiline edit, firstRect.maxY() would end up on the next line, so
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 } 2135 }
2135 2136
2136 FrameHost* EventHandler::frameHost() const { 2137 FrameHost* EventHandler::frameHost() const {
2137 if (!m_frame->page()) 2138 if (!m_frame->page())
2138 return nullptr; 2139 return nullptr;
2139 2140
2140 return &m_frame->page()->frameHost(); 2141 return &m_frame->page()->frameHost();
2141 } 2142 }
2142 2143
2143 } // namespace blink 2144 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLabelElement.cpp ('k') | third_party/WebKit/Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698