OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008, 2009 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // style-removal helpers | 79 // style-removal helpers |
80 bool isStyledInlineElementToRemove(Element*) const; | 80 bool isStyledInlineElementToRemove(Element*) const; |
81 bool shouldApplyInlineStyleToRun(EditingStyle*, Node* runStart, Node* pastEn
dNode); | 81 bool shouldApplyInlineStyleToRun(EditingStyle*, Node* runStart, Node* pastEn
dNode); |
82 void removeConflictingInlineStyleFromRun(EditingStyle*, RefPtrWillBeMember<N
ode>& runStart, RefPtrWillBeMember<Node>& runEnd, PassRefPtrWillBeRawPtr<Node> p
astEndNode); | 82 void removeConflictingInlineStyleFromRun(EditingStyle*, RefPtrWillBeMember<N
ode>& runStart, RefPtrWillBeMember<Node>& runEnd, PassRefPtrWillBeRawPtr<Node> p
astEndNode); |
83 bool removeInlineStyleFromElement(EditingStyle*, PassRefPtrWillBeRawPtr<HTML
Element>, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle
= nullptr); | 83 bool removeInlineStyleFromElement(EditingStyle*, PassRefPtrWillBeRawPtr<HTML
Element>, InlineStyleRemovalMode = RemoveIfNeeded, EditingStyle* extractedStyle
= nullptr); |
84 inline bool shouldRemoveInlineStyleFromElement(EditingStyle* style, HTMLElem
ent* element) {return removeInlineStyleFromElement(style, element, RemoveNone);} | 84 inline bool shouldRemoveInlineStyleFromElement(EditingStyle* style, HTMLElem
ent* element) {return removeInlineStyleFromElement(style, element, RemoveNone);} |
85 void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*); | 85 void replaceWithSpanOrRemoveIfWithoutAttributes(HTMLElement*); |
86 bool removeImplicitlyStyledElement(EditingStyle*, HTMLElement*, InlineStyleR
emovalMode, EditingStyle* extractedStyle); | 86 bool removeImplicitlyStyledElement(EditingStyle*, HTMLElement*, InlineStyleR
emovalMode, EditingStyle* extractedStyle); |
87 bool removeCSSStyle(EditingStyle*, HTMLElement*, InlineStyleRemovalMode = Re
moveIfNeeded, EditingStyle* extractedStyle = nullptr); | 87 bool removeCSSStyle(EditingStyle*, HTMLElement*, InlineStyleRemovalMode = Re
moveIfNeeded, EditingStyle* extractedStyle = nullptr); |
88 HTMLElement* highestAncestorWithConflictingInlineStyle(EditingStyle*, Node*)
; | 88 HTMLElement* highestAncestorWithConflictingInlineStyle(EditingStyle*, Node*)
; |
89 void applyInlineStyleToPushDown(Node*, EditingStyle*); | 89 void applyInlineStyleToPushDown(Node*, EditingStyle*, EditingState*); |
90 void pushDownInlineStyleAroundNode(EditingStyle*, Node*); | 90 void pushDownInlineStyleAroundNode(EditingStyle*, Node*, EditingState*); |
91 void removeInlineStyle(EditingStyle* , const Position& start, const Position
& end); | 91 void removeInlineStyle(EditingStyle* , const Position& start, const Position
& end, EditingState*); |
92 bool elementFullySelected(HTMLElement&, const Position& start, const Positio
n& end) const; | 92 bool elementFullySelected(HTMLElement&, const Position& start, const Positio
n& end) const; |
93 | 93 |
94 // style-application helpers | 94 // style-application helpers |
95 void applyBlockStyle(EditingStyle*, EditingState*); | 95 void applyBlockStyle(EditingStyle*, EditingState*); |
96 void applyRelativeFontStyleChange(EditingStyle*); | 96 void applyRelativeFontStyleChange(EditingStyle*); |
97 void applyInlineStyle(EditingStyle*, EditingState*); | 97 void applyInlineStyle(EditingStyle*, EditingState*); |
98 void fixRangeAndApplyInlineStyle(EditingStyle*, const Position& start, const
Position& end, EditingState*); | 98 void fixRangeAndApplyInlineStyle(EditingStyle*, const Position& start, const
Position& end, EditingState*); |
99 void applyInlineStyleToNodeRange(EditingStyle*, PassRefPtrWillBeRawPtr<Node>
startNode, PassRefPtrWillBeRawPtr<Node> pastEndNode, EditingState*); | 99 void applyInlineStyleToNodeRange(EditingStyle*, PassRefPtrWillBeRawPtr<Node>
startNode, PassRefPtrWillBeRawPtr<Node> pastEndNode, EditingState*); |
100 void addBlockStyle(const StyleChange&, HTMLElement*); | 100 void addBlockStyle(const StyleChange&, HTMLElement*); |
101 void addInlineStyleIfNeeded(EditingStyle*, PassRefPtrWillBeRawPtr<Node> star
t, PassRefPtrWillBeRawPtr<Node> end, EAddStyledElement = AddStyledElement); | 101 // TODO(tkent): Remove the EAddStyledElement argument. It's always |
| 102 // DoNotAddStyledElement. |
| 103 void addInlineStyleIfNeeded(EditingStyle*, PassRefPtrWillBeRawPtr<Node> star
t, PassRefPtrWillBeRawPtr<Node> end, EditingState*, EAddStyledElement = AddStyle
dElement); |
102 Position positionToComputeInlineStyleChange(PassRefPtrWillBeRawPtr<Node>, Re
fPtrWillBeMember<HTMLSpanElement>& dummyElement); | 104 Position positionToComputeInlineStyleChange(PassRefPtrWillBeRawPtr<Node>, Re
fPtrWillBeMember<HTMLSpanElement>& dummyElement); |
103 void applyInlineStyleChange(PassRefPtrWillBeRawPtr<Node> startNode, PassRefP
trWillBeRawPtr<Node> endNode, StyleChange&, EAddStyledElement, EditingState*); | 105 void applyInlineStyleChange(PassRefPtrWillBeRawPtr<Node> startNode, PassRefP
trWillBeRawPtr<Node> endNode, StyleChange&, EAddStyledElement, EditingState*); |
104 void splitTextAtStart(const Position& start, const Position& end); | 106 void splitTextAtStart(const Position& start, const Position& end); |
105 void splitTextAtEnd(const Position& start, const Position& end); | 107 void splitTextAtEnd(const Position& start, const Position& end); |
106 void splitTextElementAtStart(const Position& start, const Position& end); | 108 void splitTextElementAtStart(const Position& start, const Position& end); |
107 void splitTextElementAtEnd(const Position& start, const Position& end); | 109 void splitTextElementAtEnd(const Position& start, const Position& end); |
108 bool shouldSplitTextElement(Element*, EditingStyle*); | 110 bool shouldSplitTextElement(Element*, EditingStyle*); |
109 bool isValidCaretPositionInTextNode(const Position&); | 111 bool isValidCaretPositionInTextNode(const Position&); |
110 bool mergeStartWithPreviousIfIdentical(const Position& start, const Position
& end); | 112 bool mergeStartWithPreviousIfIdentical(const Position& start, const Position
& end, EditingState*); |
111 bool mergeEndWithNextIfIdentical(const Position& start, const Position& end)
; | 113 bool mergeEndWithNextIfIdentical(const Position& start, const Position& end,
EditingState*); |
112 void cleanupUnstyledAppleStyleSpans(ContainerNode* dummySpanAncestor); | 114 void cleanupUnstyledAppleStyleSpans(ContainerNode* dummySpanAncestor); |
113 | 115 |
114 void surroundNodeRangeWithElement(PassRefPtrWillBeRawPtr<Node> start, PassRe
fPtrWillBeRawPtr<Node> end, PassRefPtrWillBeRawPtr<Element>, EditingState*); | 116 void surroundNodeRangeWithElement(PassRefPtrWillBeRawPtr<Node> start, PassRe
fPtrWillBeRawPtr<Node> end, PassRefPtrWillBeRawPtr<Element>, EditingState*); |
115 float computedFontSize(Node*); | 117 float computedFontSize(Node*); |
116 void joinChildTextNodes(ContainerNode*, const Position& start, const Positio
n& end); | 118 void joinChildTextNodes(ContainerNode*, const Position& start, const Positio
n& end); |
117 | 119 |
118 HTMLElement* splitAncestorsWithUnicodeBidi(Node*, bool before, WritingDirect
ion allowedDirection); | 120 HTMLElement* splitAncestorsWithUnicodeBidi(Node*, bool before, WritingDirect
ion allowedDirection); |
119 void removeEmbeddingUpToEnclosingBlock(Node*, HTMLElement* unsplitAncestor); | 121 void removeEmbeddingUpToEnclosingBlock(Node*, HTMLElement* unsplitAncestor); |
120 | 122 |
121 void updateStartEnd(const Position& newStart, const Position& newEnd); | 123 void updateStartEnd(const Position& newStart, const Position& newEnd); |
(...skipping 12 matching lines...) Expand all Loading... |
134 }; | 136 }; |
135 | 137 |
136 enum ShouldStyleAttributeBeEmpty { AllowNonEmptyStyleAttribute, StyleAttributeSh
ouldBeEmpty }; | 138 enum ShouldStyleAttributeBeEmpty { AllowNonEmptyStyleAttribute, StyleAttributeSh
ouldBeEmpty }; |
137 bool isEmptyFontTag(const Element*, ShouldStyleAttributeBeEmpty = StyleAttribute
ShouldBeEmpty); | 139 bool isEmptyFontTag(const Element*, ShouldStyleAttributeBeEmpty = StyleAttribute
ShouldBeEmpty); |
138 bool isLegacyAppleHTMLSpanElement(const Node*); | 140 bool isLegacyAppleHTMLSpanElement(const Node*); |
139 bool isStyleSpanOrSpanWithOnlyStyleAttribute(const Element*); | 141 bool isStyleSpanOrSpanWithOnlyStyleAttribute(const Element*); |
140 | 142 |
141 } // namespace blink | 143 } // namespace blink |
142 | 144 |
143 #endif | 145 #endif |
OLD | NEW |