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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class Range; | 56 class Range; |
57 | 57 |
58 // This file contains a set of helper functions used by the editing commands | 58 // This file contains a set of helper functions used by the editing commands |
59 | 59 |
60 // ------------------------------------------------------------------------- | 60 // ------------------------------------------------------------------------- |
61 // Node | 61 // Node |
62 // ------------------------------------------------------------------------- | 62 // ------------------------------------------------------------------------- |
63 | 63 |
64 // Functions returning Node | 64 // Functions returning Node |
65 | 65 |
| 66 // highestEditableRoot returns the highest editable node. If the |
| 67 // rootEditableElement of the speicified Position is <body>, this returns the |
| 68 // <body>. Otherwise, this searches ancestors for the highest editable node in |
| 69 // defiance of editing boundaries. This returns a Document if designMode="on" |
| 70 // and the specified Position is not in the <body>. |
66 CORE_EXPORT ContainerNode* highestEditableRoot(const Position&, EditableType = C
ontentIsEditable); | 71 CORE_EXPORT ContainerNode* highestEditableRoot(const Position&, EditableType = C
ontentIsEditable); |
67 ContainerNode* highestEditableRoot(const PositionInComposedTree&, EditableType =
ContentIsEditable); | 72 ContainerNode* highestEditableRoot(const PositionInComposedTree&, EditableType =
ContentIsEditable); |
68 | 73 |
69 Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Nod
e*), | 74 Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Nod
e*), |
70 EditingBoundaryCrossingRule = CannotCrossEditingBoundary, Node* stayWithin =
nullptr); | 75 EditingBoundaryCrossingRule = CannotCrossEditingBoundary, Node* stayWithin =
nullptr); |
71 Node* highestNodeToRemoveInPruning(Node*, Node* excludeNode = nullptr); | 76 Node* highestNodeToRemoveInPruning(Node*, Node* excludeNode = nullptr); |
72 | 77 |
73 Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingB
oundary); | 78 Element* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingB
oundary); |
74 CORE_EXPORT Element* enclosingBlock(const Position&, EditingBoundaryCrossingRule
); | 79 CORE_EXPORT Element* enclosingBlock(const Position&, EditingBoundaryCrossingRule
); |
75 CORE_EXPORT Element* enclosingBlock(const PositionInComposedTree&, EditingBounda
ryCrossingRule); | 80 CORE_EXPORT Element* enclosingBlock(const PositionInComposedTree&, EditingBounda
ryCrossingRule); |
76 Element* enclosingBlockFlowElement(Node&); // Deprecated, use enclosingBlock ins
tead. | 81 Element* enclosingBlockFlowElement(Node&); // Deprecated, use enclosingBlock ins
tead. |
77 bool inSameContainingBlockFlowElement(Node*, Node*); | 82 bool inSameContainingBlockFlowElement(Node*, Node*); |
78 Element* enclosingTableCell(const Position&); | 83 Element* enclosingTableCell(const Position&); |
79 Element* associatedElementOf(const Position&); | 84 Element* associatedElementOf(const Position&); |
80 Node* enclosingEmptyListItem(const VisiblePosition&); | 85 Node* enclosingEmptyListItem(const VisiblePosition&); |
81 Element* enclosingAnchorElement(const Position&); | 86 Element* enclosingAnchorElement(const Position&); |
| 87 // Returns the lowest ancestor with the specified QualifiedName. If the |
| 88 // specified Position is editable, this function returns an editable |
| 89 // Element. Otherwise, editability doesn't matter. |
82 Element* enclosingElementWithTag(const Position&, const QualifiedName&); | 90 Element* enclosingElementWithTag(const Position&, const QualifiedName&); |
83 CORE_EXPORT Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(cons
t Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary); | 91 CORE_EXPORT Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(cons
t Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary); |
84 CORE_EXPORT Node* enclosingNodeOfType(const PositionInComposedTree&, bool (*node
IsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary
); | 92 CORE_EXPORT Node* enclosingNodeOfType(const PositionInComposedTree&, bool (*node
IsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary
); |
85 | 93 |
86 HTMLSpanElement* tabSpanElement(const Node*); | 94 HTMLSpanElement* tabSpanElement(const Node*); |
87 Element* isLastPositionBeforeTable(const VisiblePosition&); | 95 Element* isLastPositionBeforeTable(const VisiblePosition&); |
88 CORE_EXPORT Element* isFirstPositionAfterTable(const VisiblePosition&); | 96 CORE_EXPORT Element* isFirstPositionAfterTable(const VisiblePosition&); |
89 CORE_EXPORT Element* isFirstPositionAfterTable(const VisiblePositionInComposedTr
ee&); | 97 CORE_EXPORT Element* isFirstPositionAfterTable(const VisiblePositionInComposedTr
ee&); |
90 | 98 |
91 // Returns the next leaf node or nullptr if there are no more. | 99 // Returns the next leaf node or nullptr if there are no more. |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // FIXME: this is required until 6853027 is fixed and text checking can do t
his for us. | 326 // FIXME: this is required until 6853027 is fixed and text checking can do t
his for us. |
319 return character == '\'' || character == rightSingleQuotationMarkCharacter |
| character == hebrewPunctuationGershayimCharacter; | 327 return character == '\'' || character == rightSingleQuotationMarkCharacter |
| character == hebrewPunctuationGershayimCharacter; |
320 } | 328 } |
321 | 329 |
322 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap
h, bool endIsEndOfParagraph); | 330 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagrap
h, bool endIsEndOfParagraph); |
323 const String& nonBreakingSpaceString(); | 331 const String& nonBreakingSpaceString(); |
324 | 332 |
325 } // namespace blink | 333 } // namespace blink |
326 | 334 |
327 #endif | 335 #endif |
OLD | NEW |