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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // TODO(editing-dev): We should implement real version which refers | 296 // TODO(editing-dev): We should implement real version which refers |
297 // "user-select" CSS property. | 297 // "user-select" CSS property. |
298 // TODO(editing-dev): We should make |SelectionAdjuster| to use this funciton | 298 // TODO(editing-dev): We should make |
299 // instead of |isSelectionBondary()|. | 299 // |VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries()| use this |
| 300 // funciton instead of |isSelectionBondary()|. |
300 bool isUserSelectContain(const Node& node) { | 301 bool isUserSelectContain(const Node& node) { |
301 return isHTMLTextAreaElement(node) || isHTMLInputElement(node) || | 302 return isHTMLTextAreaElement(node) || isHTMLInputElement(node) || |
302 isHTMLSelectElement(node); | 303 isHTMLSelectElement(node); |
303 } | 304 } |
304 | 305 |
305 enum EditableLevel { Editable, RichlyEditable }; | 306 enum EditableLevel { Editable, RichlyEditable }; |
306 static bool hasEditableLevel(const Node& node, EditableLevel editableLevel) { | 307 static bool hasEditableLevel(const Node& node, EditableLevel editableLevel) { |
307 DCHECK(node.document().isActive()); | 308 DCHECK(node.document().isActive()); |
308 // TODO(editing-dev): We should have this check: | 309 // TODO(editing-dev): We should have this check: |
309 // DCHECK_GE(node.document().lifecycle().state(), | 310 // DCHECK_GE(node.document().lifecycle().state(), |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 return InputType::DeleteWordBackward; | 2174 return InputType::DeleteWordBackward; |
2174 if (granularity == LineBoundary) | 2175 if (granularity == LineBoundary) |
2175 return InputType::DeleteLineBackward; | 2176 return InputType::DeleteLineBackward; |
2176 return InputType::DeleteContentBackward; | 2177 return InputType::DeleteContentBackward; |
2177 default: | 2178 default: |
2178 return InputType::None; | 2179 return InputType::None; |
2179 } | 2180 } |
2180 } | 2181 } |
2181 | 2182 |
2182 } // namespace blink | 2183 } // namespace blink |
OLD | NEW |