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: |
135 case CSSPropertyFontStyle: | 136 case CSSPropertyFontStyle: |
136 case CSSPropertyFontVariant: | 137 case CSSPropertyFontVariant: |
137 case CSSPropertyFontWeight: | 138 case CSSPropertyFontWeight: |
138 // Don't use CSSPropertyFont because old UAs can't recognize them bu
t are important for editing. | 139 // Don't use CSSPropertyFont because old UAs can't recognize them bu
t are important for editing. |
139 break; | 140 break; |
140 case CSSPropertyListStyleType: | 141 case CSSPropertyListStyleType: |
141 case CSSPropertyListStylePosition: | 142 case CSSPropertyListStylePosition: |
142 case CSSPropertyListStyleImage: | 143 case CSSPropertyListStyleImage: |
143 shorthandPropertyID = CSSPropertyListStyle; | 144 shorthandPropertyID = CSSPropertyListStyle; |
144 break; | 145 break; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if (m_propertySet.propertyAt(foundPropertyIndex).isImplicit()) { | 360 if (m_propertySet.propertyAt(foundPropertyIndex).isImplicit()) { |
360 commonValue = String(); | 361 commonValue = String(); |
361 return; | 362 return; |
362 } | 363 } |
363 | 364 |
364 char prefix = '\0'; | 365 char prefix = '\0'; |
365 switch (propertyID) { | 366 switch (propertyID) { |
366 case CSSPropertyFontStyle: | 367 case CSSPropertyFontStyle: |
367 break; // No prefix. | 368 break; // No prefix. |
368 case CSSPropertyFontFamily: | 369 case CSSPropertyFontFamily: |
| 370 case CSSPropertyFontStretch: |
369 case CSSPropertyFontVariant: | 371 case CSSPropertyFontVariant: |
370 case CSSPropertyFontWeight: | 372 case CSSPropertyFontWeight: |
371 prefix = ' '; | 373 prefix = ' '; |
372 break; | 374 break; |
373 case CSSPropertyLineHeight: | 375 case CSSPropertyLineHeight: |
374 prefix = '/'; | 376 prefix = '/'; |
375 break; | 377 break; |
376 default: | 378 default: |
377 ASSERT_NOT_REACHED(); | 379 ASSERT_NOT_REACHED(); |
378 } | 380 } |
(...skipping 16 matching lines...) Expand all Loading... |
395 StylePropertySet::PropertyReference fontSizeProperty = m_propertySet.propert
yAt(fontSizePropertyIndex); | 397 StylePropertySet::PropertyReference fontSizeProperty = m_propertySet.propert
yAt(fontSizePropertyIndex); |
396 StylePropertySet::PropertyReference fontFamilyProperty = m_propertySet.prope
rtyAt(fontFamilyPropertyIndex); | 398 StylePropertySet::PropertyReference fontFamilyProperty = m_propertySet.prope
rtyAt(fontFamilyPropertyIndex); |
397 if (fontSizeProperty.isImplicit() || fontFamilyProperty.isImplicit()) | 399 if (fontSizeProperty.isImplicit() || fontFamilyProperty.isImplicit()) |
398 return emptyString(); | 400 return emptyString(); |
399 | 401 |
400 String commonValue = fontSizeProperty.value()->cssText(); | 402 String commonValue = fontSizeProperty.value()->cssText(); |
401 StringBuilder result; | 403 StringBuilder result; |
402 appendFontLonghandValueIfExplicit(CSSPropertyFontStyle, result, commonValue)
; | 404 appendFontLonghandValueIfExplicit(CSSPropertyFontStyle, result, commonValue)
; |
403 appendFontLonghandValueIfExplicit(CSSPropertyFontVariant, result, commonValu
e); | 405 appendFontLonghandValueIfExplicit(CSSPropertyFontVariant, result, commonValu
e); |
404 appendFontLonghandValueIfExplicit(CSSPropertyFontWeight, result, commonValue
); | 406 appendFontLonghandValueIfExplicit(CSSPropertyFontWeight, result, commonValue
); |
| 407 appendFontLonghandValueIfExplicit(CSSPropertyFontStretch, result, commonValu
e); |
405 if (!result.isEmpty()) | 408 if (!result.isEmpty()) |
406 result.append(' '); | 409 result.append(' '); |
407 result.append(fontSizeProperty.value()->cssText()); | 410 result.append(fontSizeProperty.value()->cssText()); |
408 appendFontLonghandValueIfExplicit(CSSPropertyLineHeight, result, commonValue
); | 411 appendFontLonghandValueIfExplicit(CSSPropertyLineHeight, result, commonValue
); |
409 if (!result.isEmpty()) | 412 if (!result.isEmpty()) |
410 result.append(' '); | 413 result.append(' '); |
411 result.append(fontFamilyProperty.value()->cssText()); | 414 result.append(fontFamilyProperty.value()->cssText()); |
412 if (isInitialOrInherit(commonValue)) | 415 if (isInitialOrInherit(commonValue)) |
413 return commonValue; | 416 return commonValue; |
414 return result.toString(); | 417 return result.toString(); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 isInitialValue = false; | 845 isInitialValue = false; |
843 if (!value->isInheritedValue()) | 846 if (!value->isInheritedValue()) |
844 isInheritedValue = false; | 847 isInheritedValue = false; |
845 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 848 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
846 return false; | 849 return false; |
847 } | 850 } |
848 return isInitialValue || isInheritedValue; | 851 return isInitialValue || isInheritedValue; |
849 } | 852 } |
850 | 853 |
851 } | 854 } |
OLD | NEW |