| 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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 | 1320 |
| 1321 void Element::attach(const AttachContext& context) | 1321 void Element::attach(const AttachContext& context) |
| 1322 { | 1322 { |
| 1323 ASSERT(document().inStyleRecalc()); | 1323 ASSERT(document().inStyleRecalc()); |
| 1324 | 1324 |
| 1325 // We've already been through detach when doing an attach, but we might | 1325 // We've already been through detach when doing an attach, but we might |
| 1326 // need to clear any state that's been added since then. | 1326 // need to clear any state that's been added since then. |
| 1327 if (hasRareData() && styleChangeType() == NeedsReattachStyleChange) { | 1327 if (hasRareData() && styleChangeType() == NeedsReattachStyleChange) { |
| 1328 ElementRareData* data = elementRareData(); | 1328 ElementRareData* data = elementRareData(); |
| 1329 data->clearComputedStyle(); | 1329 data->clearComputedStyle(); |
| 1330 // Only clear the style state if we're not going to reuse the style from
recalcStyle. | |
| 1331 if (!context.resolvedStyle) | |
| 1332 data->resetStyleState(); | |
| 1333 } | 1330 } |
| 1334 | 1331 |
| 1335 RenderTreeBuilder(this, context.resolvedStyle).createRendererForElementIfNee
ded(); | 1332 RenderTreeBuilder(this, context.resolvedStyle).createRendererForElementIfNee
ded(); |
| 1336 | 1333 |
| 1337 addCallbackSelectors(); | 1334 addCallbackSelectors(); |
| 1338 | 1335 |
| 1339 StyleResolverParentScope parentScope(*this); | 1336 StyleResolverParentScope parentScope(*this); |
| 1340 | 1337 |
| 1341 createPseudoElementIfNeeded(BEFORE); | 1338 createPseudoElementIfNeeded(BEFORE); |
| 1342 | 1339 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1361 { | 1358 { |
| 1362 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; | 1359 HTMLFrameOwnerElement::UpdateSuspendScope suspendWidgetHierarchyUpdates; |
| 1363 cancelFocusAppearanceUpdate(); | 1360 cancelFocusAppearanceUpdate(); |
| 1364 removeCallbackSelectors(); | 1361 removeCallbackSelectors(); |
| 1365 if (svgFilterNeedsLayerUpdate()) | 1362 if (svgFilterNeedsLayerUpdate()) |
| 1366 document().unscheduleSVGFilterLayerUpdateHack(*this); | 1363 document().unscheduleSVGFilterLayerUpdateHack(*this); |
| 1367 if (hasRareData()) { | 1364 if (hasRareData()) { |
| 1368 ElementRareData* data = elementRareData(); | 1365 ElementRareData* data = elementRareData(); |
| 1369 data->clearPseudoElements(); | 1366 data->clearPseudoElements(); |
| 1370 | 1367 |
| 1371 // attach() will perform the below steps for us when inside recalcStyle. | 1368 // attach() will clear the computed style for us when inside recalcStyle
. |
| 1372 if (!document().inStyleRecalc()) { | 1369 if (!document().inStyleRecalc()) |
| 1373 data->resetStyleState(); | |
| 1374 data->clearComputedStyle(); | 1370 data->clearComputedStyle(); |
| 1375 } | |
| 1376 | 1371 |
| 1377 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { | 1372 if (ActiveAnimations* activeAnimations = data->activeAnimations()) { |
| 1378 if (context.performingReattach) { | 1373 if (context.performingReattach) { |
| 1379 // FIXME: We call detach from within style recalc, so compositin
gState is not up to date. | 1374 // FIXME: We call detach from within style recalc, so compositin
gState is not up to date. |
| 1380 // https://code.google.com/p/chromium/issues/detail?id=339847 | 1375 // https://code.google.com/p/chromium/issues/detail?id=339847 |
| 1381 DisableCompositingQueryAsserts disabler; | 1376 DisableCompositingQueryAsserts disabler; |
| 1382 | 1377 |
| 1383 // FIXME: restart compositor animations rather than pull back to
the main thread | 1378 // FIXME: restart compositor animations rather than pull back to
the main thread |
| 1384 activeAnimations->cancelAnimationOnCompositor(); | 1379 activeAnimations->cancelAnimationOnCompositor(); |
| 1385 } else { | 1380 } else { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 { | 1469 { |
| 1475 ASSERT(document().inStyleRecalc()); | 1470 ASSERT(document().inStyleRecalc()); |
| 1476 ASSERT(!parentOrShadowHostNode()->needsStyleRecalc()); | 1471 ASSERT(!parentOrShadowHostNode()->needsStyleRecalc()); |
| 1477 | 1472 |
| 1478 if (hasCustomStyleCallbacks()) | 1473 if (hasCustomStyleCallbacks()) |
| 1479 willRecalcStyle(change); | 1474 willRecalcStyle(change); |
| 1480 | 1475 |
| 1481 if (change >= Inherit || needsStyleRecalc()) { | 1476 if (change >= Inherit || needsStyleRecalc()) { |
| 1482 if (hasRareData()) { | 1477 if (hasRareData()) { |
| 1483 ElementRareData* data = elementRareData(); | 1478 ElementRareData* data = elementRareData(); |
| 1484 data->resetStyleState(); | |
| 1485 data->clearComputedStyle(); | 1479 data->clearComputedStyle(); |
| 1486 | 1480 |
| 1487 if (change >= Inherit) { | 1481 if (change >= Inherit) { |
| 1488 if (ActiveAnimations* activeAnimations = data->activeAnimations(
)) | 1482 if (ActiveAnimations* activeAnimations = data->activeAnimations(
)) |
| 1489 activeAnimations->setAnimationStyleChange(false); | 1483 activeAnimations->setAnimationStyleChange(false); |
| 1490 } | 1484 } |
| 1491 } | 1485 } |
| 1492 if (parentRenderStyle()) | 1486 if (parentRenderStyle()) |
| 1493 change = recalcOwnStyle(change); | 1487 change = recalcOwnStyle(change); |
| 1494 clearNeedsStyleRecalc(); | 1488 clearNeedsStyleRecalc(); |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3267 return v8::Handle<v8::Object>(); | 3261 return v8::Handle<v8::Object>(); |
| 3268 | 3262 |
| 3269 wrapper->SetPrototype(binding->prototype()); | 3263 wrapper->SetPrototype(binding->prototype()); |
| 3270 | 3264 |
| 3271 wrapperType->refObject(toScriptWrappableBase()); | 3265 wrapperType->refObject(toScriptWrappableBase()); |
| 3272 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp
er, isolate); | 3266 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp
er, isolate); |
| 3273 return wrapper; | 3267 return wrapper; |
| 3274 } | 3268 } |
| 3275 | 3269 |
| 3276 } // namespace blink | 3270 } // namespace blink |
| OLD | NEW |