OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 void mergeStyleFromRulesForSerialization(Element*); | 128 void mergeStyleFromRulesForSerialization(Element*); |
129 void removeStyleFromRulesAndContext(Element*, ContainerNode* context); | 129 void removeStyleFromRulesAndContext(Element*, ContainerNode* context); |
130 void removePropertiesInElementDefaultStyle(Element*); | 130 void removePropertiesInElementDefaultStyle(Element*); |
131 void addAbsolutePositioningFromElement(const Element&); | 131 void addAbsolutePositioningFromElement(const Element&); |
132 void forceInline(); | 132 void forceInline(); |
133 int legacyFontSize(Document*) const; | 133 int legacyFontSize(Document*) const; |
134 | 134 |
135 float fontSizeDelta() const { return m_fontSizeDelta; } | 135 float fontSizeDelta() const { return m_fontSizeDelta; } |
136 bool hasFontSizeDelta() const { return m_fontSizeDelta != NoFontDelta; } | 136 bool hasFontSizeDelta() const { return m_fontSizeDelta != NoFontDelta; } |
137 | 137 |
138 static EditingStyle* styleAtSelectionStart(const VisibleSelection&, bool sho
uldUseBackgroundColorInEffect = false); | 138 static EditingStyle* styleAtSelectionStart(const VisibleSelection&, bool sho
uldUseBackgroundColorInEffect = false, MutableStylePropertySet* styleToCheck = n
ullptr); |
139 static WritingDirection textDirectionForSelection(const VisibleSelection&, E
ditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings); | 139 static WritingDirection textDirectionForSelection(const VisibleSelection&, E
ditingStyle* typingStyle, bool& hasNestedOrMultipleEmbeddings); |
140 static bool isEmbedOrIsolate(CSSValueID unicodeBidi) | 140 static bool isEmbedOrIsolate(CSSValueID unicodeBidi) |
141 { | 141 { |
142 return unicodeBidi == CSSValueIsolate || unicodeBidi == CSSValueWebkitIs
olate || unicodeBidi == CSSValueEmbed; | 142 return unicodeBidi == CSSValueIsolate || unicodeBidi == CSSValueWebkitIs
olate || unicodeBidi == CSSValueEmbed; |
143 } | 143 } |
144 | 144 |
145 DECLARE_TRACE(); | 145 DECLARE_TRACE(); |
146 | 146 |
147 private: | 147 private: |
148 EditingStyle(); | 148 EditingStyle(); |
149 EditingStyle(ContainerNode*, PropertiesToInclude); | 149 EditingStyle(ContainerNode*, PropertiesToInclude); |
150 EditingStyle(const Position&, PropertiesToInclude); | 150 EditingStyle(const Position&, PropertiesToInclude); |
151 explicit EditingStyle(const StylePropertySet*); | 151 explicit EditingStyle(const StylePropertySet*); |
152 EditingStyle(CSSPropertyID, const String& value); | 152 EditingStyle(CSSPropertyID, const String& value); |
153 void init(Node*, PropertiesToInclude); | 153 void init(Node*, PropertiesToInclude); |
154 void removeTextFillAndStrokeColorsIfNeeded(const ComputedStyle*); | 154 void removeTextFillAndStrokeColorsIfNeeded(const ComputedStyle*); |
155 void setProperty(CSSPropertyID, const String& value, bool important = false)
; | 155 void setProperty(CSSPropertyID, const String& value, bool important = false)
; |
156 void replaceFontSizeByKeywordIfPossible(const ComputedStyle*, CSSComputedSty
leDeclaration*); | 156 void replaceFontSizeByKeywordIfPossible(const ComputedStyle*, CSSComputedSty
leDeclaration*); |
157 void extractFontSizeDelta(); | 157 void extractFontSizeDelta(); |
158 TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTe
xtOnlyProperties) const; | 158 TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTe
xtOnlyProperties) const; |
159 bool conflictsWithInlineStyleOfElement(HTMLElement*, EditingStyle* extracted
Style, Vector<CSSPropertyID>* conflictingProperties) const; | 159 bool conflictsWithInlineStyleOfElement(HTMLElement*, EditingStyle* extracted
Style, Vector<CSSPropertyID>* conflictingProperties) const; |
160 void mergeInlineAndImplicitStyleOfElement(Element*, CSSPropertyOverrideMode,
PropertiesToInclude); | 160 void mergeInlineAndImplicitStyleOfElement(Element*, CSSPropertyOverrideMode,
PropertiesToInclude); |
161 void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); | 161 void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); |
162 | 162 |
163 Member<MutableStylePropertySet> m_mutableStyle; | 163 Member<MutableStylePropertySet> m_mutableStyle; |
164 bool m_isMonospaceFont; | 164 bool m_isMonospaceFont; |
165 float m_fontSizeDelta; | 165 float m_fontSizeDelta; |
| 166 bool m_isVerticalAlign = false; |
166 | 167 |
167 friend class HTMLElementEquivalent; | 168 friend class HTMLElementEquivalent; |
168 friend class HTMLAttributeEquivalent; | 169 friend class HTMLAttributeEquivalent; |
169 }; | 170 }; |
170 | 171 |
171 class StyleChange { | 172 class StyleChange { |
172 DISALLOW_NEW(); | 173 DISALLOW_NEW(); |
173 public: | 174 public: |
174 StyleChange() | 175 StyleChange() |
175 : m_applyBold(false) | 176 : m_applyBold(false) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 String m_applyFontSize; | 230 String m_applyFontSize; |
230 }; | 231 }; |
231 | 232 |
232 // FIXME: Remove these functions or make them non-global to discourage using CSS
StyleDeclaration directly. | 233 // FIXME: Remove these functions or make them non-global to discourage using CSS
StyleDeclaration directly. |
233 CSSValueID getIdentifierValue(CSSStyleDeclaration*, CSSPropertyID); | 234 CSSValueID getIdentifierValue(CSSStyleDeclaration*, CSSPropertyID); |
234 CSSValueID getIdentifierValue(StylePropertySet*, CSSPropertyID); | 235 CSSValueID getIdentifierValue(StylePropertySet*, CSSPropertyID); |
235 | 236 |
236 } // namespace blink | 237 } // namespace blink |
237 | 238 |
238 #endif // EditingStyle_h | 239 #endif // EditingStyle_h |
OLD | NEW |