| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 Element* isFirstPositionAfterTable(const VisiblePosition&); | 78 Element* isFirstPositionAfterTable(const VisiblePosition&); |
| 79 | 79 |
| 80 // offset functions on Node | 80 // offset functions on Node |
| 81 | 81 |
| 82 int lastOffsetForEditing(const Node*); | 82 int lastOffsetForEditing(const Node*); |
| 83 int caretMinOffset(const Node*); | 83 int caretMinOffset(const Node*); |
| 84 int caretMaxOffset(const Node*); | 84 int caretMaxOffset(const Node*); |
| 85 | 85 |
| 86 // boolean functions on Node | 86 // boolean functions on Node |
| 87 | 87 |
| 88 inline bool isEmptyNonEditableNodeInEditable(const Node* node) | |
| 89 { | |
| 90 return !node->hasChildren() && !node->hasEditableStyle() && node->parentNode
() && node->parentNode()->hasEditableStyle(); | |
| 91 } | |
| 92 | |
| 93 // FIXME: editingIgnoresContent, canHaveChildrenForEditing, and isAtomicNode | 88 // FIXME: editingIgnoresContent, canHaveChildrenForEditing, and isAtomicNode |
| 94 // should be renamed to reflect its usage. | 89 // should be renamed to reflect its usage. |
| 95 | 90 |
| 96 // Returns true for nodes that either have no content, or have content that is i
gnored (skipped over) while editing. | 91 // Returns true for nodes that either have no content, or have content that is i
gnored (skipped over) while editing. |
| 97 // There are no VisiblePositions inside these nodes. | 92 // There are no VisiblePositions inside these nodes. |
| 98 inline bool editingIgnoresContent(const Node* node) | 93 inline bool editingIgnoresContent(const Node* node) |
| 99 { | 94 { |
| 100 return !node->canContainRangeEndPoint() || isEmptyNonEditableNodeInEditable(
node); | 95 return EditingStrategy::editingIgnoresContent(node); |
| 101 } | 96 } |
| 102 | 97 |
| 103 inline bool canHaveChildrenForEditing(const Node* node) | 98 inline bool canHaveChildrenForEditing(const Node* node) |
| 104 { | 99 { |
| 105 return !node->isTextNode() && node->canContainRangeEndPoint(); | 100 return !node->isTextNode() && node->canContainRangeEndPoint(); |
| 106 } | 101 } |
| 107 | 102 |
| 108 bool isAtomicNode(const Node*); | 103 bool isAtomicNode(const Node*); |
| 109 bool isBlock(const Node*); | 104 bool isBlock(const Node*); |
| 110 bool isInline(const Node*); | 105 bool isInline(const Node*); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 // FIXME: this is required until 6853027 is fixed and text checking can do t
his for us. | 253 // FIXME: this is required until 6853027 is fixed and text checking can do t
his for us. |
| 259 return character == '\'' || character == rightSingleQuotationMark || charact
er == hebrewPunctuationGershayim; | 254 return character == '\'' || character == rightSingleQuotationMark || charact
er == hebrewPunctuationGershayim; |
| 260 } | 255 } |
| 261 | 256 |
| 262 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap
h, bool endIsEndOfParagraph); | 257 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap
h, bool endIsEndOfParagraph); |
| 263 const String& nonBreakingSpaceString(); | 258 const String& nonBreakingSpaceString(); |
| 264 | 259 |
| 265 } | 260 } |
| 266 | 261 |
| 267 #endif | 262 #endif |
| OLD | NEW |