OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 8 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "core/dom/ProcessingInstruction.h" | 38 #include "core/dom/ProcessingInstruction.h" |
39 #include "core/dom/Text.h" | 39 #include "core/dom/Text.h" |
40 #include "core/editing/EditingUtilities.h" | 40 #include "core/editing/EditingUtilities.h" |
41 #include "core/editing/EphemeralRange.h" | 41 #include "core/editing/EphemeralRange.h" |
42 #include "core/editing/FrameSelection.h" | 42 #include "core/editing/FrameSelection.h" |
43 #include "core/editing/VisiblePosition.h" | 43 #include "core/editing/VisiblePosition.h" |
44 #include "core/editing/VisibleUnits.h" | 44 #include "core/editing/VisibleUnits.h" |
45 #include "core/editing/iterators/TextIterator.h" | 45 #include "core/editing/iterators/TextIterator.h" |
46 #include "core/editing/serializers/Serialization.h" | 46 #include "core/editing/serializers/Serialization.h" |
47 #include "core/events/ScopedEventQueue.h" | 47 #include "core/events/ScopedEventQueue.h" |
| 48 #include "core/frame/Settings.h" |
48 #include "core/html/HTMLBodyElement.h" | 49 #include "core/html/HTMLBodyElement.h" |
49 #include "core/html/HTMLElement.h" | 50 #include "core/html/HTMLElement.h" |
50 #include "core/layout/LayoutObject.h" | 51 #include "core/layout/LayoutObject.h" |
51 #include "core/layout/LayoutText.h" | 52 #include "core/layout/LayoutText.h" |
52 #include "core/svg/SVGSVGElement.h" | 53 #include "core/svg/SVGSVGElement.h" |
53 #include "platform/EventDispatchForbiddenScope.h" | 54 #include "platform/EventDispatchForbiddenScope.h" |
54 #include "platform/geometry/FloatQuad.h" | 55 #include "platform/geometry/FloatQuad.h" |
55 #include "wtf/text/CString.h" | 56 #include "wtf/text/CString.h" |
56 #include "wtf/text/StringBuilder.h" | 57 #include "wtf/text/StringBuilder.h" |
57 #ifndef NDEBUG | 58 #ifndef NDEBUG |
(...skipping 14 matching lines...) Expand all Loading... |
72 } else { | 73 } else { |
73 DCHECK_EQ(s_currentRange, range); | 74 DCHECK_EQ(s_currentRange, range); |
74 #endif | 75 #endif |
75 } | 76 } |
76 } | 77 } |
77 | 78 |
78 ~RangeUpdateScope() { | 79 ~RangeUpdateScope() { |
79 DCHECK_GE(s_scopeCount, 1); | 80 DCHECK_GE(s_scopeCount, 1); |
80 if (--s_scopeCount > 0) | 81 if (--s_scopeCount > 0) |
81 return; | 82 return; |
82 m_range->removeFromSelectionIfInDifferentRoot(*m_oldDocument); | 83 Settings* settings = |
83 m_range->updateSelectionIfAddedToSelection(); | 84 m_oldDocument->frame() ? m_oldDocument->frame()->settings() : nullptr; |
| 85 if (!settings || |
| 86 !settings->getDoNotUpdateSelectionOnMutatingSelectionRange()) { |
| 87 m_range->removeFromSelectionIfInDifferentRoot(*m_oldDocument); |
| 88 m_range->updateSelectionIfAddedToSelection(); |
| 89 } |
84 #if DCHECK_IS_ON() | 90 #if DCHECK_IS_ON() |
85 s_currentRange = nullptr; | 91 s_currentRange = nullptr; |
86 #endif | 92 #endif |
87 } | 93 } |
88 | 94 |
89 private: | 95 private: |
90 static int s_scopeCount; | 96 static int s_scopeCount; |
91 #if DCHECK_IS_ON() | 97 #if DCHECK_IS_ON() |
92 // This raw pointer is safe because | 98 // This raw pointer is safe because |
93 // - s_currentRange has a valid pointer only if RangeUpdateScope instance is | 99 // - s_currentRange has a valid pointer only if RangeUpdateScope instance is |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 .data() | 1818 .data() |
1813 << "start offset: " << range->startOffset() | 1819 << "start offset: " << range->startOffset() |
1814 << ", end offset: " << range->endOffset(); | 1820 << ", end offset: " << range->endOffset(); |
1815 } else { | 1821 } else { |
1816 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " | 1822 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " |
1817 "invalid."; | 1823 "invalid."; |
1818 } | 1824 } |
1819 } | 1825 } |
1820 | 1826 |
1821 #endif | 1827 #endif |
OLD | NEW |