OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 Node* anchorNode() const; | 82 Node* anchorNode() const; |
83 unsigned anchorOffset() const; | 83 unsigned anchorOffset() const; |
84 Node* focusNode() const; | 84 Node* focusNode() const; |
85 unsigned focusOffset() const; | 85 unsigned focusOffset() const; |
86 bool isCollapsed() const; | 86 bool isCollapsed() const; |
87 unsigned rangeCount() const; | 87 unsigned rangeCount() const; |
88 void collapse(Node*, unsigned offset, ExceptionState&); | 88 void collapse(Node*, unsigned offset, ExceptionState&); |
89 void collapseToEnd(ExceptionState&); | 89 void collapseToEnd(ExceptionState&); |
90 void collapseToStart(ExceptionState&); | 90 void collapseToStart(ExceptionState&); |
91 void extend(Node*, unsigned offset, ExceptionState&); | 91 void extend(Node*, unsigned offset, ExceptionState&); |
| 92 // Selection.getRangeAt of document returns reference as spec: |
| 93 // http://w3c.github.io/selection-api/#dom-selection-getrangeat |
| 94 // However, Selection of shadow root returns copied Range everytime so far |
| 95 // because no spec for this: |
| 96 // https://w3c.github.io/webcomponents/spec/shadow/#ranges-and-selections |
92 Range* getRangeAt(unsigned, ExceptionState&) const; | 97 Range* getRangeAt(unsigned, ExceptionState&) const; |
93 void removeRange(Range*); | 98 void removeRange(Range*); |
94 void removeAllRanges(); | 99 void removeAllRanges(); |
95 void addRange(Range*); | 100 void addRange(Range*); |
96 void deleteFromDocument(); | 101 void deleteFromDocument(); |
97 bool containsNode(const Node*, bool partlyContained) const; | 102 bool containsNode(const Node*, bool partlyContained) const; |
98 void selectAllChildren(Node*, ExceptionState&); | 103 void selectAllChildren(Node*, ExceptionState&); |
99 | 104 |
100 String toString(); | 105 String toString(); |
101 | 106 |
(...skipping 26 matching lines...) Expand all Loading... |
128 void cacheRangeIfSelectionOfDocument(Range*) const; | 133 void cacheRangeIfSelectionOfDocument(Range*) const; |
129 Range* documentCachedRange() const; | 134 Range* documentCachedRange() const; |
130 void clearCachedRangeIfSelectionOfDocument(); | 135 void clearCachedRangeIfSelectionOfDocument(); |
131 | 136 |
132 Member<const TreeScope> m_treeScope; | 137 Member<const TreeScope> m_treeScope; |
133 }; | 138 }; |
134 | 139 |
135 } // namespace blink | 140 } // namespace blink |
136 | 141 |
137 #endif // DOMSelection_h | 142 #endif // DOMSelection_h |
OLD | NEW |