diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/editing/htmlediting.h | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/editing/htmlediting.h')
-rw-r--r-- | Source/WebCore/editing/htmlediting.h | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/Source/WebCore/editing/htmlediting.h b/Source/WebCore/editing/htmlediting.h index b71e879..cb2b2a4 100644 --- a/Source/WebCore/editing/htmlediting.h +++ b/Source/WebCore/editing/htmlediting.h @@ -26,9 +26,11 @@ #ifndef htmlediting_h #define htmlediting_h +#include "EditingBoundary.h" #include "ExceptionCode.h" #include "HTMLNames.h" #include "Position.h" +#include "TextDirection.h" #include <wtf/Forward.h> #include <wtf/unicode/CharacterNames.h> @@ -54,18 +56,17 @@ class VisibleSelection; Node* highestAncestor(Node*); Node* highestEditableRoot(const Position&); -Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*)); +Node* highestEnclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary); Node* lowestEditableAncestor(Node*); -Node* enclosingBlock(Node*); +Node* enclosingBlock(Node*, EditingBoundaryCrossingRule = CannotCrossEditingBoundary); Node* enclosingTableCell(const Position&); Node* enclosingEmptyListItem(const VisiblePosition&); Node* enclosingAnchorElement(const Position&); Node* enclosingNodeWithTag(const Position&, const QualifiedName&); -Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), bool onlyReturnEditableNodes = true); +Node* enclosingNodeOfType(const Position&, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary); Node* tabSpanNode(const Node*); -Node* nearestMailBlockquote(const Node*); Node* isLastPositionBeforeTable(const VisiblePosition&); Node* isFirstPositionAfterTable(const VisiblePosition&); @@ -96,6 +97,8 @@ bool isNodeVisiblyContainedWithin(Node*, const Range*); bool isRenderedAsNonInlineTableImageOrHR(const Node*); bool isNodeInTextFormControl(Node* node); +TextDirection directionOfEnclosingBlock(const Position&); + // ------------------------------------------------------------------------- // Position // ------------------------------------------------------------------------- @@ -115,34 +118,18 @@ Position positionOutsideContainingSpecialElement(const Position&, Node** contain inline Position firstPositionInOrBeforeNode(Node* node) { + if (!node) + return Position(); return editingIgnoresContent(node) ? positionBeforeNode(node) : firstPositionInNode(node); } inline Position lastPositionInOrAfterNode(Node* node) { + if (!node) + return Position(); return editingIgnoresContent(node) ? positionAfterNode(node) : lastPositionInNode(node); } -// Position creation functions are inline to prevent ref-churn. -// Other Position creation functions are in Position.h -// but these depend on lastOffsetForEditing which is defined in htmlediting.h. - -// NOTE: first/lastDeepEditingPositionForNode return legacy editing positions (like [img, 0]) -// for elements which editing ignores. The rest of the editing code will treat [img, 0] -// as "the last position before the img". -// New code should use the creation functions in Position.h instead. -inline Position firstDeepEditingPositionForNode(Node* anchorNode) -{ - ASSERT(anchorNode); - return Position(anchorNode, 0); -} - -inline Position lastDeepEditingPositionForNode(Node* anchorNode) -{ - ASSERT(anchorNode); - return Position(anchorNode, lastOffsetForEditing(anchorNode)); -} - // comparision functions on Position int comparePositions(const Position&, const Position&); @@ -237,7 +224,7 @@ inline bool isWhitespace(UChar c) { return c == noBreakSpace || c == ' ' || c == '\n' || c == '\t'; } -String stringWithRebalancedWhitespace(const String&, bool, bool); +String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagraph, bool endIsEndOfParagraph); const String& nonBreakingSpaceString(); } |