OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/editing/SurroundingText.h" | 32 #include "core/editing/SurroundingText.h" |
33 | 33 |
34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
35 #include "core/dom/Range.h" | 35 #include "core/dom/Range.h" |
36 #include "core/editing/TextIterator.h" | 36 #include "core/editing/TextIterator.h" |
37 #include "core/editing/VisiblePosition.h" | 37 #include "core/editing/VisiblePosition.h" |
38 #include "core/editing/VisibleSelection.h" | |
39 #include "core/editing/VisibleUnits.h" | 38 #include "core/editing/VisibleUnits.h" |
40 | 39 |
41 namespace WebCore { | 40 namespace WebCore { |
42 | 41 |
43 SurroundingText::SurroundingText(const VisiblePosition& visiblePosition, unsigne
d maxLength) | 42 SurroundingText::SurroundingText(const VisiblePosition& visiblePosition, unsigne
d maxLength) |
44 : m_positionOffsetInContent(0) | 43 : m_positionOffsetInContent(0) |
45 { | 44 { |
46 if (visiblePosition.isNull()) | 45 if (visiblePosition.isNull()) |
47 return; | 46 return; |
48 | 47 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 return m_contentRange->text(); | 101 return m_contentRange->text(); |
103 return String(); | 102 return String(); |
104 } | 103 } |
105 | 104 |
106 unsigned SurroundingText::positionOffsetInContent() const | 105 unsigned SurroundingText::positionOffsetInContent() const |
107 { | 106 { |
108 return m_positionOffsetInContent; | 107 return m_positionOffsetInContent; |
109 } | 108 } |
110 | 109 |
111 } // namespace WebCore | 110 } // namespace WebCore |
OLD | NEW |