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

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

Issue 2708533002: Make SelectionEditor::markCacheDirty() not to reset cached value if it has been cleared (Closed)
Patch Set: 2017-02-20T12:38:08 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 | 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) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 bool SelectionEditor::isContentEditable() const { 117 bool SelectionEditor::isContentEditable() const {
118 return computeVisibleSelectionInDOMTree().isContentEditable(); 118 return computeVisibleSelectionInDOMTree().isContentEditable();
119 } 119 }
120 120
121 bool SelectionEditor::isContentRichlyEditable() const { 121 bool SelectionEditor::isContentRichlyEditable() const {
122 return computeVisibleSelectionInDOMTree().isContentRichlyEditable(); 122 return computeVisibleSelectionInDOMTree().isContentRichlyEditable();
123 } 123 }
124 124
125 void SelectionEditor::markCacheDirty() { 125 void SelectionEditor::markCacheDirty() {
126 if (m_cacheIsDirty)
127 return;
126 m_cachedVisibleSelectionInFlatTree = VisibleSelectionInFlatTree(); 128 m_cachedVisibleSelectionInFlatTree = VisibleSelectionInFlatTree();
127 m_cachedVisibleSelectionInDOMTree = VisibleSelection(); 129 m_cachedVisibleSelectionInDOMTree = VisibleSelection();
128 m_cacheIsDirty = true; 130 m_cacheIsDirty = true;
129 } 131 }
130 132
131 void SelectionEditor::setSelection(const SelectionInDOMTree& newSelection) { 133 void SelectionEditor::setSelection(const SelectionInDOMTree& newSelection) {
132 newSelection.assertValidFor(document()); 134 newSelection.assertValidFor(document());
133 if (m_selection == newSelection) 135 if (m_selection == newSelection)
134 return; 136 return;
135 resetLogicalRange(); 137 resetLogicalRange();
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 visitor->trace(m_frame); 253 visitor->trace(m_frame);
252 visitor->trace(m_selection); 254 visitor->trace(m_selection);
253 visitor->trace(m_cachedVisibleSelectionInDOMTree); 255 visitor->trace(m_cachedVisibleSelectionInDOMTree);
254 visitor->trace(m_cachedVisibleSelectionInFlatTree); 256 visitor->trace(m_cachedVisibleSelectionInFlatTree);
255 visitor->trace(m_logicalRange); 257 visitor->trace(m_logicalRange);
256 visitor->trace(m_cachedRange); 258 visitor->trace(m_cachedRange);
257 SynchronousMutationObserver::trace(visitor); 259 SynchronousMutationObserver::trace(visitor);
258 } 260 }
259 261
260 } // namespace blink 262 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698