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

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2698793003: Get rid of redundant layout tree update related to selection (Closed)
Patch Set: 2017-02-17T00:37:54 FrameSelection::selectFrameElementInParentIfFullySelected() to use FS::isRange() 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, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 } 1616 }
1617 1617
1618 void Editor::setMarkedTextMatchesAreHighlighted(bool flag) { 1618 void Editor::setMarkedTextMatchesAreHighlighted(bool flag) {
1619 if (flag == m_areMarkedTextMatchesHighlighted) 1619 if (flag == m_areMarkedTextMatchesHighlighted)
1620 return; 1620 return;
1621 1621
1622 m_areMarkedTextMatchesHighlighted = flag; 1622 m_areMarkedTextMatchesHighlighted = flag;
1623 frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch); 1623 frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch);
1624 } 1624 }
1625 1625
1626 SelectionType computeSelectionType(const SelectionInDOMTree& selection) {
1627 if (selection.isNone())
yoichio 2017/02/17 04:35:16 As commented, we should rename to computeIsNone()
yosin_UTC9 2017/02/17 05:14:49 This will be done in another patch. To make this p
1628 return NoSelection;
1629 if (selection.isCaret() && selection.granularity() == CharacterGranularity)
1630 return CaretSelection;
1631 return RangeSelection;
1632 }
1633
1626 void Editor::respondToChangedSelection( 1634 void Editor::respondToChangedSelection(
1627 const Position& oldSelectionStart, 1635 const Position& oldSelectionStart,
1628 FrameSelection::SetSelectionOptions options) { 1636 FrameSelection::SetSelectionOptions options) {
1629 spellChecker().respondToChangedSelection(oldSelectionStart, options); 1637 spellChecker().respondToChangedSelection(oldSelectionStart, options);
1630 client().respondToChangedSelection(&frame(), 1638 client().respondToChangedSelection(
1631 frame().selection().getSelectionType()); 1639 &frame(), computeSelectionType(frame().selection().selectionInDOMTree()));
1632 setStartNewKillRingSequence(true); 1640 setStartNewKillRingSequence(true);
1633 } 1641 }
1634 1642
1635 SpellChecker& Editor::spellChecker() const { 1643 SpellChecker& Editor::spellChecker() const {
1636 return frame().spellChecker(); 1644 return frame().spellChecker();
1637 } 1645 }
1638 1646
1639 void Editor::toggleOverwriteModeEnabled() { 1647 void Editor::toggleOverwriteModeEnabled() {
1640 m_overwriteModeEnabled = !m_overwriteModeEnabled; 1648 m_overwriteModeEnabled = !m_overwriteModeEnabled;
1641 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled); 1649 frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 1710
1703 DEFINE_TRACE(Editor) { 1711 DEFINE_TRACE(Editor) {
1704 visitor->trace(m_frame); 1712 visitor->trace(m_frame);
1705 visitor->trace(m_lastEditCommand); 1713 visitor->trace(m_lastEditCommand);
1706 visitor->trace(m_undoStack); 1714 visitor->trace(m_undoStack);
1707 visitor->trace(m_mark); 1715 visitor->trace(m_mark);
1708 visitor->trace(m_typingStyle); 1716 visitor->trace(m_typingStyle);
1709 } 1717 }
1710 1718
1711 } // namespace blink 1719 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698