| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |