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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (!shorthandPropertyID) | 123 if (!shorthandPropertyID) |
124 shorthandPropertyID = borderFallbackShorthandProperty; | 124 shorthandPropertyID = borderFallbackShorthandProperty; |
125 break; | 125 break; |
126 case CSSPropertyWebkitBorderHorizontalSpacing: | 126 case CSSPropertyWebkitBorderHorizontalSpacing: |
127 case CSSPropertyWebkitBorderVerticalSpacing: | 127 case CSSPropertyWebkitBorderVerticalSpacing: |
128 shorthandPropertyID = CSSPropertyBorderSpacing; | 128 shorthandPropertyID = CSSPropertyBorderSpacing; |
129 break; | 129 break; |
130 case CSSPropertyFontFamily: | 130 case CSSPropertyFontFamily: |
131 case CSSPropertyLineHeight: | 131 case CSSPropertyLineHeight: |
132 case CSSPropertyFontSize: | 132 case CSSPropertyFontSize: |
| 133 case CSSPropertyFontStretch: |
133 case CSSPropertyFontStyle: | 134 case CSSPropertyFontStyle: |
134 case CSSPropertyFontVariant: | 135 case CSSPropertyFontVariant: |
135 case CSSPropertyFontWeight: | 136 case CSSPropertyFontWeight: |
136 // Don't use CSSPropertyFont because old UAs can't recognize them bu
t are important for editing. | 137 // Don't use CSSPropertyFont because old UAs can't recognize them bu
t are important for editing. |
137 break; | 138 break; |
138 case CSSPropertyListStyleType: | 139 case CSSPropertyListStyleType: |
139 case CSSPropertyListStylePosition: | 140 case CSSPropertyListStylePosition: |
140 case CSSPropertyListStyleImage: | 141 case CSSPropertyListStyleImage: |
141 shorthandPropertyID = CSSPropertyListStyle; | 142 shorthandPropertyID = CSSPropertyListStyle; |
142 break; | 143 break; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 if (m_propertySet.propertyAt(foundPropertyIndex).isImplicit()) { | 359 if (m_propertySet.propertyAt(foundPropertyIndex).isImplicit()) { |
359 commonValue = String(); | 360 commonValue = String(); |
360 return; | 361 return; |
361 } | 362 } |
362 | 363 |
363 char prefix = '\0'; | 364 char prefix = '\0'; |
364 switch (propertyID) { | 365 switch (propertyID) { |
365 case CSSPropertyFontStyle: | 366 case CSSPropertyFontStyle: |
366 break; // No prefix. | 367 break; // No prefix. |
367 case CSSPropertyFontFamily: | 368 case CSSPropertyFontFamily: |
| 369 case CSSPropertyFontStretch: |
368 case CSSPropertyFontVariant: | 370 case CSSPropertyFontVariant: |
369 case CSSPropertyFontWeight: | 371 case CSSPropertyFontWeight: |
370 prefix = ' '; | 372 prefix = ' '; |
371 break; | 373 break; |
372 case CSSPropertyLineHeight: | 374 case CSSPropertyLineHeight: |
373 prefix = '/'; | 375 prefix = '/'; |
374 break; | 376 break; |
375 default: | 377 default: |
376 ASSERT_NOT_REACHED(); | 378 ASSERT_NOT_REACHED(); |
377 } | 379 } |
(...skipping 16 matching lines...) Expand all Loading... |
394 StylePropertySet::PropertyReference fontSizeProperty = m_propertySet.propert
yAt(fontSizePropertyIndex); | 396 StylePropertySet::PropertyReference fontSizeProperty = m_propertySet.propert
yAt(fontSizePropertyIndex); |
395 StylePropertySet::PropertyReference fontFamilyProperty = m_propertySet.prope
rtyAt(fontFamilyPropertyIndex); | 397 StylePropertySet::PropertyReference fontFamilyProperty = m_propertySet.prope
rtyAt(fontFamilyPropertyIndex); |
396 if (fontSizeProperty.isImplicit() || fontFamilyProperty.isImplicit()) | 398 if (fontSizeProperty.isImplicit() || fontFamilyProperty.isImplicit()) |
397 return emptyString(); | 399 return emptyString(); |
398 | 400 |
399 String commonValue = fontSizeProperty.value()->cssText(); | 401 String commonValue = fontSizeProperty.value()->cssText(); |
400 StringBuilder result; | 402 StringBuilder result; |
401 appendFontLonghandValueIfExplicit(CSSPropertyFontStyle, result, commonValue)
; | 403 appendFontLonghandValueIfExplicit(CSSPropertyFontStyle, result, commonValue)
; |
402 appendFontLonghandValueIfExplicit(CSSPropertyFontVariant, result, commonValu
e); | 404 appendFontLonghandValueIfExplicit(CSSPropertyFontVariant, result, commonValu
e); |
403 appendFontLonghandValueIfExplicit(CSSPropertyFontWeight, result, commonValue
); | 405 appendFontLonghandValueIfExplicit(CSSPropertyFontWeight, result, commonValue
); |
| 406 appendFontLonghandValueIfExplicit(CSSPropertyFontStretch, result, commonValu
e); |
404 if (!result.isEmpty()) | 407 if (!result.isEmpty()) |
405 result.append(' '); | 408 result.append(' '); |
406 result.append(fontSizeProperty.value()->cssText()); | 409 result.append(fontSizeProperty.value()->cssText()); |
407 appendFontLonghandValueIfExplicit(CSSPropertyLineHeight, result, commonValue
); | 410 appendFontLonghandValueIfExplicit(CSSPropertyLineHeight, result, commonValue
); |
408 if (!result.isEmpty()) | 411 if (!result.isEmpty()) |
409 result.append(' '); | 412 result.append(' '); |
410 result.append(fontFamilyProperty.value()->cssText()); | 413 result.append(fontFamilyProperty.value()->cssText()); |
411 if (isInitialOrInherit(commonValue)) | 414 if (isInitialOrInherit(commonValue)) |
412 return commonValue; | 415 return commonValue; |
413 return result.toString(); | 416 return result.toString(); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 isInitialValue = false; | 866 isInitialValue = false; |
864 if (!value->isInheritedValue()) | 867 if (!value->isInheritedValue()) |
865 isInheritedValue = false; | 868 isInheritedValue = false; |
866 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 869 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
867 return false; | 870 return false; |
868 } | 871 } |
869 return isInitialValue || isInheritedValue; | 872 return isInitialValue || isInheritedValue; |
870 } | 873 } |
871 | 874 |
872 } | 875 } |
OLD | NEW |