OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr
<CSSValue> value, bool important, bool implicit) | 162 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr
<CSSValue> value, bool important, bool implicit) |
163 { | 163 { |
164 // This property doesn't belong to a shorthand. | 164 // This property doesn't belong to a shorthand. |
165 if (!m_currentShorthand) { | 165 if (!m_currentShorthand) { |
166 m_parsedProperties.append(CSSProperty(propId, value, important, false, C
SSPropertyInvalid, m_implicitShorthand || implicit)); | 166 m_parsedProperties.append(CSSProperty(propId, value, important, false, C
SSPropertyInvalid, m_implicitShorthand || implicit)); |
167 return; | 167 return; |
168 } | 168 } |
169 | 169 |
170 Vector<StylePropertyShorthand, 4> shorthands; | 170 Vector<StylePropertyShorthand, 4> shorthands; |
171 getMatchingShorthandsForLonghand(propId, &shorthands); | 171 getMatchingShorthandsForLonghand(propId, &shorthands); |
| 172 |
| 173 // It's simpler if the shorthand system doesn't know about the width and |
| 174 // height shorthands for viewport descriptors |
| 175 ASSERT(!shorthands.isEmpty() || propId == CSSPropertyMinWidth || propId == C
SSPropertyMinHeight || propId == CSSPropertyMaxWidth || propId == CSSPropertyMax
Height); |
| 176 |
172 // The longhand does not belong to multiple shorthands. | 177 // The longhand does not belong to multiple shorthands. |
173 if (shorthands.size() == 1) | 178 if (shorthands.size() <= 1) |
174 m_parsedProperties.append(CSSProperty(propId, value, important, true, CS
SPropertyInvalid, m_implicitShorthand || implicit)); | 179 m_parsedProperties.append(CSSProperty(propId, value, important, true, CS
SPropertyInvalid, m_implicitShorthand || implicit)); |
175 else | 180 else |
176 m_parsedProperties.append(CSSProperty(propId, value, important, true, in
dexOfShorthandForLonghand(m_currentShorthand, shorthands), m_implicitShorthand |
| implicit)); | 181 m_parsedProperties.append(CSSProperty(propId, value, important, true, in
dexOfShorthandForLonghand(m_currentShorthand, shorthands), m_implicitShorthand |
| implicit)); |
177 } | 182 } |
178 | 183 |
179 void CSSPropertyParser::rollbackLastProperties(int num) | 184 void CSSPropertyParser::rollbackLastProperties(int num) |
180 { | 185 { |
181 ASSERT(num >= 0); | 186 ASSERT(num >= 0); |
182 ASSERT(m_parsedProperties.size() >= static_cast<unsigned>(num)); | 187 ASSERT(m_parsedProperties.size() >= static_cast<unsigned>(num)); |
183 m_parsedProperties.shrink(m_parsedProperties.size() - num); | 188 m_parsedProperties.shrink(m_parsedProperties.size() - num); |
(...skipping 8330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8514 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 8519 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); |
8515 if (!seenStroke) | 8520 if (!seenStroke) |
8516 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 8521 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); |
8517 if (!seenMarkers) | 8522 if (!seenMarkers) |
8518 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 8523 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); |
8519 | 8524 |
8520 return parsedValues.release(); | 8525 return parsedValues.release(); |
8521 } | 8526 } |
8522 | 8527 |
8523 } // namespace WebCore | 8528 } // namespace WebCore |
OLD | NEW |