Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 | 286 |
| 287 int comparePositions(const PositionWithAffinity& a, | 287 int comparePositions(const PositionWithAffinity& a, |
| 288 const PositionWithAffinity& b) { | 288 const PositionWithAffinity& b) { |
| 289 return comparePositions(a.position(), b.position()); | 289 return comparePositions(a.position(), b.position()); |
| 290 } | 290 } |
| 291 | 291 |
| 292 int comparePositions(const VisiblePosition& a, const VisiblePosition& b) { | 292 int comparePositions(const VisiblePosition& a, const VisiblePosition& b) { |
| 293 return comparePositions(a.deepEquivalent(), b.deepEquivalent()); | 293 return comparePositions(a.deepEquivalent(), b.deepEquivalent()); |
| 294 } | 294 } |
| 295 | 295 |
| 296 bool isNodeFullyContained(const EphemeralRange& range, Node& node) { | |
|
tkent
2017/03/29 09:02:17
The second argument should be |const Node&|.
yoichio
2017/03/29 09:25:40
Yes, but Position has non-const Member<Node>.
tkent
2017/03/29 10:39:51
Oh, I see. Please go ahead landing.
| |
| 297 if (range.isNull()) | |
| 298 return false; | |
| 299 | |
| 300 if (!NodeTraversal::commonAncestor(*range.startPosition().anchorNode(), node)) | |
| 301 return false; | |
| 302 | |
| 303 return range.startPosition() <= Position::beforeNode(&node) && | |
| 304 Position::afterNode(&node) <= range.endPosition(); | |
| 305 } | |
| 306 | |
| 296 // TODO(editing-dev): We should implement real version which refers | 307 // TODO(editing-dev): We should implement real version which refers |
| 297 // "user-select" CSS property. | 308 // "user-select" CSS property. |
| 298 // TODO(editing-dev): We should make |SelectionAdjuster| to use this funciton | 309 // TODO(editing-dev): We should make |SelectionAdjuster| to use this funciton |
| 299 // instead of |isSelectionBondary()|. | 310 // instead of |isSelectionBondary()|. |
| 300 bool isUserSelectContain(const Node& node) { | 311 bool isUserSelectContain(const Node& node) { |
| 301 return isHTMLTextAreaElement(node) || isHTMLInputElement(node) || | 312 return isHTMLTextAreaElement(node) || isHTMLInputElement(node) || |
| 302 isHTMLSelectElement(node); | 313 isHTMLSelectElement(node); |
| 303 } | 314 } |
| 304 | 315 |
| 305 enum EditableLevel { Editable, RichlyEditable }; | 316 enum EditableLevel { Editable, RichlyEditable }; |
| (...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2143 return InputType::DeleteWordBackward; | 2154 return InputType::DeleteWordBackward; |
| 2144 if (granularity == LineBoundary) | 2155 if (granularity == LineBoundary) |
| 2145 return InputType::DeleteLineBackward; | 2156 return InputType::DeleteLineBackward; |
| 2146 return InputType::DeleteContentBackward; | 2157 return InputType::DeleteContentBackward; |
| 2147 default: | 2158 default: |
| 2148 return InputType::None; | 2159 return InputType::None; |
| 2149 } | 2160 } |
| 2150 } | 2161 } |
| 2151 | 2162 |
| 2152 } // namespace blink | 2163 } // namespace blink |
| OLD | NEW |