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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1359 if (hasPendingResources()) | 1359 if (hasPendingResources()) |
1360 document().accessSVGExtensions().removeElementFromPendingResources(t his); | 1360 document().accessSVGExtensions().removeElementFromPendingResources(t his); |
1361 | 1361 |
1362 if (isUpgradedCustomElement()) | 1362 if (isUpgradedCustomElement()) |
1363 CustomElement::didLeaveDocument(this, insertionPoint->document()); | 1363 CustomElement::didLeaveDocument(this, insertionPoint->document()); |
1364 } | 1364 } |
1365 | 1365 |
1366 document().removeFromTopLayer(this); | 1366 document().removeFromTopLayer(this); |
1367 | 1367 |
1368 clearElementFlag(IsInCanvasSubtree); | 1368 clearElementFlag(IsInCanvasSubtree); |
1369 | |
1370 if (hasRareData()) | |
1371 elementRareData()->clearRestyleFlags(); | |
1369 } | 1372 } |
1370 | 1373 |
1371 void Element::attach(const AttachContext& context) | 1374 void Element::attach(const AttachContext& context) |
1372 { | 1375 { |
1373 ASSERT(document().inStyleRecalc()); | 1376 ASSERT(document().inStyleRecalc()); |
1374 | 1377 |
1375 // We've already been through detach when doing an attach, but we might | 1378 // We've already been through detach when doing an attach, but we might |
1376 // need to clear any state that's been added since then. | 1379 // need to clear any state that's been added since then. |
1377 if (hasRareData() && styleChangeType() == NeedsReattachStyleChange) { | 1380 if (hasRareData() && styleChangeType() == NeedsReattachStyleChange) { |
1378 ElementRareData* data = elementRareData(); | 1381 ElementRareData* data = elementRareData(); |
1379 data->clearComputedStyle(); | 1382 data->clearComputedStyle(); |
1380 data->clearRestyleFlags(); | |
esprehn
2014/05/30 17:46:18
This doesn't make sense, when you're inserted into
| |
1381 // Only clear the style state if we're not going to reuse the style from recalcStyle. | 1383 // Only clear the style state if we're not going to reuse the style from recalcStyle. |
1382 if (!context.resolvedStyle) | 1384 if (!context.resolvedStyle) |
1383 data->resetStyleState(); | 1385 data->resetStyleState(); |
1384 } | 1386 } |
1385 | 1387 |
1386 RenderTreeBuilder(this, context.resolvedStyle).createRendererForElementIfNee ded(); | 1388 RenderTreeBuilder(this, context.resolvedStyle).createRendererForElementIfNee ded(); |
1387 | 1389 |
1388 addCallbackSelectors(); | 1390 addCallbackSelectors(); |
1389 | 1391 |
1390 StyleResolverParentScope parentScope(*this); | 1392 StyleResolverParentScope parentScope(*this); |
(...skipping 25 matching lines...) Expand all Loading... | |
1416 if (needsLayerUpdate()) | 1418 if (needsLayerUpdate()) |
1417 document().unscheduleLayerUpdate(*this); | 1419 document().unscheduleLayerUpdate(*this); |
1418 if (hasRareData()) { | 1420 if (hasRareData()) { |
1419 ElementRareData* data = elementRareData(); | 1421 ElementRareData* data = elementRareData(); |
1420 data->clearPseudoElements(); | 1422 data->clearPseudoElements(); |
1421 | 1423 |
1422 // attach() will perform the below steps for us when inside recalcStyle. | 1424 // attach() will perform the below steps for us when inside recalcStyle. |
1423 if (!document().inStyleRecalc()) { | 1425 if (!document().inStyleRecalc()) { |
1424 data->resetStyleState(); | 1426 data->resetStyleState(); |
1425 data->clearComputedStyle(); | 1427 data->clearComputedStyle(); |
1426 data->clearRestyleFlags(); | |
esprehn
2014/05/30 17:46:18
We only execute this line when you remove a child,
| |
1427 } | 1428 } |
1428 | 1429 |
1429 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { | 1430 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { |
1430 if (context.performingReattach) { | 1431 if (context.performingReattach) { |
1431 // FIXME: We call detach from within style recalc, so compositin gState is not up to date. | 1432 // FIXME: We call detach from within style recalc, so compositin gState is not up to date. |
1432 // https://code.google.com/p/chromium/issues/detail?id=339847 | 1433 // https://code.google.com/p/chromium/issues/detail?id=339847 |
1433 DisableCompositingQueryAsserts disabler; | 1434 DisableCompositingQueryAsserts disabler; |
1434 | 1435 |
1435 // FIXME: restart compositor animations rather than pull back to the main thread | 1436 // FIXME: restart compositor animations rather than pull back to the main thread |
1436 activeAnimations->cancelAnimationOnCompositor(); | 1437 activeAnimations->cancelAnimationOnCompositor(); |
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3301 | 3302 |
3302 void Element::trace(Visitor* visitor) | 3303 void Element::trace(Visitor* visitor) |
3303 { | 3304 { |
3304 if (hasRareData()) | 3305 if (hasRareData()) |
3305 visitor->trace(elementRareData()); | 3306 visitor->trace(elementRareData()); |
3306 | 3307 |
3307 ContainerNode::trace(visitor); | 3308 ContainerNode::trace(visitor); |
3308 } | 3309 } |
3309 | 3310 |
3310 } // namespace WebCore | 3311 } // namespace WebCore |
OLD | NEW |