| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 int comparePositions(const PositionWithAffinity& a, | 285 int comparePositions(const PositionWithAffinity& a, |
| 286 const PositionWithAffinity& b) { | 286 const PositionWithAffinity& b) { |
| 287 return comparePositions(a.position(), b.position()); | 287 return comparePositions(a.position(), b.position()); |
| 288 } | 288 } |
| 289 | 289 |
| 290 int comparePositions(const VisiblePosition& a, const VisiblePosition& b) { | 290 int comparePositions(const VisiblePosition& a, const VisiblePosition& b) { |
| 291 return comparePositions(a.deepEquivalent(), b.deepEquivalent()); | 291 return comparePositions(a.deepEquivalent(), b.deepEquivalent()); |
| 292 } | 292 } |
| 293 | 293 |
| 294 // TODO(editing-dev): We should implement real version which refers |
| 295 // "user-select" CSS property. |
| 296 // TODO(editing-dev): We should make |SelectionAdjuster| to use this funciton |
| 297 // instead of |isSelectionBondary()|. |
| 298 bool isUserSelectContain(const Node& node) { |
| 299 return isHTMLTextAreaElement(node) || isHTMLInputElement(node) || |
| 300 isHTMLSelectElement(node); |
| 301 } |
| 302 |
| 294 enum EditableLevel { Editable, RichlyEditable }; | 303 enum EditableLevel { Editable, RichlyEditable }; |
| 295 static bool hasEditableLevel(const Node& node, EditableLevel editableLevel) { | 304 static bool hasEditableLevel(const Node& node, EditableLevel editableLevel) { |
| 296 DCHECK(node.document().isActive()); | 305 DCHECK(node.document().isActive()); |
| 297 // TODO(editing-dev): We should have this check: | 306 // TODO(editing-dev): We should have this check: |
| 298 // DCHECK_GE(node.document().lifecycle().state(), | 307 // DCHECK_GE(node.document().lifecycle().state(), |
| 299 // DocumentLifecycle::StyleClean); | 308 // DocumentLifecycle::StyleClean); |
| 300 if (node.isPseudoElement()) | 309 if (node.isPseudoElement()) |
| 301 return false; | 310 return false; |
| 302 | 311 |
| 303 // Ideally we'd call DCHECK(!needsStyleRecalc()) here, but | 312 // Ideally we'd call DCHECK(!needsStyleRecalc()) here, but |
| (...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 return InputType::DeleteWordBackward; | 2169 return InputType::DeleteWordBackward; |
| 2161 if (granularity == LineBoundary) | 2170 if (granularity == LineBoundary) |
| 2162 return InputType::DeleteLineBackward; | 2171 return InputType::DeleteLineBackward; |
| 2163 return InputType::DeleteContentBackward; | 2172 return InputType::DeleteContentBackward; |
| 2164 default: | 2173 default: |
| 2165 return InputType::None; | 2174 return InputType::None; |
| 2166 } | 2175 } |
| 2167 } | 2176 } |
| 2168 | 2177 |
| 2169 } // namespace blink | 2178 } // namespace blink |
| OLD | NEW |