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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 33483002: Have Frame::animation() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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) 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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 RenderObjectChildList* childlist = parent()->virtualChildren(); 1767 RenderObjectChildList* childlist = parent()->virtualChildren();
1768 childlist->insertChildNode(parent(), block, this); 1768 childlist->insertChildNode(parent(), block, this);
1769 block->children()->appendChildNode(block, childlist->removeChildNode (parent(), this)); 1769 block->children()->appendChildNode(block, childlist->removeChildNode (parent(), this));
1770 } 1770 }
1771 } 1771 }
1772 } 1772 }
1773 1773
1774 void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style) 1774 void RenderObject::setAnimatableStyle(PassRefPtr<RenderStyle> style)
1775 { 1775 {
1776 if (!isText() && style && !RuntimeEnabledFeatures::webAnimationsCSSEnabled() ) { 1776 if (!isText() && style && !RuntimeEnabledFeatures::webAnimationsCSSEnabled() ) {
1777 setStyle(animation()->updateAnimations(this, style.get())); 1777 setStyle(animation().updateAnimations(this, style.get()));
1778 return; 1778 return;
1779 } 1779 }
1780 setStyle(style); 1780 setStyle(style);
1781 } 1781 }
1782 1782
1783 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign ed contextSensitiveProperties) const 1783 StyleDifference RenderObject::adjustStyleDifference(StyleDifference diff, unsign ed contextSensitiveProperties) const
1784 { 1784 {
1785 // If transform changed, and the layer does not paint into its own separate backing, then we need to do a layout. 1785 // If transform changed, and the layer does not paint into its own separate backing, then we need to do a layout.
1786 // FIXME: The comment above is what the code does, but it is technically not following spec. This means we will 1786 // FIXME: The comment above is what the code does, but it is technically not following spec. This means we will
1787 // not to layout for 3d transforms, but we should be invoking a simplified r elayout. Is it possible we are avoiding 1787 // not to layout for 3d transforms, but we should be invoking a simplified r elayout. Is it possible we are avoiding
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2556 2556
2557 // If this renderer is being autoscrolled, stop the autoscroll timer 2557 // If this renderer is being autoscrolled, stop the autoscroll timer
2558 2558
2559 // FIXME: RenderObject::destroy should not get called with a renderer whose document 2559 // FIXME: RenderObject::destroy should not get called with a renderer whose document
2560 // has a null frame, so we assert this. However, we don't want release build s to crash which is why we 2560 // has a null frame, so we assert this. However, we don't want release build s to crash which is why we
2561 // check that the frame is not null. 2561 // check that the frame is not null.
2562 ASSERT(frame()); 2562 ASSERT(frame());
2563 if (Frame* frame = this->frame()) { 2563 if (Frame* frame = this->frame()) {
2564 if (frame->page()) 2564 if (frame->page())
2565 frame->page()->stopAutoscrollIfNeeded(this); 2565 frame->page()->stopAutoscrollIfNeeded(this);
2566 frame->animation()->cancelAnimations(this); 2566 frame->animation().cancelAnimations(this);
2567 } 2567 }
2568 2568
2569 // For accessibility management, notify the parent of the imminent change to its child set. 2569 // For accessibility management, notify the parent of the imminent change to its child set.
2570 // We do it now, before remove(), while the parent pointer is still availabl e. 2570 // We do it now, before remove(), while the parent pointer is still availabl e.
2571 if (AXObjectCache* cache = document().existingAXObjectCache()) 2571 if (AXObjectCache* cache = document().existingAXObjectCache())
2572 cache->childrenChanged(this->parent()); 2572 cache->childrenChanged(this->parent());
2573 2573
2574 remove(); 2574 remove();
2575 2575
2576 // The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render 2576 // The remove() call above may invoke axObjectCache()->childrenChanged() on the parent, which may require the AX render
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
3123 { 3123 {
3124 int outlineSize = outlineStyleForRepaint()->outlineSize(); 3124 int outlineSize = outlineStyleForRepaint()->outlineSize();
3125 if (const ShadowData* boxShadow = style()->boxShadow()) { 3125 if (const ShadowData* boxShadow = style()->boxShadow()) {
3126 boxShadow->adjustRectForShadow(rect, outlineSize); 3126 boxShadow->adjustRectForShadow(rect, outlineSize);
3127 return; 3127 return;
3128 } 3128 }
3129 3129
3130 rect.inflate(outlineSize); 3130 rect.inflate(outlineSize);
3131 } 3131 }
3132 3132
3133 AnimationController* RenderObject::animation() const 3133 AnimationController& RenderObject::animation() const
3134 { 3134 {
3135 return frame()->animation(); 3135 return frame()->animation();
3136 } 3136 }
3137 3137
3138 bool RenderObject::isInert() const 3138 bool RenderObject::isInert() const
3139 { 3139 {
3140 const RenderObject* renderer = this; 3140 const RenderObject* renderer = this;
3141 while (!renderer->node()) 3141 while (!renderer->node())
3142 renderer = renderer->parent(); 3142 renderer = renderer->parent();
3143 return renderer->node()->isInert(); 3143 return renderer->node()->isInert();
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
3394 { 3394 {
3395 if (object1) { 3395 if (object1) {
3396 const WebCore::RenderObject* root = object1; 3396 const WebCore::RenderObject* root = object1;
3397 while (root->parent()) 3397 while (root->parent())
3398 root = root->parent(); 3398 root = root->parent();
3399 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3399 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3400 } 3400 }
3401 } 3401 }
3402 3402
3403 #endif 3403 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698