OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 } | 1555 } |
1556 | 1556 |
1557 void Element::attachLayoutTree(const AttachContext& context) | 1557 void Element::attachLayoutTree(const AttachContext& context) |
1558 { | 1558 { |
1559 DCHECK(document().inStyleRecalc()); | 1559 DCHECK(document().inStyleRecalc()); |
1560 | 1560 |
1561 // We've already been through detach when doing an attach, but we might | 1561 // We've already been through detach when doing an attach, but we might |
1562 // need to clear any state that's been added since then. | 1562 // need to clear any state that's been added since then. |
1563 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { | 1563 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { |
1564 ElementRareData* data = elementRareData(); | 1564 ElementRareData* data = elementRareData(); |
1565 data->clearComputedStyleIfNoLayoutObject(); | 1565 data->clearComputedStyle(); |
1566 } | 1566 } |
1567 | 1567 |
1568 if (!isSlotOrActiveInsertionPoint()) | 1568 if (!isSlotOrActiveInsertionPoint()) |
1569 LayoutTreeBuilderForElement(*this, context.resolvedStyle).createLayoutOb
jectIfNeeded(); | 1569 LayoutTreeBuilderForElement(*this, context.resolvedStyle).createLayoutOb
jectIfNeeded(); |
1570 | 1570 |
1571 addCallbackSelectors(); | 1571 addCallbackSelectors(); |
1572 | 1572 |
1573 if (hasRareData() && !layoutObject()) { | 1573 if (hasRareData() && !layoutObject()) { |
1574 if (ElementAnimations* elementAnimations = elementRareData()->elementAni
mations()) { | 1574 if (ElementAnimations* elementAnimations = elementRareData()->elementAni
mations()) { |
1575 elementAnimations->cssAnimations().cancel(); | 1575 elementAnimations->cssAnimations().cancel(); |
(...skipping 25 matching lines...) Expand all Loading... |
1601 { | 1601 { |
1602 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 1602 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
1603 cancelFocusAppearanceUpdate(); | 1603 cancelFocusAppearanceUpdate(); |
1604 removeCallbackSelectors(); | 1604 removeCallbackSelectors(); |
1605 if (hasRareData()) { | 1605 if (hasRareData()) { |
1606 ElementRareData* data = elementRareData(); | 1606 ElementRareData* data = elementRareData(); |
1607 data->clearPseudoElements(); | 1607 data->clearPseudoElements(); |
1608 | 1608 |
1609 // attachLayoutTree() will clear the computed style for us when inside r
ecalcStyle. | 1609 // attachLayoutTree() will clear the computed style for us when inside r
ecalcStyle. |
1610 if (!document().inStyleRecalc()) | 1610 if (!document().inStyleRecalc()) |
1611 data->clearComputedStyleIfNoLayoutObject(); | 1611 data->clearComputedStyle(); |
1612 | 1612 |
1613 if (ElementAnimations* elementAnimations = data->elementAnimations()) { | 1613 if (ElementAnimations* elementAnimations = data->elementAnimations()) { |
1614 if (context.performingReattach) { | 1614 if (context.performingReattach) { |
1615 // FIXME: We call detach from within style recalc, so compositin
gState is not up to date. | 1615 // FIXME: We call detach from within style recalc, so compositin
gState is not up to date. |
1616 // https://code.google.com/p/chromium/issues/detail?id=339847 | 1616 // https://code.google.com/p/chromium/issues/detail?id=339847 |
1617 DisableCompositingQueryAsserts disabler; | 1617 DisableCompositingQueryAsserts disabler; |
1618 | 1618 |
1619 // FIXME: restart compositor animations rather than pull back to
the main thread | 1619 // FIXME: restart compositor animations rather than pull back to
the main thread |
1620 elementAnimations->restartAnimationOnCompositor(); | 1620 elementAnimations->restartAnimationOnCompositor(); |
1621 } else { | 1621 } else { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1731 DCHECK(!parentOrShadowHostNode()->needsStyleRecalc()); | 1731 DCHECK(!parentOrShadowHostNode()->needsStyleRecalc()); |
1732 DCHECK(inActiveDocument()); | 1732 DCHECK(inActiveDocument()); |
1733 | 1733 |
1734 if (hasCustomStyleCallbacks()) | 1734 if (hasCustomStyleCallbacks()) |
1735 willRecalcStyle(change); | 1735 willRecalcStyle(change); |
1736 | 1736 |
1737 if (change >= IndependentInherit || needsStyleRecalc()) { | 1737 if (change >= IndependentInherit || needsStyleRecalc()) { |
1738 if (hasRareData()) { | 1738 if (hasRareData()) { |
1739 ElementRareData* data = elementRareData(); | 1739 ElementRareData* data = elementRareData(); |
1740 if (change != IndependentInherit) | 1740 if (change != IndependentInherit) |
1741 data->clearComputedStyleIfNoLayoutObject(); | 1741 data->clearComputedStyle(); |
1742 | 1742 |
1743 if (change >= IndependentInherit) { | 1743 if (change >= IndependentInherit) { |
1744 if (ElementAnimations* elementAnimations = data->elementAnimatio
ns()) | 1744 if (ElementAnimations* elementAnimations = data->elementAnimatio
ns()) |
1745 elementAnimations->setAnimationStyleChange(false); | 1745 elementAnimations->setAnimationStyleChange(false); |
1746 } | 1746 } |
1747 } | 1747 } |
1748 if (parentComputedStyle()) | 1748 if (parentComputedStyle()) |
1749 change = recalcOwnStyle(change); | 1749 change = recalcOwnStyle(change); |
1750 clearNeedsStyleRecalc(); | 1750 clearNeedsStyleRecalc(); |
1751 } | 1751 } |
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3829 | 3829 |
3830 DEFINE_TRACE_WRAPPERS(Element) | 3830 DEFINE_TRACE_WRAPPERS(Element) |
3831 { | 3831 { |
3832 if (hasRareData()) { | 3832 if (hasRareData()) { |
3833 visitor->traceWrappers(elementRareData()); | 3833 visitor->traceWrappers(elementRareData()); |
3834 } | 3834 } |
3835 ContainerNode::traceWrappers(visitor); | 3835 ContainerNode::traceWrappers(visitor); |
3836 } | 3836 } |
3837 | 3837 |
3838 } // namespace blink | 3838 } // namespace blink |
OLD | NEW |