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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 { | 132 { |
133 if (other.isMutable()) { | 133 if (other.isMutable()) { |
134 m_propertyVector = toMutableStylePropertySet(other).m_propertyVector; | 134 m_propertyVector = toMutableStylePropertySet(other).m_propertyVector; |
135 } else { | 135 } else { |
136 m_propertyVector.reserveInitialCapacity(other.propertyCount()); | 136 m_propertyVector.reserveInitialCapacity(other.propertyCount()); |
137 for (unsigned i = 0; i < other.propertyCount(); ++i) | 137 for (unsigned i = 0; i < other.propertyCount(); ++i) |
138 m_propertyVector.uncheckedAppend(other.propertyAt(i).toCSSProperty()
); | 138 m_propertyVector.uncheckedAppend(other.propertyAt(i).toCSSProperty()
); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 String StylePropertySet::getPropertyValue(CSSPropertyID propertyID) const | 142 String StylePropertySet::getPropertyValue(CSSPropertyID unresolvedProperty) cons
t |
143 { | 143 { |
| 144 CSSPropertyID propertyID = resolveCSSPropertyID(unresolvedProperty); |
144 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); | 145 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); |
145 if (value) | 146 if (value) |
146 return value->cssText(); | 147 return value->cssText(); |
147 | 148 |
148 return StylePropertySerializer(*this).getPropertyValue(propertyID); | 149 return StylePropertySerializer(*this).getPropertyValue(propertyID); |
149 } | 150 } |
150 | 151 |
151 PassRefPtrWillBeRawPtr<CSSValue> StylePropertySet::getPropertyCSSValue(CSSProper
tyID propertyID) const | 152 PassRefPtrWillBeRawPtr<CSSValue> StylePropertySet::getPropertyCSSValue(CSSProper
tyID unresolvedProperty) const |
152 { | 153 { |
| 154 CSSPropertyID propertyID = resolveCSSPropertyID(unresolvedProperty); |
153 int foundPropertyIndex = findPropertyIndex(propertyID); | 155 int foundPropertyIndex = findPropertyIndex(propertyID); |
154 if (foundPropertyIndex == -1) | 156 if (foundPropertyIndex == -1) |
155 return nullptr; | 157 return nullptr; |
156 return propertyAt(foundPropertyIndex).value(); | 158 return propertyAt(foundPropertyIndex).value(); |
157 } | 159 } |
158 | 160 |
159 DEFINE_TRACE(StylePropertySet) | 161 DEFINE_TRACE(StylePropertySet) |
160 { | 162 { |
161 if (m_isMutable) | 163 if (m_isMutable) |
162 toMutableStylePropertySet(this)->traceAfterDispatch(visitor); | 164 toMutableStylePropertySet(this)->traceAfterDispatch(visitor); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 for (unsigned i = 0; i < size; ++i) { | 346 for (unsigned i = 0; i < size; ++i) { |
345 if (propertyAt(i).value()->hasFailedOrCanceledSubresources()) | 347 if (propertyAt(i).value()->hasFailedOrCanceledSubresources()) |
346 return true; | 348 return true; |
347 } | 349 } |
348 return false; | 350 return false; |
349 } | 351 } |
350 | 352 |
351 // This is the list of properties we want to copy in the copyBlockProperties() f
unction. | 353 // This is the list of properties we want to copy in the copyBlockProperties() f
unction. |
352 // It is the list of CSS properties that apply specially to block-level elements
. | 354 // It is the list of CSS properties that apply specially to block-level elements
. |
353 static const CSSPropertyID staticBlockProperties[] = { | 355 static const CSSPropertyID staticBlockProperties[] = { |
| 356 CSSPropertyColumnCount, |
| 357 CSSPropertyColumnGap, |
| 358 CSSPropertyColumnRuleColor, |
| 359 CSSPropertyColumnRuleStyle, |
| 360 CSSPropertyColumnRuleWidth, |
| 361 CSSPropertyColumnWidth, |
354 CSSPropertyOrphans, | 362 CSSPropertyOrphans, |
355 CSSPropertyOverflow, // This can be also be applied to replaced elements | 363 CSSPropertyOverflow, // This can be also be applied to replaced elements |
356 CSSPropertyWebkitColumnCount, | |
357 CSSPropertyWebkitColumnGap, | |
358 CSSPropertyWebkitColumnRuleColor, | |
359 CSSPropertyWebkitColumnRuleStyle, | |
360 CSSPropertyWebkitColumnRuleWidth, | |
361 CSSPropertyWebkitColumnBreakBefore, | 364 CSSPropertyWebkitColumnBreakBefore, |
362 CSSPropertyWebkitColumnBreakAfter, | 365 CSSPropertyWebkitColumnBreakAfter, |
363 CSSPropertyWebkitColumnBreakInside, | 366 CSSPropertyWebkitColumnBreakInside, |
364 CSSPropertyWebkitColumnWidth, | |
365 CSSPropertyPageBreakAfter, | 367 CSSPropertyPageBreakAfter, |
366 CSSPropertyPageBreakBefore, | 368 CSSPropertyPageBreakBefore, |
367 CSSPropertyPageBreakInside, | 369 CSSPropertyPageBreakInside, |
368 CSSPropertyTextAlign, | 370 CSSPropertyTextAlign, |
369 CSSPropertyTextAlignLast, | 371 CSSPropertyTextAlignLast, |
370 CSSPropertyTextIndent, | 372 CSSPropertyTextIndent, |
371 CSSPropertyTextJustify, | 373 CSSPropertyTextJustify, |
372 CSSPropertyWidows | 374 CSSPropertyWidows |
373 }; | 375 }; |
374 | 376 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 { | 551 { |
550 return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode)); | 552 return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode)); |
551 } | 553 } |
552 | 554 |
553 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create(
const CSSProperty* properties, unsigned count) | 555 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create(
const CSSProperty* properties, unsigned count) |
554 { | 556 { |
555 return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count)); | 557 return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count)); |
556 } | 558 } |
557 | 559 |
558 } // namespace blink | 560 } // namespace blink |
OLD | NEW |