diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 14:36:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:38:30 +0100 |
commit | f05b935882198ccf7d81675736e3aeb089c5113a (patch) | |
tree | 4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/editing/EditingStyle.cpp | |
parent | 60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff) | |
download | external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2 |
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/editing/EditingStyle.cpp')
-rw-r--r-- | WebCore/editing/EditingStyle.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/WebCore/editing/EditingStyle.cpp b/WebCore/editing/EditingStyle.cpp index ad77696..c46c075 100644 --- a/WebCore/editing/EditingStyle.cpp +++ b/WebCore/editing/EditingStyle.cpp @@ -103,6 +103,10 @@ EditingStyle::EditingStyle(const CSSStyleDeclaration* style) { } +EditingStyle::~EditingStyle() +{ +} + void EditingStyle::init(Node* node) { RefPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = computedStyle(node); @@ -177,12 +181,42 @@ void EditingStyle::setStyle(PassRefPtr<CSSMutableStyleDeclaration> style) m_shouldUseFixedDefaultFontSize = false; } +void EditingStyle::overrideWithStyle(const CSSMutableStyleDeclaration* style) +{ + if (!style || !style->length()) + return; + if (!m_mutableStyle) + m_mutableStyle = CSSMutableStyleDeclaration::create(); + m_mutableStyle->merge(style); +} + void EditingStyle::clear() { m_mutableStyle.clear(); m_shouldUseFixedDefaultFontSize = false; } +PassRefPtr<EditingStyle> EditingStyle::copy() const +{ + RefPtr<EditingStyle> copy = EditingStyle::create(); + if (m_mutableStyle) + copy->m_mutableStyle = m_mutableStyle->copy(); + copy->m_shouldUseFixedDefaultFontSize = m_shouldUseFixedDefaultFontSize; + return copy; +} + +PassRefPtr<EditingStyle> EditingStyle::extractAndRemoveBlockProperties() +{ + RefPtr<EditingStyle> blockProperties = EditingStyle::create(); + if (!m_mutableStyle) + return blockProperties; + + blockProperties->m_mutableStyle = m_mutableStyle->copyBlockProperties(); + m_mutableStyle->removeBlockProperties(); + + return blockProperties; +} + void EditingStyle::removeBlockProperties() { if (!m_mutableStyle) |