| 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 12 matching lines...) Expand all Loading... |
| 23 #include "sky/engine/config.h" | 23 #include "sky/engine/config.h" |
| 24 #include "sky/engine/core/css/StylePropertySet.h" | 24 #include "sky/engine/core/css/StylePropertySet.h" |
| 25 | 25 |
| 26 #include "gen/sky/core/StylePropertyShorthand.h" | 26 #include "gen/sky/core/StylePropertyShorthand.h" |
| 27 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 27 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 28 #include "sky/engine/core/css/CSSPropertyMetadata.h" | 28 #include "sky/engine/core/css/CSSPropertyMetadata.h" |
| 29 #include "sky/engine/core/css/CSSValuePool.h" | 29 #include "sky/engine/core/css/CSSValuePool.h" |
| 30 #include "sky/engine/core/css/StylePropertySerializer.h" | 30 #include "sky/engine/core/css/StylePropertySerializer.h" |
| 31 #include "sky/engine/core/css/StyleSheetContents.h" | 31 #include "sky/engine/core/css/StyleSheetContents.h" |
| 32 #include "sky/engine/core/css/parser/BisonCSSParser.h" | 32 #include "sky/engine/core/css/parser/BisonCSSParser.h" |
| 33 #include "sky/engine/core/frame/UseCounter.h" | |
| 34 #include "sky/engine/wtf/text/StringBuilder.h" | 33 #include "sky/engine/wtf/text/StringBuilder.h" |
| 35 | 34 |
| 36 #ifndef NDEBUG | 35 #ifndef NDEBUG |
| 37 #include <stdio.h> | 36 #include <stdio.h> |
| 38 #include "sky/engine/wtf/text/CString.h" | 37 #include "sky/engine/wtf/text/CString.h" |
| 39 #endif | 38 #endif |
| 40 | 39 |
| 41 namespace blink { | 40 namespace blink { |
| 42 | 41 |
| 43 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) | 42 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, CSSPropertyI
D identifier) | 244 bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, CSSPropertyI
D identifier) |
| 246 { | 245 { |
| 247 setProperty(CSSProperty(propertyID, cssValuePool().createIdentifierValue(ide
ntifier))); | 246 setProperty(CSSProperty(propertyID, cssValuePool().createIdentifierValue(ide
ntifier))); |
| 248 return true; | 247 return true; |
| 249 } | 248 } |
| 250 | 249 |
| 251 void MutableStylePropertySet::parseDeclaration(const String& styleDeclaration, S
tyleSheetContents* contextStyleSheet) | 250 void MutableStylePropertySet::parseDeclaration(const String& styleDeclaration, S
tyleSheetContents* contextStyleSheet) |
| 252 { | 251 { |
| 253 m_propertyVector.clear(); | 252 m_propertyVector.clear(); |
| 254 | 253 |
| 255 CSSParserContext context(UseCounter::getFrom(contextStyleSheet)); | 254 CSSParserContext context; |
| 256 if (contextStyleSheet) { | 255 if (contextStyleSheet) |
| 257 context = contextStyleSheet->parserContext(); | 256 context = contextStyleSheet->parserContext(); |
| 258 } | |
| 259 | 257 |
| 260 BisonCSSParser parser(context); | 258 BisonCSSParser parser(context); |
| 261 parser.parseDeclaration(this, styleDeclaration, 0, contextStyleSheet); | 259 parser.parseDeclaration(this, styleDeclaration, 0, contextStyleSheet); |
| 262 } | 260 } |
| 263 | 261 |
| 264 void MutableStylePropertySet::addParsedProperties(const Vector<CSSProperty, 256>
& properties) | 262 void MutableStylePropertySet::addParsedProperties(const Vector<CSSProperty, 256>
& properties) |
| 265 { | 263 { |
| 266 m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size()
); | 264 m_propertyVector.reserveCapacity(m_propertyVector.size() + properties.size()
); |
| 267 for (unsigned i = 0; i < properties.size(); ++i) | 265 for (unsigned i = 0; i < properties.size(); ++i) |
| 268 addParsedProperty(properties[i]); | 266 addParsedProperty(properties[i]); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 StringBuilder result; | 475 StringBuilder result; |
| 478 result.append(cssName()); | 476 result.append(cssName()); |
| 479 result.appendLiteral(": "); | 477 result.appendLiteral(": "); |
| 480 result.append(propertyValue()->cssText()); | 478 result.append(propertyValue()->cssText()); |
| 481 result.append(';'); | 479 result.append(';'); |
| 482 return result.toString(); | 480 return result.toString(); |
| 483 } | 481 } |
| 484 | 482 |
| 485 | 483 |
| 486 } // namespace blink | 484 } // namespace blink |
| OLD | NEW |