| 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, 2013 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool StylePropertySet::isPropertyImplicit(CSSPropertyID propertyID) const | 254 bool StylePropertySet::isPropertyImplicit(CSSPropertyID propertyID) const |
| 255 { | 255 { |
| 256 int foundPropertyIndex = findPropertyIndex(propertyID); | 256 int foundPropertyIndex = findPropertyIndex(propertyID); |
| 257 if (foundPropertyIndex == -1) | 257 if (foundPropertyIndex == -1) |
| 258 return false; | 258 return false; |
| 259 return propertyAt(foundPropertyIndex).isImplicit(); | 259 return propertyAt(foundPropertyIndex).isImplicit(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, const String
& value, bool important, StyleSheetContents* contextStyleSheet) | 262 bool MutableStylePropertySet::setProperty(CSSPropertyID unresolvedProperty, cons
t String& value, bool important, StyleSheetContents* contextStyleSheet) |
| 263 { | 263 { |
| 264 // Setting the value to an empty string just removes the property in both IE
and Gecko. | 264 // Setting the value to an empty string just removes the property in both IE
and Gecko. |
| 265 // Setting it to null seems to produce less consistent results, but we treat
it just the same. | 265 // Setting it to null seems to produce less consistent results, but we treat
it just the same. |
| 266 if (value.isEmpty()) | 266 if (value.isEmpty()) |
| 267 return removeProperty(propertyID); | 267 return removeProperty(resolveCSSPropertyID(unresolvedProperty)); |
| 268 | 268 |
| 269 // When replacing an existing property value, this moves the property to the
end of the list. | 269 // When replacing an existing property value, this moves the property to the
end of the list. |
| 270 // Firefox preserves the position, and MSIE moves the property to the beginn
ing. | 270 // Firefox preserves the position, and MSIE moves the property to the beginn
ing. |
| 271 return CSSParser::parseValue(this, propertyID, value, important, cssParserMo
de(), contextStyleSheet); | 271 return CSSParser::parseValue(this, unresolvedProperty, value, important, css
ParserMode(), contextStyleSheet); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, PassRefPtrWi
llBeRawPtr<CSSValue> prpValue, bool important) | 274 void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, PassRefPtrWi
llBeRawPtr<CSSValue> prpValue, bool important) |
| 275 { | 275 { |
| 276 StylePropertyShorthand shorthand = shorthandForProperty(propertyID); | 276 StylePropertyShorthand shorthand = shorthandForProperty(propertyID); |
| 277 if (!shorthand.length()) { | 277 if (!shorthand.length()) { |
| 278 setProperty(CSSProperty(propertyID, prpValue, important)); | 278 setProperty(CSSProperty(propertyID, prpValue, important)); |
| 279 return; | 279 return; |
| 280 } | 280 } |
| 281 | 281 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 result.appendLiteral(": "); | 607 result.appendLiteral(": "); |
| 608 result.append(propertyValue()->cssText()); | 608 result.append(propertyValue()->cssText()); |
| 609 if (isImportant()) | 609 if (isImportant()) |
| 610 result.appendLiteral(" !important"); | 610 result.appendLiteral(" !important"); |
| 611 result.append(';'); | 611 result.append(';'); |
| 612 return result.toString(); | 612 return result.toString(); |
| 613 } | 613 } |
| 614 | 614 |
| 615 | 615 |
| 616 } // namespace blink | 616 } // namespace blink |
| OLD | NEW |