| Index: third_party/WebKit/Source/core/editing/SelectionEditor.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
|
| index 14f7509c4de98e7fd4807ce221e35998cc3d7757..615c5d770b4043b30b15b649f011dc21ed370af3 100644
|
| --- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
|
| @@ -370,7 +370,13 @@ void SelectionEditor::updateCachedVisibleSelectionIfNeeded() const {
|
| if (!needsUpdateVisibleSelection())
|
| return;
|
|
|
| + m_styleVersion = document().styleVersion();
|
| + m_cacheIsDirty = false;
|
| m_cachedVisibleSelectionInDOMTree = createVisibleSelection(m_selection);
|
| + if (m_cachedVisibleSelectionInDOMTree.isNone()) {
|
| + m_cachedVisibleSelectionInFlatTree = VisibleSelectionInFlatTree();
|
| + return;
|
| + }
|
| m_cachedVisibleSelectionInFlatTree = createVisibleSelection(
|
| SelectionInFlatTree::Builder()
|
| .setBaseAndExtent(toPositionInFlatTree(m_selection.base()),
|
| @@ -380,8 +386,6 @@ void SelectionEditor::updateCachedVisibleSelectionIfNeeded() const {
|
| .setGranularity(m_selection.granularity())
|
| .setIsDirectional(m_selection.isDirectional())
|
| .build());
|
| - m_styleVersion = document().styleVersion();
|
| - m_cacheIsDirty = false;
|
| }
|
|
|
| void SelectionEditor::cacheRangeOfDocument(Range* range) {
|
|
|