| 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 } | 1549 } |
| 1550 | 1550 |
| 1551 void Element::attachLayoutTree(const AttachContext& context) | 1551 void Element::attachLayoutTree(const AttachContext& context) |
| 1552 { | 1552 { |
| 1553 DCHECK(document().inStyleRecalc()); | 1553 DCHECK(document().inStyleRecalc()); |
| 1554 | 1554 |
| 1555 // We've already been through detach when doing an attach, but we might | 1555 // We've already been through detach when doing an attach, but we might |
| 1556 // need to clear any state that's been added since then. | 1556 // need to clear any state that's been added since then. |
| 1557 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { | 1557 if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) { |
| 1558 ElementRareData* data = elementRareData(); | 1558 ElementRareData* data = elementRareData(); |
| 1559 data->clearComputedStyle(); | 1559 if (!data->layoutObject()) |
| 1560 data->clearComputedStyle(); |
| 1560 } | 1561 } |
| 1561 | 1562 |
| 1562 if (!isSlotOrActiveInsertionPoint()) | 1563 if (!isSlotOrActiveInsertionPoint()) |
| 1563 LayoutTreeBuilderForElement(*this, context.resolvedStyle).createLayoutOb
jectIfNeeded(); | 1564 LayoutTreeBuilderForElement(*this, context.resolvedStyle).createLayoutOb
jectIfNeeded(); |
| 1564 | 1565 |
| 1565 addCallbackSelectors(); | 1566 addCallbackSelectors(); |
| 1566 | 1567 |
| 1567 if (hasRareData() && !layoutObject()) { | 1568 if (hasRareData() && !layoutObject()) { |
| 1568 if (ElementAnimations* elementAnimations = elementRareData()->elementAni
mations()) { | 1569 if (ElementAnimations* elementAnimations = elementRareData()->elementAni
mations()) { |
| 1569 elementAnimations->cssAnimations().cancel(); | 1570 elementAnimations->cssAnimations().cancel(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1594 void Element::detachLayoutTree(const AttachContext& context) | 1595 void Element::detachLayoutTree(const AttachContext& context) |
| 1595 { | 1596 { |
| 1596 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 1597 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 1597 cancelFocusAppearanceUpdate(); | 1598 cancelFocusAppearanceUpdate(); |
| 1598 removeCallbackSelectors(); | 1599 removeCallbackSelectors(); |
| 1599 if (hasRareData()) { | 1600 if (hasRareData()) { |
| 1600 ElementRareData* data = elementRareData(); | 1601 ElementRareData* data = elementRareData(); |
| 1601 data->clearPseudoElements(); | 1602 data->clearPseudoElements(); |
| 1602 | 1603 |
| 1603 // attachLayoutTree() will clear the computed style for us when inside r
ecalcStyle. | 1604 // attachLayoutTree() will clear the computed style for us when inside r
ecalcStyle. |
| 1604 if (!document().inStyleRecalc()) | 1605 if (!document().inStyleRecalc() && !data->layoutObject()) |
| 1605 data->clearComputedStyle(); | 1606 data->clearComputedStyle(); |
| 1606 | 1607 |
| 1607 if (ElementAnimations* elementAnimations = data->elementAnimations()) { | 1608 if (ElementAnimations* elementAnimations = data->elementAnimations()) { |
| 1608 if (context.performingReattach) { | 1609 if (context.performingReattach) { |
| 1609 // FIXME: We call detach from within style recalc, so compositin
gState is not up to date. | 1610 // FIXME: We call detach from within style recalc, so compositin
gState is not up to date. |
| 1610 // https://code.google.com/p/chromium/issues/detail?id=339847 | 1611 // https://code.google.com/p/chromium/issues/detail?id=339847 |
| 1611 DisableCompositingQueryAsserts disabler; | 1612 DisableCompositingQueryAsserts disabler; |
| 1612 | 1613 |
| 1613 // FIXME: restart compositor animations rather than pull back to
the main thread | 1614 // FIXME: restart compositor animations rather than pull back to
the main thread |
| 1614 elementAnimations->restartAnimationOnCompositor(); | 1615 elementAnimations->restartAnimationOnCompositor(); |
| (...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3818 | 3819 |
| 3819 DEFINE_TRACE_WRAPPERS(Element) | 3820 DEFINE_TRACE_WRAPPERS(Element) |
| 3820 { | 3821 { |
| 3821 if (hasRareData()) { | 3822 if (hasRareData()) { |
| 3822 visitor->traceWrappers(elementRareData()); | 3823 visitor->traceWrappers(elementRareData()); |
| 3823 } | 3824 } |
| 3824 ContainerNode::traceWrappers(visitor); | 3825 ContainerNode::traceWrappers(visitor); |
| 3825 } | 3826 } |
| 3826 | 3827 |
| 3827 } // namespace blink | 3828 } // namespace blink |
| OLD | NEW |