| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 CSSPropertyID propertyID = static_cast<CSSPropertyID>(index + firstCSSProper
ty); | 79 CSSPropertyID propertyID = static_cast<CSSPropertyID>(index + firstCSSProper
ty); |
| 80 ASSERT(firstCSSProperty <= propertyID && propertyID <= lastCSSProperty); | 80 ASSERT(firstCSSProperty <= propertyID && propertyID <= lastCSSProperty); |
| 81 if (m_longhandPropertyUsed.get(index)) { | 81 if (m_longhandPropertyUsed.get(index)) { |
| 82 int index = m_propertySet.findPropertyIndex(propertyID); | 82 int index = m_propertySet.findPropertyIndex(propertyID); |
| 83 ASSERT(index != -1); | 83 ASSERT(index != -1); |
| 84 return StylePropertySerializer::PropertyValueForSerializer(m_propertySet
.propertyAt(index)); | 84 return StylePropertySerializer::PropertyValueForSerializer(m_propertySet
.propertyAt(index)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(m_al
lIndex); | 87 StylePropertySet::PropertyReference property = m_propertySet.propertyAt(m_al
lIndex); |
| 88 const CSSValue* value = property.value(); | 88 return StylePropertySerializer::PropertyValueForSerializer(propertyID, prope
rty.value(), property.isImportant()); |
| 89 | |
| 90 // FIXME: Firefox shows properties with "unset" when some cssRule has | |
| 91 // expanded "all" with "unset". So we should use "unset" here. | |
| 92 // After implementing "unset" value correctly, (i.e. StyleBuilder should | |
| 93 // support "display: unset", "color: unset", ... and so on), | |
| 94 // we should fix the following code. | |
| 95 if (!value->isInitialValue() && !value->isInheritedValue()) { | |
| 96 if (CSSPropertyMetadata::isInheritedProperty(propertyID)) | |
| 97 value = cssValuePool().createInheritedValue().get(); | |
| 98 else | |
| 99 value = cssValuePool().createExplicitInitialValue().get(); | |
| 100 } | |
| 101 return StylePropertySerializer::PropertyValueForSerializer(propertyID, value
, property.isImportant()); | |
| 102 } | 89 } |
| 103 | 90 |
| 104 bool StylePropertySerializer::StylePropertySetForSerializer::shouldProcessProper
tyAt(unsigned index) const | 91 bool StylePropertySerializer::StylePropertySetForSerializer::shouldProcessProper
tyAt(unsigned index) const |
| 105 { | 92 { |
| 106 // StylePropertySet has all valid longhands. We should process. | 93 // StylePropertySet has all valid longhands. We should process. |
| 107 if (!hasAllProperty()) | 94 if (!hasAllProperty()) |
| 108 return true; | 95 return true; |
| 109 | 96 |
| 110 // If all is not expanded, we need to process "all" and properties which | 97 // If all is not expanded, we need to process "all" and properties which |
| 111 // are not overwritten by "all". | 98 // are not overwritten by "all". |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 isInitialValue = false; | 1003 isInitialValue = false; |
| 1017 if (!value->isInheritedValue()) | 1004 if (!value->isInheritedValue()) |
| 1018 isInheritedValue = false; | 1005 isInheritedValue = false; |
| 1019 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 1006 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
| 1020 return false; | 1007 return false; |
| 1021 } | 1008 } |
| 1022 return isInitialValue || isInheritedValue; | 1009 return isInitialValue || isInheritedValue; |
| 1023 } | 1010 } |
| 1024 | 1011 |
| 1025 } | 1012 } |
| OLD | NEW |