OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 CSSPropertyStrokeOpacity, CSSPropertyStrokeWidth, | 170 CSSPropertyStrokeOpacity, CSSPropertyStrokeWidth, |
171 CSSPropertyAlignmentBaseline, CSSPropertyBaselineShift, | 171 CSSPropertyAlignmentBaseline, CSSPropertyBaselineShift, |
172 CSSPropertyDominantBaseline, CSSPropertyTextAnchor, CSSPropertyWritingMode, | 172 CSSPropertyDominantBaseline, CSSPropertyTextAnchor, CSSPropertyWritingMode, |
173 CSSPropertyVectorEffect, CSSPropertyPaintOrder, CSSPropertyD, CSSPropertyCx, | 173 CSSPropertyVectorEffect, CSSPropertyPaintOrder, CSSPropertyD, CSSPropertyCx, |
174 CSSPropertyCy, CSSPropertyX, CSSPropertyY, CSSPropertyR, CSSPropertyRx, | 174 CSSPropertyCy, CSSPropertyX, CSSPropertyY, CSSPropertyR, CSSPropertyRx, |
175 CSSPropertyRy, CSSPropertyScrollSnapType, CSSPropertyScrollSnapPointsX, | 175 CSSPropertyRy, CSSPropertyScrollSnapType, CSSPropertyScrollSnapPointsX, |
176 CSSPropertyScrollSnapPointsY, CSSPropertyScrollSnapCoordinate, | 176 CSSPropertyScrollSnapPointsY, CSSPropertyScrollSnapCoordinate, |
177 CSSPropertyScrollSnapDestination, CSSPropertyTranslate, CSSPropertyRotate, | 177 CSSPropertyScrollSnapDestination, CSSPropertyTranslate, CSSPropertyRotate, |
178 CSSPropertyScale, CSSPropertyCaretColor}; | 178 CSSPropertyScale, CSSPropertyCaretColor}; |
179 | 179 |
180 const Vector<CSSPropertyID>& computableProperties() { | |
181 DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, properties, ()); | |
182 if (properties.isEmpty()) { | |
183 CSSPropertyMetadata::filterEnabledCSSPropertiesIntoVector( | |
184 computedPropertyArray, WTF_ARRAY_LENGTH(computedPropertyArray), | |
185 properties); | |
186 } | |
187 return properties; | |
188 } | |
189 | |
190 CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) { | 180 CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) { |
191 DCHECK_NE(keywordSize, 0); | 181 DCHECK_NE(keywordSize, 0); |
192 DCHECK_LE(keywordSize, 8); | 182 DCHECK_LE(keywordSize, 8); |
193 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); | 183 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); |
194 } | 184 } |
195 | 185 |
196 inline CSSPrimitiveValue* zoomAdjustedPixelValue(double value, | 186 inline CSSPrimitiveValue* zoomAdjustedPixelValue(double value, |
197 const ComputedStyle& style) { | 187 const ComputedStyle& style) { |
198 return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), | 188 return CSSPrimitiveValue::create(adjustFloatForAbsoluteZoom(value, style), |
199 CSSPrimitiveValue::UnitType::Pixels); | 189 CSSPrimitiveValue::UnitType::Pixels); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 case CSSPropertyGridTemplate: | 260 case CSSPropertyGridTemplate: |
271 case CSSPropertyGrid: | 261 case CSSPropertyGrid: |
272 return layoutObject->isLayoutGrid(); | 262 return layoutObject->isLayoutGrid(); |
273 default: | 263 default: |
274 return false; | 264 return false; |
275 } | 265 } |
276 } | 266 } |
277 | 267 |
278 } // namespace | 268 } // namespace |
279 | 269 |
| 270 const Vector<CSSPropertyID>& |
| 271 CSSComputedStyleDeclaration::computableProperties() { |
| 272 DEFINE_STATIC_LOCAL(Vector<CSSPropertyID>, properties, ()); |
| 273 if (properties.isEmpty()) { |
| 274 CSSPropertyMetadata::filterEnabledCSSPropertiesIntoVector( |
| 275 computedPropertyArray, WTF_ARRAY_LENGTH(computedPropertyArray), |
| 276 properties); |
| 277 } |
| 278 return properties; |
| 279 } |
| 280 |
280 CSSComputedStyleDeclaration::CSSComputedStyleDeclaration( | 281 CSSComputedStyleDeclaration::CSSComputedStyleDeclaration( |
281 Node* n, | 282 Node* n, |
282 bool allowVisitedStyle, | 283 bool allowVisitedStyle, |
283 const String& pseudoElementName) | 284 const String& pseudoElementName) |
284 : m_node(n), | 285 : m_node(n), |
285 m_pseudoElementSpecifier(CSSSelector::parsePseudoId(pseudoElementName)), | 286 m_pseudoElementSpecifier(CSSSelector::parsePseudoId(pseudoElementName)), |
286 m_allowVisitedStyle(allowVisitedStyle) {} | 287 m_allowVisitedStyle(allowVisitedStyle) {} |
287 | 288 |
288 CSSComputedStyleDeclaration::~CSSComputedStyleDeclaration() {} | 289 CSSComputedStyleDeclaration::~CSSComputedStyleDeclaration() {} |
289 | 290 |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 "These styles are computed, and therefore the '" + | 563 "These styles are computed, and therefore the '" + |
563 getPropertyNameString(id) + "' property is read-only."); | 564 getPropertyNameString(id) + "' property is read-only."); |
564 } | 565 } |
565 | 566 |
566 DEFINE_TRACE(CSSComputedStyleDeclaration) { | 567 DEFINE_TRACE(CSSComputedStyleDeclaration) { |
567 visitor->trace(m_node); | 568 visitor->trace(m_node); |
568 CSSStyleDeclaration::trace(visitor); | 569 CSSStyleDeclaration::trace(visitor); |
569 } | 570 } |
570 | 571 |
571 } // namespace blink | 572 } // namespace blink |
OLD | NEW |