| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 String StylePropertySerializer::asText() const | 62 String StylePropertySerializer::asText() const |
| 63 { | 63 { |
| 64 StringBuilder result; | 64 StringBuilder result; |
| 65 | 65 |
| 66 BitArray<numCSSProperties> shorthandPropertyUsed; | 66 BitArray<numCSSProperties> shorthandPropertyUsed; |
| 67 BitArray<numCSSProperties> shorthandPropertyAppeared; | 67 BitArray<numCSSProperties> shorthandPropertyAppeared; |
| 68 | 68 |
| 69 unsigned size = m_propertySet.propertyCount(); | 69 unsigned size = m_propertySet.propertyCount(); |
| 70 |
| 71 // FIXME: need to support "unset". |
| 72 // 'all' property: http://dev.w3.org/csswg/css-cascade/#all-shorthand |
| 73 // 'unset" value: http://dev.w3.org/csswg/css-cascade/#unset |
| 74 if (size == allShorthand().length() && shorthandHasOnlyInitialOrInheritedVal
ue(allShorthand())) { |
| 75 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(
0); |
| 76 return getPropertyText(CSSPropertyAll, getCommonValue(allShorthand()), p
roperty.isImportant(), false); |
| 77 } |
| 78 |
| 70 unsigned numDecls = 0; | 79 unsigned numDecls = 0; |
| 71 for (unsigned n = 0; n < size; ++n) { | 80 for (unsigned n = 0; n < size; ++n) { |
| 72 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(
n); | 81 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(
n); |
| 73 CSSPropertyID propertyID = property.id(); | 82 CSSPropertyID propertyID = property.id(); |
| 74 // Only enabled or internal properties should be part of the style. | 83 // Only enabled or internal properties should be part of the style. |
| 75 ASSERT(RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID) || isInternal
Property(propertyID)); | 84 ASSERT(RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID) || isInternal
Property(propertyID)); |
| 76 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; | 85 CSSPropertyID shorthandPropertyID = CSSPropertyInvalid; |
| 77 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; | 86 CSSPropertyID borderFallbackShorthandProperty = CSSPropertyInvalid; |
| 78 String value; | 87 String value; |
| 79 | 88 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 isInitialValue = false; | 851 isInitialValue = false; |
| 843 if (!value->isInheritedValue()) | 852 if (!value->isInheritedValue()) |
| 844 isInheritedValue = false; | 853 isInheritedValue = false; |
| 845 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 854 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
| 846 return false; | 855 return false; |
| 847 } | 856 } |
| 848 return isInitialValue || isInheritedValue; | 857 return isInitialValue || isInheritedValue; |
| 849 } | 858 } |
| 850 | 859 |
| 851 } | 860 } |
| OLD | NEW |