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.
All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 ASSERT_ARG(keywordSize, keywordSize); | 947 ASSERT_ARG(keywordSize, keywordSize); |
948 ASSERT_ARG(keywordSize, keywordSize <= 8); | 948 ASSERT_ARG(keywordSize, keywordSize <= 8); |
949 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); | 949 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); |
950 } | 950 } |
951 | 951 |
952 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
eyword() const | 952 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringK
eyword() const |
953 { | 953 { |
954 if (!m_node) | 954 if (!m_node) |
955 return nullptr; | 955 return nullptr; |
956 | 956 |
957 m_node->document().updateLayoutIgnorePendingStylesheets(); | 957 m_node->document().updateLayout(); |
958 | 958 |
959 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); | 959 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); |
960 if (!style) | 960 if (!style) |
961 return nullptr; | 961 return nullptr; |
962 | 962 |
963 if (int keywordSize = style->fontDescription().keywordSize()) | 963 if (int keywordSize = style->fontDescription().keywordSize()) |
964 return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyw
ord(keywordSize)); | 964 return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyw
ord(keywordSize)); |
965 | 965 |
966 | 966 |
967 return pixelValue(style->fontDescription().computedPixelSize(), *style); | 967 return pixelValue(style->fontDescription().computedPixelSize(), *style); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 Document& document = m_node->document(); | 1268 Document& document = m_node->document(); |
1269 | 1269 |
1270 document.updateRenderTreeForNodeIfNeeded(m_node.get()); | 1270 document.updateRenderTreeForNodeIfNeeded(m_node.get()); |
1271 renderer = m_node->renderer(); | 1271 renderer = m_node->renderer(); |
1272 | 1272 |
1273 style = computeRenderStyle(propertyID); | 1273 style = computeRenderStyle(propertyID); |
1274 | 1274 |
1275 bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) ||
m_node->isInShadowTree(); | 1275 bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) ||
m_node->isInShadowTree(); |
1276 | 1276 |
1277 if (forceFullLayout) { | 1277 if (forceFullLayout) { |
1278 document.updateLayoutIgnorePendingStylesheets(); | 1278 document.updateLayout(); |
1279 style = computeRenderStyle(propertyID); | 1279 style = computeRenderStyle(propertyID); |
1280 renderer = m_node->renderer(); | 1280 renderer = m_node->renderer(); |
1281 } | 1281 } |
1282 } else { | 1282 } else { |
1283 style = computeRenderStyle(propertyID); | 1283 style = computeRenderStyle(propertyID); |
1284 } | 1284 } |
1285 | 1285 |
1286 if (!style) | 1286 if (!style) |
1287 return nullptr; | 1287 return nullptr; |
1288 | 1288 |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 { | 2252 { |
2253 if (i >= length()) | 2253 if (i >= length()) |
2254 return ""; | 2254 return ""; |
2255 | 2255 |
2256 return getPropertyNameString(computableProperties()[i]); | 2256 return getPropertyNameString(computableProperties()[i]); |
2257 } | 2257 } |
2258 | 2258 |
2259 bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, c
onst CSSValue* propertyValue) const | 2259 bool CSSComputedStyleDeclaration::cssPropertyMatches(CSSPropertyID propertyID, c
onst CSSValue* propertyValue) const |
2260 { | 2260 { |
2261 if (propertyID == CSSPropertyFontSize && propertyValue->isPrimitiveValue() &
& m_node) { | 2261 if (propertyID == CSSPropertyFontSize && propertyValue->isPrimitiveValue() &
& m_node) { |
2262 m_node->document().updateLayoutIgnorePendingStylesheets(); | 2262 m_node->document().updateLayout(); |
2263 RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier); | 2263 RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier); |
2264 if (style && style->fontDescription().keywordSize()) { | 2264 if (style && style->fontDescription().keywordSize()) { |
2265 CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDe
scription().keywordSize()); | 2265 CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDe
scription().keywordSize()); |
2266 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(proper
tyValue); | 2266 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(proper
tyValue); |
2267 if (primitiveValue->isValueID() && primitiveValue->getValueID() == s
izeValue) | 2267 if (primitiveValue->isValueID() && primitiveValue->getValueID() == s
izeValue) |
2268 return true; | 2268 return true; |
2269 } | 2269 } |
2270 } | 2270 } |
2271 RefPtr<CSSValue> value = getPropertyCSSValue(propertyID); | 2271 RefPtr<CSSValue> value = getPropertyCSSValue(propertyID); |
2272 return value && propertyValue && value->equals(*propertyValue); | 2272 return value && propertyValue && value->equals(*propertyValue); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2395 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 2395 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
2396 CSSPropertyB
ackgroundClip }; | 2396 CSSPropertyB
ackgroundClip }; |
2397 | 2397 |
2398 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 2398 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
2399 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 2399 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
2400 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 2400 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
2401 return list.release(); | 2401 return list.release(); |
2402 } | 2402 } |
2403 | 2403 |
2404 } // namespace blink | 2404 } // namespace blink |
OLD | NEW |