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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 337 |
338 const ComputedStyle* style = | 338 const ComputedStyle* style = |
339 m_node->ensureComputedStyle(m_pseudoElementSpecifier); | 339 m_node->ensureComputedStyle(m_pseudoElementSpecifier); |
340 if (!style) | 340 if (!style) |
341 return false; | 341 return false; |
342 | 342 |
343 return style->getFontDescription().isMonospace(); | 343 return style->getFontDescription().isMonospace(); |
344 } | 344 } |
345 const ComputedStyle* CSSComputedStyleDeclaration::computeComputedStyle() const { | 345 const ComputedStyle* CSSComputedStyleDeclaration::computeComputedStyle() const { |
346 Node* styledNode = this->styledNode(); | 346 Node* styledNode = this->styledNode(); |
347 ASSERT(styledNode); | 347 DCHECK(styledNode); |
348 return styledNode->ensureComputedStyle( | 348 return styledNode->ensureComputedStyle( |
349 styledNode->isPseudoElement() ? PseudoIdNone : m_pseudoElementSpecifier); | 349 styledNode->isPseudoElement() ? PseudoIdNone : m_pseudoElementSpecifier); |
350 } | 350 } |
351 | 351 |
352 Node* CSSComputedStyleDeclaration::styledNode() const { | 352 Node* CSSComputedStyleDeclaration::styledNode() const { |
353 if (!m_node) | 353 if (!m_node) |
354 return nullptr; | 354 return nullptr; |
355 if (m_node->isElementNode()) { | 355 if (m_node->isElementNode()) { |
356 if (PseudoElement* element = | 356 if (PseudoElement* element = |
357 toElement(m_node)->pseudoElement(m_pseudoElementSpecifier)) | 357 toElement(m_node)->pseudoElement(m_pseudoElementSpecifier)) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 const String& propertyName) { | 491 const String& propertyName) { |
492 CSSPropertyID propertyID = cssPropertyID(propertyName); | 492 CSSPropertyID propertyID = cssPropertyID(propertyName); |
493 if (!propertyID) | 493 if (!propertyID) |
494 return String(); | 494 return String(); |
495 if (propertyID == CSSPropertyVariable) { | 495 if (propertyID == CSSPropertyVariable) { |
496 const CSSValue* value = getPropertyCSSValue(AtomicString(propertyName)); | 496 const CSSValue* value = getPropertyCSSValue(AtomicString(propertyName)); |
497 if (value) | 497 if (value) |
498 return value->cssText(); | 498 return value->cssText(); |
499 return String(); | 499 return String(); |
500 } | 500 } |
501 ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID)); | 501 DCHECK(CSSPropertyMetadata::isEnabledProperty(propertyID)); |
502 return getPropertyValue(propertyID); | 502 return getPropertyValue(propertyID); |
503 } | 503 } |
504 | 504 |
505 String CSSComputedStyleDeclaration::getPropertyPriority(const String&) { | 505 String CSSComputedStyleDeclaration::getPropertyPriority(const String&) { |
506 // All computed styles have a priority of not "important". | 506 // All computed styles have a priority of not "important". |
507 return ""; | 507 return ""; |
508 } | 508 } |
509 | 509 |
510 String CSSComputedStyleDeclaration::getPropertyShorthand(const String&) { | 510 String CSSComputedStyleDeclaration::getPropertyShorthand(const String&) { |
511 return ""; | 511 return ""; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 "These styles are computed, and therefore the '" + | 562 "These styles are computed, and therefore the '" + |
563 getPropertyNameString(id) + "' property is read-only."); | 563 getPropertyNameString(id) + "' property is read-only."); |
564 } | 564 } |
565 | 565 |
566 DEFINE_TRACE(CSSComputedStyleDeclaration) { | 566 DEFINE_TRACE(CSSComputedStyleDeclaration) { |
567 visitor->trace(m_node); | 567 visitor->trace(m_node); |
568 CSSStyleDeclaration::trace(visitor); | 568 CSSStyleDeclaration::trace(visitor); |
569 } | 569 } |
570 | 570 |
571 } // namespace blink | 571 } // namespace blink |
OLD | NEW |