Chromium Code Reviews| 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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 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 12 matching lines...) Expand all Loading... | |
| 23 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/rendering/RenderObject.h" | 28 #include "core/rendering/RenderObject.h" |
| 29 | 29 |
| 30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
| 31 #include "RuntimeEnabledFeatures.h" | 31 #include "RuntimeEnabledFeatures.h" |
| 32 #include "core/accessibility/AXObjectCache.h" | 32 #include "core/accessibility/AXObjectCache.h" |
| 33 #include "core/animation/ActiveAnimations.h" | |
| 33 #include "core/css/resolver/StyleResolver.h" | 34 #include "core/css/resolver/StyleResolver.h" |
| 34 #include "core/editing/EditingBoundary.h" | 35 #include "core/editing/EditingBoundary.h" |
| 35 #include "core/editing/FrameSelection.h" | 36 #include "core/editing/FrameSelection.h" |
| 36 #include "core/editing/htmlediting.h" | 37 #include "core/editing/htmlediting.h" |
| 37 #include "core/html/HTMLAnchorElement.h" | 38 #include "core/html/HTMLAnchorElement.h" |
| 38 #include "core/html/HTMLElement.h" | 39 #include "core/html/HTMLElement.h" |
| 39 #include "core/html/HTMLHtmlElement.h" | 40 #include "core/html/HTMLHtmlElement.h" |
| 40 #include "core/html/HTMLTableElement.h" | 41 #include "core/html/HTMLTableElement.h" |
| 41 #include "core/page/EventHandler.h" | 42 #include "core/page/EventHandler.h" |
| 42 #include "core/page/Frame.h" | 43 #include "core/page/Frame.h" |
| (...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1718 RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock() ; | 1719 RenderBlock* block = toRenderBlock(parent())->createAnonymousBlock() ; |
| 1719 RenderObjectChildList* childlist = parent()->virtualChildren(); | 1720 RenderObjectChildList* childlist = parent()->virtualChildren(); |
| 1720 childlist->insertChildNode(parent(), block, this); | 1721 childlist->insertChildNode(parent(), block, this); |
| 1721 block->children()->appendChildNode(block, childlist->removeChildNode (parent(), this)); | 1722 block->children()->appendChildNode(block, childlist->removeChildNode (parent(), this)); |
| 1722 } | 1723 } |
| 1723 } | 1724 } |
| 1724 } | 1725 } |
| 1725 | 1726 |
| 1726 void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style) | 1727 void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style) |
| 1727 { | 1728 { |
| 1728 if (!isText() && style && !RuntimeEnabledFeatures::webAnimationsCSSEnabled() ) | 1729 if (!isText() && style) { |
| 1729 setStyle(animation()->updateAnimations(this, style.get())); | 1730 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && node() && node( )->isElementNode()) { |
| 1730 else | 1731 Element* element = toElement(node()); |
| 1732 if (CSSAnimations::needsUpdate(element, style.get())) | |
| 1733 element->ensureActiveAnimations()->cssAnimations()->update(eleme nt, style.get()); | |
| 1734 setStyle(style); | |
| 1735 } else { | |
| 1736 setStyle(animation()->updateAnimations(this, style.get())); | |
|
Steve Block
2013/08/06 03:57:01
Is this 'else' correct? Surely we never want to do
dstockwell
2013/08/06 05:43:25
Fixed.
| |
| 1737 } | |
| 1738 } else { | |
| 1731 setStyle(style); | 1739 setStyle(style); |
| 1740 } | |
| 1732 } | 1741 } |
| 1733 | 1742 |
| 1734 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign ed contextSensitiveProperties) const | 1743 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign ed contextSensitiveProperties) const |
| 1735 { | 1744 { |
| 1736 // If transform changed, and we are not composited, need to do a layout. | 1745 // If transform changed, and we are not composited, need to do a layout. |
| 1737 if (contextSensitiveProperties & ContextSensitivePropertyTransform) { | 1746 if (contextSensitiveProperties & ContextSensitivePropertyTransform) { |
| 1738 // Text nodes share style with their parents but transforms don't apply to them, | 1747 // Text nodes share style with their parents but transforms don't apply to them, |
| 1739 // hence the !isText() check. | 1748 // hence the !isText() check. |
| 1740 // FIXME: when transforms are taken into account for overflow, we will n eed to do a layout. | 1749 // FIXME: when transforms are taken into account for overflow, we will n eed to do a layout. |
| 1741 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer( )->isComposited())) { | 1750 if (!isText() && (!hasLayer() || !toRenderLayerModelObject(this)->layer( )->isComposited())) { |
| (...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3279 { | 3288 { |
| 3280 if (object1) { | 3289 if (object1) { |
| 3281 const WebCore::RenderObject* root = object1; | 3290 const WebCore::RenderObject* root = object1; |
| 3282 while (root->parent()) | 3291 while (root->parent()) |
| 3283 root = root->parent(); | 3292 root = root->parent(); |
| 3284 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3293 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3285 } | 3294 } |
| 3286 } | 3295 } |
| 3287 | 3296 |
| 3288 #endif | 3297 #endif |
| OLD | NEW |