| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 return element; | 532 return element; |
| 533 } | 533 } |
| 534 return m_node.get(); | 534 return m_node.get(); |
| 535 } | 535 } |
| 536 | 536 |
| 537 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(CSSPropertyID propertyID) const | 537 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(CSSPropertyID propertyID) const |
| 538 { | 538 { |
| 539 Node* styledNode = this->styledNode(); | 539 Node* styledNode = this->styledNode(); |
| 540 if (!styledNode) | 540 if (!styledNode) |
| 541 return nullptr; | 541 return nullptr; |
| 542 LayoutObject* renderer = styledNode->renderer(); | 542 LayoutObject* renderer = styledNode->layoutObject(); |
| 543 RefPtr<LayoutStyle> style; | 543 RefPtr<LayoutStyle> style; |
| 544 | 544 |
| 545 Document& document = styledNode->document(); | 545 Document& document = styledNode->document(); |
| 546 | 546 |
| 547 // A timing update may be required if a compositor animation is running. | 547 // A timing update may be required if a compositor animation is running. |
| 548 DocumentAnimations::updateAnimationTimingForGetComputedStyle(*styledNode, pr
opertyID); | 548 DocumentAnimations::updateAnimationTimingForGetComputedStyle(*styledNode, pr
opertyID); |
| 549 | 549 |
| 550 document.updateRenderTreeForNodeIfNeeded(styledNode); | 550 document.updateRenderTreeForNodeIfNeeded(styledNode); |
| 551 | 551 |
| 552 // The style recalc could have caused the styled node to be discarded or rep
laced | 552 // The style recalc could have caused the styled node to be discarded or rep
laced |
| 553 // if it was a PseudoElement so we need to update it. | 553 // if it was a PseudoElement so we need to update it. |
| 554 styledNode = this->styledNode(); | 554 styledNode = this->styledNode(); |
| 555 renderer = styledNode->renderer(); | 555 renderer = styledNode->layoutObject(); |
| 556 | 556 |
| 557 style = computeLayoutStyle(); | 557 style = computeLayoutStyle(); |
| 558 | 558 |
| 559 bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) | 559 bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) |
| 560 || styledNode->isInShadowTree() | 560 || styledNode->isInShadowTree() |
| 561 || (document.ownerElement() && document.ensureStyleResolver().hasViewpor
tDependentMediaQueries()); | 561 || (document.ownerElement() && document.ensureStyleResolver().hasViewpor
tDependentMediaQueries()); |
| 562 | 562 |
| 563 if (forceFullLayout) { | 563 if (forceFullLayout) { |
| 564 document.updateLayoutIgnorePendingStylesheets(); | 564 document.updateLayoutIgnorePendingStylesheets(); |
| 565 styledNode = this->styledNode(); | 565 styledNode = this->styledNode(); |
| 566 style = computeLayoutStyle(); | 566 style = computeLayoutStyle(); |
| 567 renderer = styledNode->renderer(); | 567 renderer = styledNode->layoutObject(); |
| 568 } | 568 } |
| 569 | 569 |
| 570 if (!style) | 570 if (!style) |
| 571 return nullptr; | 571 return nullptr; |
| 572 | 572 |
| 573 RefPtrWillBeRawPtr<CSSValue> value = LayoutStyleCSSValueMapping::get(propert
yID, *style, renderer, styledNode, m_allowVisitedStyle); | 573 RefPtrWillBeRawPtr<CSSValue> value = LayoutStyleCSSValueMapping::get(propert
yID, *style, renderer, styledNode, m_allowVisitedStyle); |
| 574 if (value) | 574 if (value) |
| 575 return value; | 575 return value; |
| 576 | 576 |
| 577 logUnimplementedPropertyID(propertyID); | 577 logUnimplementedPropertyID(propertyID); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); | 691 exceptionState.throwDOMException(NoModificationAllowedError, "These styles a
re computed, and therefore the '" + getPropertyNameString(id) + "' property is r
ead-only."); |
| 692 } | 692 } |
| 693 | 693 |
| 694 DEFINE_TRACE(CSSComputedStyleDeclaration) | 694 DEFINE_TRACE(CSSComputedStyleDeclaration) |
| 695 { | 695 { |
| 696 visitor->trace(m_node); | 696 visitor->trace(m_node); |
| 697 CSSStyleDeclaration::trace(visitor); | 697 CSSStyleDeclaration::trace(visitor); |
| 698 } | 698 } |
| 699 | 699 |
| 700 } // namespace blink | 700 } // namespace blink |
| OLD | NEW |