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.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
| 4 * All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * | 8 * |
8 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
11 * version 2 of the License, or (at your option) any later version. | 12 * version 2 of the License, or (at your option) any later version. |
12 * | 13 * |
13 * This library is distributed in the hope that it will be useful, | 14 * This library is distributed in the hope that it will be useful, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // NOTE: Do not use this list, use computableProperties() instead | 49 // NOTE: Do not use this list, use computableProperties() instead |
49 // to respect runtime enabling of CSS properties. | 50 // to respect runtime enabling of CSS properties. |
50 static const CSSPropertyID staticComputableProperties[] = { | 51 static const CSSPropertyID staticComputableProperties[] = { |
51 CSSPropertyAnimationDelay, CSSPropertyAnimationDirection, | 52 CSSPropertyAnimationDelay, CSSPropertyAnimationDirection, |
52 CSSPropertyAnimationDuration, CSSPropertyAnimationFillMode, | 53 CSSPropertyAnimationDuration, CSSPropertyAnimationFillMode, |
53 CSSPropertyAnimationIterationCount, CSSPropertyAnimationName, | 54 CSSPropertyAnimationIterationCount, CSSPropertyAnimationName, |
54 CSSPropertyAnimationPlayState, CSSPropertyAnimationTimingFunction, | 55 CSSPropertyAnimationPlayState, CSSPropertyAnimationTimingFunction, |
55 CSSPropertyBackgroundAttachment, CSSPropertyBackgroundBlendMode, | 56 CSSPropertyBackgroundAttachment, CSSPropertyBackgroundBlendMode, |
56 CSSPropertyBackgroundClip, CSSPropertyBackgroundColor, | 57 CSSPropertyBackgroundClip, CSSPropertyBackgroundColor, |
57 CSSPropertyBackgroundImage, CSSPropertyBackgroundOrigin, | 58 CSSPropertyBackgroundImage, CSSPropertyBackgroundOrigin, |
58 CSSPropertyBackgroundPosition, // more-specific background-position-x/y are
non-standard | 59 // more-specific background-position-x/y are non-standard |
59 CSSPropertyBackgroundRepeat, CSSPropertyBackgroundSize, | 60 CSSPropertyBackgroundPosition, CSSPropertyBackgroundRepeat, |
60 CSSPropertyBorderBottomColor, CSSPropertyBorderBottomLeftRadius, | 61 CSSPropertyBackgroundSize, CSSPropertyBorderBottomColor, |
61 CSSPropertyBorderBottomRightRadius, CSSPropertyBorderBottomStyle, | 62 CSSPropertyBorderBottomLeftRadius, CSSPropertyBorderBottomRightRadius, |
62 CSSPropertyBorderBottomWidth, CSSPropertyBorderCollapse, | 63 CSSPropertyBorderBottomStyle, CSSPropertyBorderBottomWidth, |
63 CSSPropertyBorderImageOutset, CSSPropertyBorderImageRepeat, | 64 CSSPropertyBorderCollapse, CSSPropertyBorderImageOutset, |
64 CSSPropertyBorderImageSlice, CSSPropertyBorderImageSource, | 65 CSSPropertyBorderImageRepeat, CSSPropertyBorderImageSlice, |
65 CSSPropertyBorderImageWidth, CSSPropertyBorderLeftColor, | 66 CSSPropertyBorderImageSource, CSSPropertyBorderImageWidth, |
66 CSSPropertyBorderLeftStyle, CSSPropertyBorderLeftWidth, | 67 CSSPropertyBorderLeftColor, CSSPropertyBorderLeftStyle, |
67 CSSPropertyBorderRightColor, CSSPropertyBorderRightStyle, | 68 CSSPropertyBorderLeftWidth, CSSPropertyBorderRightColor, |
68 CSSPropertyBorderRightWidth, CSSPropertyBorderTopColor, | 69 CSSPropertyBorderRightStyle, CSSPropertyBorderRightWidth, |
69 CSSPropertyBorderTopLeftRadius, CSSPropertyBorderTopRightRadius, | 70 CSSPropertyBorderTopColor, CSSPropertyBorderTopLeftRadius, |
70 CSSPropertyBorderTopStyle, CSSPropertyBorderTopWidth, CSSPropertyBottom, | 71 CSSPropertyBorderTopRightRadius, CSSPropertyBorderTopStyle, |
71 CSSPropertyBoxShadow, CSSPropertyBoxSizing, CSSPropertyBreakAfter, | 72 CSSPropertyBorderTopWidth, CSSPropertyBottom, CSSPropertyBoxShadow, |
72 CSSPropertyBreakBefore, CSSPropertyBreakInside, CSSPropertyCaptionSide, | 73 CSSPropertyBoxSizing, CSSPropertyBreakAfter, CSSPropertyBreakBefore, |
73 CSSPropertyClear, CSSPropertyClip, CSSPropertyColor, CSSPropertyContent, | 74 CSSPropertyBreakInside, CSSPropertyCaptionSide, CSSPropertyClear, |
74 CSSPropertyCursor, CSSPropertyDirection, CSSPropertyDisplay, | 75 CSSPropertyClip, CSSPropertyColor, CSSPropertyContent, CSSPropertyCursor, |
75 CSSPropertyEmptyCells, CSSPropertyFloat, CSSPropertyFontFamily, | 76 CSSPropertyDirection, CSSPropertyDisplay, CSSPropertyEmptyCells, |
76 CSSPropertyFontKerning, CSSPropertyFontSize, CSSPropertyFontSizeAdjust, | 77 CSSPropertyFloat, CSSPropertyFontFamily, CSSPropertyFontKerning, |
77 CSSPropertyFontStretch, CSSPropertyFontStyle, CSSPropertyFontVariant, | 78 CSSPropertyFontSize, CSSPropertyFontSizeAdjust, CSSPropertyFontStretch, |
| 79 CSSPropertyFontStyle, CSSPropertyFontVariant, |
78 CSSPropertyFontVariantLigatures, CSSPropertyFontVariantCaps, | 80 CSSPropertyFontVariantLigatures, CSSPropertyFontVariantCaps, |
79 CSSPropertyFontVariantNumeric, CSSPropertyFontWeight, CSSPropertyHeight, | 81 CSSPropertyFontVariantNumeric, CSSPropertyFontWeight, CSSPropertyHeight, |
80 CSSPropertyImageOrientation, CSSPropertyImageRendering, | 82 CSSPropertyImageOrientation, CSSPropertyImageRendering, |
81 CSSPropertyIsolation, CSSPropertyJustifyItems, CSSPropertyJustifySelf, | 83 CSSPropertyIsolation, CSSPropertyJustifyItems, CSSPropertyJustifySelf, |
82 CSSPropertyLeft, CSSPropertyLetterSpacing, CSSPropertyLineHeight, | 84 CSSPropertyLeft, CSSPropertyLetterSpacing, CSSPropertyLineHeight, |
83 CSSPropertyListStyleImage, CSSPropertyListStylePosition, | 85 CSSPropertyListStyleImage, CSSPropertyListStylePosition, |
84 CSSPropertyListStyleType, CSSPropertyMarginBottom, CSSPropertyMarginLeft, | 86 CSSPropertyListStyleType, CSSPropertyMarginBottom, CSSPropertyMarginLeft, |
85 CSSPropertyMarginRight, CSSPropertyMarginTop, CSSPropertyMaxHeight, | 87 CSSPropertyMarginRight, CSSPropertyMarginTop, CSSPropertyMaxHeight, |
86 CSSPropertyMaxWidth, CSSPropertyMinHeight, CSSPropertyMinWidth, | 88 CSSPropertyMaxWidth, CSSPropertyMinHeight, CSSPropertyMinWidth, |
87 CSSPropertyMixBlendMode, CSSPropertyObjectFit, CSSPropertyObjectPosition, | 89 CSSPropertyMixBlendMode, CSSPropertyObjectFit, CSSPropertyObjectPosition, |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 381 |
380 const CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue( | 382 const CSSValue* CSSComputedStyleDeclaration::getPropertyCSSValue( |
381 CSSPropertyID propertyID) const { | 383 CSSPropertyID propertyID) const { |
382 Node* styledNode = this->styledNode(); | 384 Node* styledNode = this->styledNode(); |
383 if (!styledNode) | 385 if (!styledNode) |
384 return nullptr; | 386 return nullptr; |
385 | 387 |
386 Document& document = styledNode->document(); | 388 Document& document = styledNode->document(); |
387 document.updateStyleAndLayoutTreeForNode(styledNode); | 389 document.updateStyleAndLayoutTreeForNode(styledNode); |
388 | 390 |
389 // The style recalc could have caused the styled node to be discarded or repla
ced | 391 // The style recalc could have caused the styled node to be discarded or |
390 // if it was a PseudoElement so we need to update it. | 392 // replaced if it was a PseudoElement so we need to update it. |
391 styledNode = this->styledNode(); | 393 styledNode = this->styledNode(); |
392 LayoutObject* layoutObject = styledNode->layoutObject(); | 394 LayoutObject* layoutObject = styledNode->layoutObject(); |
393 | 395 |
394 const ComputedStyle* style = computeComputedStyle(); | 396 const ComputedStyle* style = computeComputedStyle(); |
395 | 397 |
396 bool forceFullLayout = | 398 bool forceFullLayout = |
397 isLayoutDependent(propertyID, style, layoutObject) || | 399 isLayoutDependent(propertyID, style, layoutObject) || |
398 styledNode->isInShadowTree() || | 400 styledNode->isInShadowTree() || |
399 (document.localOwner() && | 401 (document.localOwner() && |
400 document.ensureStyleResolver().hasViewportDependentMediaQueries()); | 402 document.ensureStyleResolver().hasViewportDependentMediaQueries()); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 "These styles are computed, and therefore the '" + | 558 "These styles are computed, and therefore the '" + |
557 getPropertyNameString(id) + "' property is read-only."); | 559 getPropertyNameString(id) + "' property is read-only."); |
558 } | 560 } |
559 | 561 |
560 DEFINE_TRACE(CSSComputedStyleDeclaration) { | 562 DEFINE_TRACE(CSSComputedStyleDeclaration) { |
561 visitor->trace(m_node); | 563 visitor->trace(m_node); |
562 CSSStyleDeclaration::trace(visitor); | 564 CSSStyleDeclaration::trace(visitor); |
563 } | 565 } |
564 | 566 |
565 } // namespace blink | 567 } // namespace blink |
OLD | NEW |