| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) | 46 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) |
| 47 { | 47 { |
| 48 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*)
* count + sizeof(StylePropertyMetadata) * count; | 48 return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*)
* count + sizeof(StylePropertyMetadata) * count; |
| 49 } | 49 } |
| 50 | 50 |
| 51 PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CS
SProperty* properties, unsigned count, CSSParserMode cssParserMode) | 51 PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CS
SProperty* properties, unsigned count, CSSParserMode cssParserMode) |
| 52 { | 52 { |
| 53 ASSERT(count <= MaxArraySize); |
| 53 void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCou
nt(count)); | 54 void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCou
nt(count)); |
| 54 return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssP
arserMode)); | 55 return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssP
arserMode)); |
| 55 } | 56 } |
| 56 | 57 |
| 57 PassRefPtr<ImmutableStylePropertySet> StylePropertySet::immutableCopyIfNeeded()
const | 58 PassRefPtr<ImmutableStylePropertySet> StylePropertySet::immutableCopyIfNeeded()
const |
| 58 { | 59 { |
| 59 if (!isMutable()) | 60 if (!isMutable()) |
| 60 return static_cast<ImmutableStylePropertySet*>(const_cast<StylePropertyS
et*>(this)); | 61 return static_cast<ImmutableStylePropertySet*>(const_cast<StylePropertyS
et*>(this)); |
| 61 const MutableStylePropertySet* mutableThis = static_cast<const MutableStyleP
ropertySet*>(this); | 62 const MutableStylePropertySet* mutableThis = static_cast<const MutableStyleP
ropertySet*>(this); |
| 62 return ImmutableStylePropertySet::create(mutableThis->m_propertyVector.data(
), mutableThis->m_propertyVector.size(), cssParserMode()); | 63 return ImmutableStylePropertySet::create(mutableThis->m_propertyVector.data(
), mutableThis->m_propertyVector.size(), cssParserMode()); |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 result.appendLiteral(": "); | 652 result.appendLiteral(": "); |
| 652 result.append(propertyValue()->cssText()); | 653 result.append(propertyValue()->cssText()); |
| 653 if (isImportant()) | 654 if (isImportant()) |
| 654 result.appendLiteral(" !important"); | 655 result.appendLiteral(" !important"); |
| 655 result.append(';'); | 656 result.append(';'); |
| 656 return result.toString(); | 657 return result.toString(); |
| 657 } | 658 } |
| 658 | 659 |
| 659 | 660 |
| 660 } // namespace WebCore | 661 } // namespace WebCore |
| OLD | NEW |