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 17 matching lines...) Expand all Loading... |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #ifndef EditingStyle_h | 32 #ifndef EditingStyle_h |
33 #define EditingStyle_h | 33 #define EditingStyle_h |
34 | 34 |
35 #include "core/CSSPropertyNames.h" | 35 #include "core/CSSPropertyNames.h" |
36 #include "core/CSSValueKeywords.h" | 36 #include "core/CSSValueKeywords.h" |
37 #include "core/editing/WritingDirection.h" | 37 #include "core/editing/WritingDirection.h" |
| 38 #include "platform/fonts/FixedPitchFontType.h" |
38 #include "platform/heap/Handle.h" | 39 #include "platform/heap/Handle.h" |
39 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
42 #include "wtf/TriState.h" | 43 #include "wtf/TriState.h" |
43 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
44 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
45 | 46 |
46 namespace WebCore { | 47 namespace WebCore { |
47 | 48 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void removeTextFillAndStrokeColorsIfNeeded(RenderStyle*); | 154 void removeTextFillAndStrokeColorsIfNeeded(RenderStyle*); |
154 void setProperty(CSSPropertyID, const String& value, bool important = false)
; | 155 void setProperty(CSSPropertyID, const String& value, bool important = false)
; |
155 void replaceFontSizeByKeywordIfPossible(RenderStyle*, CSSComputedStyleDeclar
ation*); | 156 void replaceFontSizeByKeywordIfPossible(RenderStyle*, CSSComputedStyleDeclar
ation*); |
156 void extractFontSizeDelta(); | 157 void extractFontSizeDelta(); |
157 TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTe
xtOnlyProperties) const; | 158 TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTe
xtOnlyProperties) const; |
158 bool conflictsWithInlineStyleOfElement(Element*, EditingStyle* extractedStyl
e, Vector<CSSPropertyID>* conflictingProperties) const; | 159 bool conflictsWithInlineStyleOfElement(Element*, EditingStyle* extractedStyl
e, Vector<CSSPropertyID>* conflictingProperties) const; |
159 void mergeInlineAndImplicitStyleOfElement(Element*, CSSPropertyOverrideMode,
PropertiesToInclude); | 160 void mergeInlineAndImplicitStyleOfElement(Element*, CSSPropertyOverrideMode,
PropertiesToInclude); |
160 void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); | 161 void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode); |
161 | 162 |
162 RefPtrWillBeMember<MutableStylePropertySet> m_mutableStyle; | 163 RefPtrWillBeMember<MutableStylePropertySet> m_mutableStyle; |
163 bool m_shouldUseFixedDefaultFontSize; | 164 FixedPitchFontType m_fixedPitchFontType; |
164 float m_fontSizeDelta; | 165 float m_fontSizeDelta; |
165 | 166 |
166 friend class HTMLElementEquivalent; | 167 friend class HTMLElementEquivalent; |
167 friend class HTMLAttributeEquivalent; | 168 friend class HTMLAttributeEquivalent; |
168 }; | 169 }; |
169 | 170 |
170 class StyleChange { | 171 class StyleChange { |
171 public: | 172 public: |
172 StyleChange() | 173 StyleChange() |
173 : m_applyBold(false) | 174 : m_applyBold(false) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 && m_applySuperscript == other.m_applySuperscript | 207 && m_applySuperscript == other.m_applySuperscript |
207 && m_applyFontColor == other.m_applyFontColor | 208 && m_applyFontColor == other.m_applyFontColor |
208 && m_applyFontFace == other.m_applyFontFace | 209 && m_applyFontFace == other.m_applyFontFace |
209 && m_applyFontSize == other.m_applyFontSize; | 210 && m_applyFontSize == other.m_applyFontSize; |
210 } | 211 } |
211 bool operator!=(const StyleChange& other) | 212 bool operator!=(const StyleChange& other) |
212 { | 213 { |
213 return !(*this == other); | 214 return !(*this == other); |
214 } | 215 } |
215 private: | 216 private: |
216 void extractTextStyles(Document*, MutableStylePropertySet*, bool shouldUseFi
xedFontDefaultSize); | 217 void extractTextStyles(Document*, MutableStylePropertySet*, FixedPitchFontTy
pe); |
217 | 218 |
218 String m_cssStyle; | 219 String m_cssStyle; |
219 bool m_applyBold; | 220 bool m_applyBold; |
220 bool m_applyItalic; | 221 bool m_applyItalic; |
221 bool m_applyUnderline; | 222 bool m_applyUnderline; |
222 bool m_applyLineThrough; | 223 bool m_applyLineThrough; |
223 bool m_applySubscript; | 224 bool m_applySubscript; |
224 bool m_applySuperscript; | 225 bool m_applySuperscript; |
225 String m_applyFontColor; | 226 String m_applyFontColor; |
226 String m_applyFontFace; | 227 String m_applyFontFace; |
227 String m_applyFontSize; | 228 String m_applyFontSize; |
228 }; | 229 }; |
229 | 230 |
230 // FIXME: Remove these functions or make them non-global to discourage using CSS
StyleDeclaration directly. | 231 // FIXME: Remove these functions or make them non-global to discourage using CSS
StyleDeclaration directly. |
231 CSSValueID getIdentifierValue(CSSStyleDeclaration*, CSSPropertyID); | 232 CSSValueID getIdentifierValue(CSSStyleDeclaration*, CSSPropertyID); |
232 CSSValueID getIdentifierValue(StylePropertySet*, CSSPropertyID); | 233 CSSValueID getIdentifierValue(StylePropertySet*, CSSPropertyID); |
233 | 234 |
234 } // namespace WebCore | 235 } // namespace WebCore |
235 | 236 |
236 #endif // EditingStyle_h | 237 #endif // EditingStyle_h |
OLD | NEW |