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

Side by Side Diff: Source/core/css/PropertySetCSSStyleDeclaration.cpp

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and address comments Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 */ 20 */
21 21
22 #include "config.h" 22 #include "config.h"
23 #include "core/css/PropertySetCSSStyleDeclaration.h" 23 #include "core/css/PropertySetCSSStyleDeclaration.h"
24 24
25 #include "bindings/core/v8/ExceptionState.h" 25 #include "bindings/core/v8/ExceptionState.h"
26 #include "core/HTMLNames.h" 26 #include "core/HTMLNames.h"
27 #include "core/css/CSSKeyframesRule.h"
27 #include "core/css/CSSStyleSheet.h" 28 #include "core/css/CSSStyleSheet.h"
28 #include "core/css/StylePropertySet.h" 29 #include "core/css/StylePropertySet.h"
29 #include "core/css/parser/CSSParser.h" 30 #include "core/css/parser/CSSParser.h"
30 #include "core/dom/Element.h" 31 #include "core/dom/Element.h"
31 #include "core/dom/MutationObserverInterestGroup.h" 32 #include "core/dom/MutationObserverInterestGroup.h"
32 #include "core/dom/MutationRecord.h" 33 #include "core/dom/MutationRecord.h"
33 #include "core/inspector/InspectorInstrumentation.h" 34 #include "core/inspector/InspectorInstrumentation.h"
34 #include "platform/RuntimeEnabledFeatures.h" 35 #include "platform/RuntimeEnabledFeatures.h"
35 36
36 namespace blink { 37 namespace blink {
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 m_parentElement->deref(); 387 m_parentElement->deref();
387 } 388 }
388 #endif 389 #endif
389 390
390 void InlineCSSStyleDeclaration::trace(Visitor* visitor) 391 void InlineCSSStyleDeclaration::trace(Visitor* visitor)
391 { 392 {
392 visitor->trace(m_parentElement); 393 visitor->trace(m_parentElement);
393 AbstractPropertySetCSSStyleDeclaration::trace(visitor); 394 AbstractPropertySetCSSStyleDeclaration::trace(visitor);
394 } 395 }
395 396
397 KeyframeStyleRuleCSSStyleDeclaration::KeyframeStyleRuleCSSStyleDeclaration(Mutab leStylePropertySet& propertySetArg, CSSKeyframeRule* parentRule)
398 : PropertySetCSSStyleDeclaration(propertySetArg)
399 #if !ENABLE(OILPAN)
400 , m_refCount(1)
401 #endif
402 , m_parentRule(parentRule)
403 {
404 #if !ENABLE(OILPAN)
405 m_propertySet->ref();
406 #endif
407 }
408
409 KeyframeStyleRuleCSSStyleDeclaration::~KeyframeStyleRuleCSSStyleDeclaration()
410 {
411 #if !ENABLE(OILPAN)
412 m_propertySet->deref();
413 #endif
414 }
415
416 #if !ENABLE(OILPAN)
417 void KeyframeStyleRuleCSSStyleDeclaration::ref()
418 {
419 ++m_refCount;
420 }
421
422 void KeyframeStyleRuleCSSStyleDeclaration::deref()
423 {
424 ASSERT(m_refCount);
425 if (!--m_refCount)
426 delete this;
427 }
428 #endif
429
430 void KeyframeStyleRuleCSSStyleDeclaration::willMutate()
431 {
432 if (m_parentRule && m_parentRule->parentStyleSheet())
433 m_parentRule->parentStyleSheet()->willMutateRules();
434 }
435
436 void KeyframeStyleRuleCSSStyleDeclaration::didMutate(MutationType type)
437 {
438 // Style sheet mutation needs to be signaled even if the change failed. will MutateRules/didMutateRules must pair.
439 if (m_parentRule && m_parentRule->parentStyleSheet())
440 m_parentRule->parentStyleSheet()->didMutateRules();
441 toCSSKeyframesRule(m_parentRule->parentRule())->styleChanged();
442 }
443
444 CSSStyleSheet* KeyframeStyleRuleCSSStyleDeclaration::parentStyleSheet() const
445 {
446 return m_parentRule ? m_parentRule->parentStyleSheet() : 0;
447 }
448
449 void KeyframeStyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& pro pertySet)
450 {
451 #if !ENABLE(OILPAN)
452 m_propertySet->deref();
453 #endif
454 m_propertySet = &propertySet;
455 #if !ENABLE(OILPAN)
456 m_propertySet->ref();
457 #endif
458 }
459
460 void KeyframeStyleRuleCSSStyleDeclaration::trace(Visitor* visitor)
461 {
462 visitor->trace(m_parentRule);
463 PropertySetCSSStyleDeclaration::trace(visitor);
464 }
465
396 } // namespace blink 466 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698