Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 21012002: Web Animations: Trigger and update CSS Animations backed by the Web Animations model (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix windows build. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 if (PropertySetCSSStyleDeclaration* cssomWrapper = inlineStyleCSSOMWrapper() ) 204 if (PropertySetCSSStyleDeclaration* cssomWrapper = inlineStyleCSSOMWrapper() )
205 cssomWrapper->clearParentElement(); 205 cssomWrapper->clearParentElement();
206 206
207 if (hasRareData()) { 207 if (hasRareData()) {
208 ElementRareData* data = elementRareData(); 208 ElementRareData* data = elementRareData();
209 data->setPseudoElement(BEFORE, 0); 209 data->setPseudoElement(BEFORE, 0);
210 data->setPseudoElement(AFTER, 0); 210 data->setPseudoElement(AFTER, 0);
211 data->setPseudoElement(BACKDROP, 0); 211 data->setPseudoElement(BACKDROP, 0);
212 data->clearShadow(); 212 data->clearShadow();
213
214 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()) {
215 if (ActiveAnimations* activeAnimations = data->activeAnimations())
216 activeAnimations->cssAnimations()->cancel();
217 }
213 } 218 }
214 219
215 if (isCustomElement()) 220 if (isCustomElement())
216 CustomElement::wasDestroyed(this); 221 CustomElement::wasDestroyed(this);
217 222
218 if (hasSyntheticAttrChildNodes()) 223 if (hasSyntheticAttrChildNodes())
219 detachAllAttrNodesFromElement(); 224 detachAllAttrNodesFromElement();
220 225
221 if (hasPendingResources()) { 226 if (hasPendingResources()) {
222 document()->accessSVGExtensions()->removeElementFromPendingResources(thi s); 227 document()->accessSVGExtensions()->removeElementFromPendingResources(thi s);
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 cancelFocusAppearanceUpdate(); 1365 cancelFocusAppearanceUpdate();
1361 if (hasRareData()) { 1366 if (hasRareData()) {
1362 ElementRareData* data = elementRareData(); 1367 ElementRareData* data = elementRareData();
1363 data->setPseudoElement(BEFORE, 0); 1368 data->setPseudoElement(BEFORE, 0);
1364 data->setPseudoElement(AFTER, 0); 1369 data->setPseudoElement(AFTER, 0);
1365 data->setPseudoElement(BACKDROP, 0); 1370 data->setPseudoElement(BACKDROP, 0);
1366 data->setIsInCanvasSubtree(false); 1371 data->setIsInCanvasSubtree(false);
1367 data->resetComputedStyle(); 1372 data->resetComputedStyle();
1368 data->resetDynamicRestyleObservations(); 1373 data->resetDynamicRestyleObservations();
1369 data->setIsInsideRegion(false); 1374 data->setIsInsideRegion(false);
1375
1376 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && !context.perfor mingReattach) {
1377 if (ActiveAnimations* activeAnimations = data->activeAnimations())
1378 activeAnimations->cssAnimations()->cancel();
1379 }
1370 } 1380 }
1371 if (ElementShadow* shadow = this->shadow()) 1381 if (ElementShadow* shadow = this->shadow())
1372 shadow->detach(context); 1382 shadow->detach(context);
1373 ContainerNode::detach(context); 1383 ContainerNode::detach(context);
1374 } 1384 }
1375 1385
1376 bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderS tyle* newStyle) 1386 bool Element::pseudoStyleCacheIsInvalid(const RenderStyle* currentStyle, RenderS tyle* newStyle)
1377 { 1387 {
1378 ASSERT(currentStyle == renderStyle()); 1388 ASSERT(currentStyle == renderStyle());
1379 ASSERT(renderer()); 1389 ASSERT(renderer());
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 clearChildNeedsStyleRecalc(); 1477 clearChildNeedsStyleRecalc();
1468 1478
1469 if (hasCustomStyleCallbacks()) 1479 if (hasCustomStyleCallbacks())
1470 didRecalcStyle(change); 1480 didRecalcStyle(change);
1471 return true; 1481 return true;
1472 } 1482 }
1473 1483
1474 InspectorInstrumentation::didRecalculateStyleForElement(this); 1484 InspectorInstrumentation::didRecalculateStyleForElement(this);
1475 1485
1476 if (RenderObject* renderer = this->renderer()) { 1486 if (RenderObject* renderer = this->renderer()) {
1477 if (localChange != NoChange || pseudoStyleCacheIsInvalid(currentStyl e.get(), newStyle.get()) || (change == Force && renderer->requiresForcedStyleRec alcPropagation()) || shouldNotifyRendererWithIdenticalStyles()) 1487 if (localChange != NoChange || pseudoStyleCacheIsInvalid(currentStyl e.get(), newStyle.get()) || (change == Force && renderer->requiresForcedStyleRec alcPropagation()) || shouldNotifyRendererWithIdenticalStyles()) {
1478 renderer->setAnimatableStyle(newStyle.get()); 1488 renderer->setAnimatableStyle(newStyle.get());
1479 else if (needsStyleRecalc()) { 1489 } else if (needsStyleRecalc()) {
1480 // Although no change occurred, we use the new style so that the cousin style sharing code won't get 1490 // Although no change occurred, we use the new style so that the cousin style sharing code won't get
1481 // fooled into believing this style is the same. 1491 // fooled into believing this style is the same.
1482 renderer->setStyleInternal(newStyle.get()); 1492 renderer->setStyleInternal(newStyle.get());
1483 } 1493 }
1484 } 1494 }
1485 1495
1486 // If "rem" units are used anywhere in the document, and if the document element's font size changes, then go ahead and force font updating 1496 // If "rem" units are used anywhere in the document, and if the document element's font size changes, then go ahead and force font updating
1487 // all the way down the tree. This is simpler than having to maintain a cache of objects (and such font size changes should be rare anyway). 1497 // all the way down the tree. This is simpler than having to maintain a cache of objects (and such font size changes should be rare anyway).
1488 if (document()->styleSheetCollection()->usesRemUnits() && document()->do cumentElement() == this && localChange != NoChange && currentStyle && newStyle & & currentStyle->fontSize() != newStyle->fontSize()) { 1498 if (document()->styleSheetCollection()->usesRemUnits() && document()->do cumentElement() == this && localChange != NoChange && currentStyle && newStyle & & currentStyle->fontSize() != newStyle->fontSize()) {
1489 // Cached RenderStyles may depend on the re units. 1499 // Cached RenderStyles may depend on the re units.
(...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3600 return 0; 3610 return 0;
3601 } 3611 }
3602 3612
3603 Attribute* UniqueElementData::attributeItem(unsigned index) 3613 Attribute* UniqueElementData::attributeItem(unsigned index)
3604 { 3614 {
3605 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3615 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3606 return &m_attributeVector.at(index); 3616 return &m_attributeVector.at(index);
3607 } 3617 }
3608 3618
3609 } // namespace WebCore 3619 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698