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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 return renderer && renderer->isBox() && (!style || !style->paddingLeft()
.isFixed()); | 1520 return renderer && renderer->isBox() && (!style || !style->paddingLeft()
.isFixed()); |
1521 case CSSPropertyPaddingRight: | 1521 case CSSPropertyPaddingRight: |
1522 return renderer && renderer->isBox() && (!style || !style->paddingRight(
).isFixed()); | 1522 return renderer && renderer->isBox() && (!style || !style->paddingRight(
).isFixed()); |
1523 case CSSPropertyPaddingTop: | 1523 case CSSPropertyPaddingTop: |
1524 return renderer && renderer->isBox() && (!style || !style->paddingTop().
isFixed()); | 1524 return renderer && renderer->isBox() && (!style || !style->paddingTop().
isFixed()); |
1525 default: | 1525 default: |
1526 return false; | 1526 return false; |
1527 } | 1527 } |
1528 } | 1528 } |
1529 | 1529 |
1530 PassRefPtr<RenderStyle> CSSComputedStyleDeclaration::computeRenderStyle(CSSPrope
rtyID propertyID) const | 1530 PassRefPtr<RenderStyle> CSSComputedStyleDeclaration::computeRenderStyle() const |
1531 { | 1531 { |
1532 Node* styledNode = this->styledNode(); | 1532 Node* styledNode = this->styledNode(); |
1533 ASSERT(styledNode); | 1533 ASSERT(styledNode); |
1534 return styledNode->computedStyle(styledNode->isPseudoElement() ? NOPSEUDO :
m_pseudoElementSpecifier); | 1534 return styledNode->computedStyle(styledNode->isPseudoElement() ? NOPSEUDO :
m_pseudoElementSpecifier); |
1535 } | 1535 } |
1536 | 1536 |
1537 Node* CSSComputedStyleDeclaration::styledNode() const | 1537 Node* CSSComputedStyleDeclaration::styledNode() const |
1538 { | 1538 { |
1539 if (!m_node) | 1539 if (!m_node) |
1540 return 0; | 1540 return 0; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 // A timing update may be required if a compositor animation is running. | 1582 // A timing update may be required if a compositor animation is running. |
1583 DocumentAnimations::updateAnimationTimingForGetComputedStyle(*styledNode
, propertyID); | 1583 DocumentAnimations::updateAnimationTimingForGetComputedStyle(*styledNode
, propertyID); |
1584 | 1584 |
1585 document.updateRenderTreeForNodeIfNeeded(styledNode); | 1585 document.updateRenderTreeForNodeIfNeeded(styledNode); |
1586 | 1586 |
1587 // The style recalc could have caused the styled node to be discarded or
replaced | 1587 // The style recalc could have caused the styled node to be discarded or
replaced |
1588 // if it was a PseudoElement so we need to update it. | 1588 // if it was a PseudoElement so we need to update it. |
1589 styledNode = this->styledNode(); | 1589 styledNode = this->styledNode(); |
1590 renderer = styledNode->renderer(); | 1590 renderer = styledNode->renderer(); |
1591 | 1591 |
1592 style = computeRenderStyle(propertyID); | 1592 style = computeRenderStyle(); |
1593 | 1593 |
1594 bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) | 1594 bool forceFullLayout = isLayoutDependent(propertyID, style, renderer) |
1595 || styledNode->isInShadowTree() | 1595 || styledNode->isInShadowTree() |
1596 || (document.ownerElement() && document.ensureStyleResolver().hasVie
wportDependentMediaQueries()); | 1596 || (document.ownerElement() && document.ensureStyleResolver().hasVie
wportDependentMediaQueries()); |
1597 | 1597 |
1598 if (forceFullLayout) { | 1598 if (forceFullLayout) { |
1599 document.updateLayoutIgnorePendingStylesheets(); | 1599 document.updateLayoutIgnorePendingStylesheets(); |
1600 styledNode = this->styledNode(); | 1600 styledNode = this->styledNode(); |
1601 style = computeRenderStyle(propertyID); | 1601 style = computeRenderStyle(); |
1602 renderer = styledNode->renderer(); | 1602 renderer = styledNode->renderer(); |
1603 } | 1603 } |
1604 } else { | 1604 } else { |
1605 style = computeRenderStyle(propertyID); | 1605 style = computeRenderStyle(); |
1606 } | 1606 } |
1607 | 1607 |
1608 if (!style) | 1608 if (!style) |
1609 return nullptr; | 1609 return nullptr; |
1610 | 1610 |
1611 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); | 1611 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); |
1612 | 1612 |
1613 switch (propertyID) { | 1613 switch (propertyID) { |
1614 case CSSPropertyInvalid: | 1614 case CSSPropertyInvalid: |
1615 break; | 1615 break; |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3017 return list.release(); | 3017 return list.release(); |
3018 } | 3018 } |
3019 | 3019 |
3020 void CSSComputedStyleDeclaration::trace(Visitor* visitor) | 3020 void CSSComputedStyleDeclaration::trace(Visitor* visitor) |
3021 { | 3021 { |
3022 visitor->trace(m_node); | 3022 visitor->trace(m_node); |
3023 CSSStyleDeclaration::trace(visitor); | 3023 CSSStyleDeclaration::trace(visitor); |
3024 } | 3024 } |
3025 | 3025 |
3026 } // namespace blink | 3026 } // namespace blink |
OLD | NEW |