OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 5 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 if (!shorthandPropertyID) | 125 if (!shorthandPropertyID) |
126 shorthandPropertyID = borderFallbackShorthandProperty; | 126 shorthandPropertyID = borderFallbackShorthandProperty; |
127 break; | 127 break; |
128 case CSSPropertyWebkitBorderHorizontalSpacing: | 128 case CSSPropertyWebkitBorderHorizontalSpacing: |
129 case CSSPropertyWebkitBorderVerticalSpacing: | 129 case CSSPropertyWebkitBorderVerticalSpacing: |
130 shorthandPropertyID = CSSPropertyBorderSpacing; | 130 shorthandPropertyID = CSSPropertyBorderSpacing; |
131 break; | 131 break; |
132 case CSSPropertyFontFamily: | 132 case CSSPropertyFontFamily: |
133 case CSSPropertyLineHeight: | 133 case CSSPropertyLineHeight: |
134 case CSSPropertyFontSize: | 134 case CSSPropertyFontSize: |
135 case CSSPropertyFontStretch: | |
136 case CSSPropertyFontStyle: | 135 case CSSPropertyFontStyle: |
137 case CSSPropertyFontVariant: | 136 case CSSPropertyFontVariant: |
138 case CSSPropertyFontWeight: | 137 case CSSPropertyFontWeight: |
139 // Don't use CSSPropertyFont because old UAs can't recognize them bu
t are important for editing. | 138 // Don't use CSSPropertyFont because old UAs can't recognize them bu
t are important for editing. |
140 break; | 139 break; |
141 case CSSPropertyListStyleType: | 140 case CSSPropertyListStyleType: |
142 case CSSPropertyListStylePosition: | 141 case CSSPropertyListStylePosition: |
143 case CSSPropertyListStyleImage: | 142 case CSSPropertyListStyleImage: |
144 shorthandPropertyID = CSSPropertyListStyle; | 143 shorthandPropertyID = CSSPropertyListStyle; |
145 break; | 144 break; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (m_propertySet.propertyAt(foundPropertyIndex).isImplicit()) { | 359 if (m_propertySet.propertyAt(foundPropertyIndex).isImplicit()) { |
361 commonValue = String(); | 360 commonValue = String(); |
362 return; | 361 return; |
363 } | 362 } |
364 | 363 |
365 char prefix = '\0'; | 364 char prefix = '\0'; |
366 switch (propertyID) { | 365 switch (propertyID) { |
367 case CSSPropertyFontStyle: | 366 case CSSPropertyFontStyle: |
368 break; // No prefix. | 367 break; // No prefix. |
369 case CSSPropertyFontFamily: | 368 case CSSPropertyFontFamily: |
370 case CSSPropertyFontStretch: | |
371 case CSSPropertyFontVariant: | 369 case CSSPropertyFontVariant: |
372 case CSSPropertyFontWeight: | 370 case CSSPropertyFontWeight: |
373 prefix = ' '; | 371 prefix = ' '; |
374 break; | 372 break; |
375 case CSSPropertyLineHeight: | 373 case CSSPropertyLineHeight: |
376 prefix = '/'; | 374 prefix = '/'; |
377 break; | 375 break; |
378 default: | 376 default: |
379 ASSERT_NOT_REACHED(); | 377 ASSERT_NOT_REACHED(); |
380 } | 378 } |
(...skipping 16 matching lines...) Expand all Loading... |
397 StylePropertySet::PropertyReference fontSizeProperty = m_propertySet.propert
yAt(fontSizePropertyIndex); | 395 StylePropertySet::PropertyReference fontSizeProperty = m_propertySet.propert
yAt(fontSizePropertyIndex); |
398 StylePropertySet::PropertyReference fontFamilyProperty = m_propertySet.prope
rtyAt(fontFamilyPropertyIndex); | 396 StylePropertySet::PropertyReference fontFamilyProperty = m_propertySet.prope
rtyAt(fontFamilyPropertyIndex); |
399 if (fontSizeProperty.isImplicit() || fontFamilyProperty.isImplicit()) | 397 if (fontSizeProperty.isImplicit() || fontFamilyProperty.isImplicit()) |
400 return emptyString(); | 398 return emptyString(); |
401 | 399 |
402 String commonValue = fontSizeProperty.value()->cssText(); | 400 String commonValue = fontSizeProperty.value()->cssText(); |
403 StringBuilder result; | 401 StringBuilder result; |
404 appendFontLonghandValueIfExplicit(CSSPropertyFontStyle, result, commonValue)
; | 402 appendFontLonghandValueIfExplicit(CSSPropertyFontStyle, result, commonValue)
; |
405 appendFontLonghandValueIfExplicit(CSSPropertyFontVariant, result, commonValu
e); | 403 appendFontLonghandValueIfExplicit(CSSPropertyFontVariant, result, commonValu
e); |
406 appendFontLonghandValueIfExplicit(CSSPropertyFontWeight, result, commonValue
); | 404 appendFontLonghandValueIfExplicit(CSSPropertyFontWeight, result, commonValue
); |
407 appendFontLonghandValueIfExplicit(CSSPropertyFontStretch, result, commonValu
e); | |
408 if (!result.isEmpty()) | 405 if (!result.isEmpty()) |
409 result.append(' '); | 406 result.append(' '); |
410 result.append(fontSizeProperty.value()->cssText()); | 407 result.append(fontSizeProperty.value()->cssText()); |
411 appendFontLonghandValueIfExplicit(CSSPropertyLineHeight, result, commonValue
); | 408 appendFontLonghandValueIfExplicit(CSSPropertyLineHeight, result, commonValue
); |
412 if (!result.isEmpty()) | 409 if (!result.isEmpty()) |
413 result.append(' '); | 410 result.append(' '); |
414 result.append(fontFamilyProperty.value()->cssText()); | 411 result.append(fontFamilyProperty.value()->cssText()); |
415 if (isInitialOrInherit(commonValue)) | 412 if (isInitialOrInherit(commonValue)) |
416 return commonValue; | 413 return commonValue; |
417 return result.toString(); | 414 return result.toString(); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 isInitialValue = false; | 842 isInitialValue = false; |
846 if (!value->isInheritedValue()) | 843 if (!value->isInheritedValue()) |
847 isInheritedValue = false; | 844 isInheritedValue = false; |
848 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 845 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
849 return false; | 846 return false; |
850 } | 847 } |
851 return isInitialValue || isInheritedValue; | 848 return isInitialValue || isInheritedValue; |
852 } | 849 } |
853 | 850 |
854 } | 851 } |
OLD | NEW |