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 19 matching lines...) Expand all Loading... |
30 #include "core/css/CSSPrimitiveValueMappings.h" | 30 #include "core/css/CSSPrimitiveValueMappings.h" |
31 #include "core/css/CSSPropertyMetadata.h" | 31 #include "core/css/CSSPropertyMetadata.h" |
32 #include "core/css/CSSSelector.h" | 32 #include "core/css/CSSSelector.h" |
33 #include "core/css/CSSValuePool.h" | 33 #include "core/css/CSSValuePool.h" |
34 #include "core/css/RenderStyleCSSValueMapping.h" | 34 #include "core/css/RenderStyleCSSValueMapping.h" |
35 #include "core/css/parser/CSSParser.h" | 35 #include "core/css/parser/CSSParser.h" |
36 #include "core/css/resolver/StyleResolver.h" | 36 #include "core/css/resolver/StyleResolver.h" |
37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
38 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
39 #include "core/dom/PseudoElement.h" | 39 #include "core/dom/PseudoElement.h" |
40 #include "core/rendering/RenderObject.h" | 40 #include "core/layout/LayoutObject.h" |
41 #include "core/rendering/style/RenderStyle.h" | 41 #include "core/rendering/style/RenderStyle.h" |
42 #include "wtf/text/StringBuilder.h" | 42 #include "wtf/text/StringBuilder.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 // List of all properties we know how to compute, omitting shorthands. | 46 // List of all properties we know how to compute, omitting shorthands. |
47 // NOTE: Do not use this list, use computableProperties() instead | 47 // NOTE: Do not use this list, use computableProperties() instead |
48 // to respect runtime enabling of CSS properties. | 48 // to respect runtime enabling of CSS properties. |
49 static const CSSPropertyID staticComputableProperties[] = { | 49 static const CSSPropertyID staticComputableProperties[] = { |
50 CSSPropertyAnimationDelay, | 50 CSSPropertyAnimationDelay, |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 static void logUnimplementedPropertyID(CSSPropertyID propertyID) | 449 static void logUnimplementedPropertyID(CSSPropertyID propertyID) |
450 { | 450 { |
451 DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ()); | 451 DEFINE_STATIC_LOCAL(HashSet<CSSPropertyID>, propertyIDSet, ()); |
452 if (!propertyIDSet.add(propertyID).isNewEntry) | 452 if (!propertyIDSet.add(propertyID).isNewEntry) |
453 return; | 453 return; |
454 | 454 |
455 WTF_LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", ge
tPropertyName(propertyID)); | 455 WTF_LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", ge
tPropertyName(propertyID)); |
456 } | 456 } |
457 | 457 |
458 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle>
style, RenderObject* renderer) | 458 static bool isLayoutDependent(CSSPropertyID propertyID, PassRefPtr<RenderStyle>
style, LayoutObject* renderer) |
459 { | 459 { |
460 // Some properties only depend on layout in certain conditions which | 460 // Some properties only depend on layout in certain conditions which |
461 // are specified in the main switch statement below. So we can avoid | 461 // are specified in the main switch statement below. So we can avoid |
462 // forcing layout in those conditions. The conditions in this switch | 462 // forcing layout in those conditions. The conditions in this switch |
463 // statement must remain in sync with the conditions in the main switch. | 463 // statement must remain in sync with the conditions in the main switch. |
464 // FIXME: Some of these cases could be narrowed down or optimized better. | 464 // FIXME: Some of these cases could be narrowed down or optimized better. |
465 switch (propertyID) { | 465 switch (propertyID) { |
466 case CSSPropertyBottom: | 466 case CSSPropertyBottom: |
467 case CSSPropertyGridTemplateColumns: | 467 case CSSPropertyGridTemplateColumns: |
468 case CSSPropertyGridTemplateRows: | 468 case CSSPropertyGridTemplateRows: |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 return element; | 523 return element; |
524 } | 524 } |
525 return m_node.get(); | 525 return m_node.get(); |
526 } | 526 } |
527 | 527 |
528 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(CSSPropertyID propertyID, EUpdateLayout updateLayout) const | 528 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(CSSPropertyID propertyID, EUpdateLayout updateLayout) const |
529 { | 529 { |
530 Node* styledNode = this->styledNode(); | 530 Node* styledNode = this->styledNode(); |
531 if (!styledNode) | 531 if (!styledNode) |
532 return nullptr; | 532 return nullptr; |
533 RenderObject* renderer = styledNode->renderer(); | 533 LayoutObject* renderer = styledNode->renderer(); |
534 RefPtr<RenderStyle> style; | 534 RefPtr<RenderStyle> style; |
535 | 535 |
536 if (updateLayout) { | 536 if (updateLayout) { |
537 Document& document = styledNode->document(); | 537 Document& document = styledNode->document(); |
538 | 538 |
539 // A timing update may be required if a compositor animation is running. | 539 // A timing update may be required if a compositor animation is running. |
540 DocumentAnimations::updateAnimationTimingForGetComputedStyle(*styledNode
, propertyID); | 540 DocumentAnimations::updateAnimationTimingForGetComputedStyle(*styledNode
, propertyID); |
541 | 541 |
542 document.updateRenderTreeForNodeIfNeeded(styledNode); | 542 document.updateRenderTreeForNodeIfNeeded(styledNode); |
543 | 543 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); | 686 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); |
687 } | 687 } |
688 | 688 |
689 void CSSComputedStyleDeclaration::trace(Visitor* visitor) | 689 void CSSComputedStyleDeclaration::trace(Visitor* visitor) |
690 { | 690 { |
691 visitor->trace(m_node); | 691 visitor->trace(m_node); |
692 CSSStyleDeclaration::trace(visitor); | 692 CSSStyleDeclaration::trace(visitor); |
693 } | 693 } |
694 | 694 |
695 } // namespace blink | 695 } // namespace blink |
OLD | NEW |