| 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/dom/ProcessingInstruction.h" | 36 #include "core/dom/ProcessingInstruction.h" |
| 37 #include "core/dom/Text.h" | 37 #include "core/dom/Text.h" |
| 38 #include "core/editing/EditingUtilities.h" | 38 #include "core/editing/EditingUtilities.h" |
| 39 #include "core/editing/EphemeralRange.h" | 39 #include "core/editing/EphemeralRange.h" |
| 40 #include "core/editing/FrameSelection.h" | 40 #include "core/editing/FrameSelection.h" |
| 41 #include "core/editing/VisiblePosition.h" | 41 #include "core/editing/VisiblePosition.h" |
| 42 #include "core/editing/VisibleUnits.h" | 42 #include "core/editing/VisibleUnits.h" |
| 43 #include "core/editing/iterators/TextIterator.h" | 43 #include "core/editing/iterators/TextIterator.h" |
| 44 #include "core/editing/serializers/Serialization.h" | 44 #include "core/editing/serializers/Serialization.h" |
| 45 #include "core/events/ScopedEventQueue.h" | 45 #include "core/events/ScopedEventQueue.h" |
| 46 #include "core/frame/Settings.h" |
| 46 #include "core/html/HTMLBodyElement.h" | 47 #include "core/html/HTMLBodyElement.h" |
| 47 #include "core/html/HTMLElement.h" | 48 #include "core/html/HTMLElement.h" |
| 48 #include "core/layout/LayoutObject.h" | 49 #include "core/layout/LayoutObject.h" |
| 49 #include "core/layout/LayoutText.h" | 50 #include "core/layout/LayoutText.h" |
| 50 #include "core/svg/SVGSVGElement.h" | 51 #include "core/svg/SVGSVGElement.h" |
| 51 #include "platform/EventDispatchForbiddenScope.h" | 52 #include "platform/EventDispatchForbiddenScope.h" |
| 52 #include "platform/geometry/FloatQuad.h" | 53 #include "platform/geometry/FloatQuad.h" |
| 53 #include "wtf/text/CString.h" | 54 #include "wtf/text/CString.h" |
| 54 #include "wtf/text/StringBuilder.h" | 55 #include "wtf/text/StringBuilder.h" |
| 55 #ifndef NDEBUG | 56 #ifndef NDEBUG |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 } else { | 71 } else { |
| 71 DCHECK_EQ(s_range, range); | 72 DCHECK_EQ(s_range, range); |
| 72 #endif | 73 #endif |
| 73 } | 74 } |
| 74 } | 75 } |
| 75 | 76 |
| 76 ~RangeUpdateScope() { | 77 ~RangeUpdateScope() { |
| 77 DCHECK_GE(s_scopeCount, 1); | 78 DCHECK_GE(s_scopeCount, 1); |
| 78 if (--s_scopeCount > 0) | 79 if (--s_scopeCount > 0) |
| 79 return; | 80 return; |
| 80 m_range->removeFromSelectionIfInDifferentRoot(*m_oldDocument); | 81 Settings* settings = |
| 81 m_range->updateSelectionIfAddedToSelection(); | 82 m_oldDocument->frame() ? m_oldDocument->frame()->settings() : nullptr; |
| 83 if (!settings || |
| 84 !settings->getDoNotUpdateSelectionOnMutatingSelectionRange()) { |
| 85 m_range->removeFromSelectionIfInDifferentRoot(*m_oldDocument); |
| 86 m_range->updateSelectionIfAddedToSelection(); |
| 87 } |
| 82 #if DCHECK_IS_ON() | 88 #if DCHECK_IS_ON() |
| 83 s_range = nullptr; | 89 s_range = nullptr; |
| 84 #endif | 90 #endif |
| 85 } | 91 } |
| 86 | 92 |
| 87 private: | 93 private: |
| 88 static int s_scopeCount; | 94 static int s_scopeCount; |
| 89 #if DCHECK_IS_ON() | 95 #if DCHECK_IS_ON() |
| 90 // This raw pointer is safe because | 96 // This raw pointer is safe because |
| 91 // - s_range has a valid pointer only if RangeUpdateScope instance is live. | 97 // - s_range has a valid pointer only if RangeUpdateScope instance is live. |
| (...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 .data() | 1833 .data() |
| 1828 << "start offset: " << range->startOffset() | 1834 << "start offset: " << range->startOffset() |
| 1829 << ", end offset: " << range->endOffset(); | 1835 << ", end offset: " << range->endOffset(); |
| 1830 } else { | 1836 } else { |
| 1831 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " | 1837 LOG(INFO) << "Cannot show tree if range is null, or if boundary points are " |
| 1832 "invalid."; | 1838 "invalid."; |
| 1833 } | 1839 } |
| 1834 } | 1840 } |
| 1835 | 1841 |
| 1836 #endif | 1842 #endif |
| OLD | NEW |