| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2008 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 28 matching lines...) Expand all Loading... |
| 39 , m_property(property) | 39 , m_property(property) |
| 40 , m_important(false) | 40 , m_important(false) |
| 41 { | 41 { |
| 42 ASSERT(m_element); | 42 ASSERT(m_element); |
| 43 } | 43 } |
| 44 | 44 |
| 45 RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand() | 45 RemoveCSSPropertyCommand::~RemoveCSSPropertyCommand() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void RemoveCSSPropertyCommand::doApply() | 49 void RemoveCSSPropertyCommand::doApply(EditingState*) |
| 50 { | 50 { |
| 51 const StylePropertySet* style = m_element->inlineStyle(); | 51 const StylePropertySet* style = m_element->inlineStyle(); |
| 52 if (!style) | 52 if (!style) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 m_oldValue = style->getPropertyValue(m_property); | 55 m_oldValue = style->getPropertyValue(m_property); |
| 56 m_important = style->propertyIsImportant(m_property); | 56 m_important = style->propertyIsImportant(m_property); |
| 57 | 57 |
| 58 // Mutate using the CSSOM wrapper so we get the same event behavior as a scr
ipt. | 58 // Mutate using the CSSOM wrapper so we get the same event behavior as a scr
ipt. |
| 59 // Setting to null string removes the property. We don't have internal versi
on of removeProperty. | 59 // Setting to null string removes the property. We don't have internal versi
on of removeProperty. |
| 60 m_element->style()->setPropertyInternal(m_property, String(), String(), fals
e, IGNORE_EXCEPTION); | 60 m_element->style()->setPropertyInternal(m_property, String(), String(), fals
e, IGNORE_EXCEPTION); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void RemoveCSSPropertyCommand::doUnapply() | 63 void RemoveCSSPropertyCommand::doUnapply() |
| 64 { | 64 { |
| 65 m_element->style()->setPropertyInternal(m_property, String(), m_oldValue, m_
important, IGNORE_EXCEPTION); | 65 m_element->style()->setPropertyInternal(m_property, String(), m_oldValue, m_
important, IGNORE_EXCEPTION); |
| 66 } | 66 } |
| 67 | 67 |
| 68 DEFINE_TRACE(RemoveCSSPropertyCommand) | 68 DEFINE_TRACE(RemoveCSSPropertyCommand) |
| 69 { | 69 { |
| 70 visitor->trace(m_element); | 70 visitor->trace(m_element); |
| 71 SimpleEditCommand::trace(visitor); | 71 SimpleEditCommand::trace(visitor); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |