| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 CSSKeyframeRule::~CSSKeyframeRule() | 43 CSSKeyframeRule::~CSSKeyframeRule() |
| 44 { | 44 { |
| 45 #if !ENABLE(OILPAN) | 45 #if !ENABLE(OILPAN) |
| 46 if (m_propertiesCSSOMWrapper) | 46 if (m_propertiesCSSOMWrapper) |
| 47 m_propertiesCSSOMWrapper->clearParentRule(); | 47 m_propertiesCSSOMWrapper->clearParentRule(); |
| 48 #endif | 48 #endif |
| 49 } | 49 } |
| 50 | 50 |
| 51 void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptio
nState) | 51 void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptio
nState) |
| 52 { | 52 { |
| 53 CSSStyleSheet::RuleMutationScope(this); |
| 54 |
| 53 if (!m_keyframe->setKeyText(keyText)) | 55 if (!m_keyframe->setKeyText(keyText)) |
| 54 exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "'
is invalid and cannot be parsed"); | 56 exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "'
is invalid and cannot be parsed"); |
| 55 | 57 |
| 56 toCSSKeyframesRule(parentRule())->styleChanged(); | 58 toCSSKeyframesRule(parentRule())->styleChanged(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 CSSStyleDeclaration* CSSKeyframeRule::style() const | 61 CSSStyleDeclaration* CSSKeyframeRule::style() const |
| 60 { | 62 { |
| 61 if (!m_propertiesCSSOMWrapper) | 63 if (!m_propertiesCSSOMWrapper) |
| 62 m_propertiesCSSOMWrapper = KeyframeStyleRuleCSSStyleDeclaration::create(
m_keyframe->mutableProperties(), const_cast<CSSKeyframeRule*>(this)); | 64 m_propertiesCSSOMWrapper = KeyframeStyleRuleCSSStyleDeclaration::create(
m_keyframe->mutableProperties(), const_cast<CSSKeyframeRule*>(this)); |
| 63 return m_propertiesCSSOMWrapper.get(); | 65 return m_propertiesCSSOMWrapper.get(); |
| 64 } | 66 } |
| 65 | 67 |
| 66 void CSSKeyframeRule::reattach(StyleRuleBase*) | 68 void CSSKeyframeRule::reattach(StyleRuleBase*) |
| 67 { | 69 { |
| 68 // No need to reattach, the underlying data is shareable on mutation. | 70 // No need to reattach, the underlying data is shareable on mutation. |
| 69 ASSERT_NOT_REACHED(); | 71 ASSERT_NOT_REACHED(); |
| 70 } | 72 } |
| 71 | 73 |
| 72 DEFINE_TRACE(CSSKeyframeRule) | 74 DEFINE_TRACE(CSSKeyframeRule) |
| 73 { | 75 { |
| 74 visitor->trace(m_keyframe); | 76 visitor->trace(m_keyframe); |
| 75 visitor->trace(m_propertiesCSSOMWrapper); | 77 visitor->trace(m_propertiesCSSOMWrapper); |
| 76 CSSRule::trace(visitor); | 78 CSSRule::trace(visitor); |
| 77 } | 79 } |
| 78 | 80 |
| 79 } // namespace blink | 81 } // namespace blink |
| OLD | NEW |