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

Unified Diff: Source/WebCore/editing/EditingStyle.cpp

Issue 8493001: Merge 99067 - REGRESSION(r96870): WebKit generates background: transparent on blogger.com (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/editing/EditingStyle.cpp
===================================================================
--- Source/WebCore/editing/EditingStyle.cpp (revision 99392)
+++ Source/WebCore/editing/EditingStyle.cpp (working copy)
@@ -1056,6 +1056,17 @@
m_mutableStyle->merge(fromComputedStyle.get());
}
+static void removePropertiesInStyle(CSSMutableStyleDeclaration* styleToRemovePropertiesFrom, CSSMutableStyleDeclaration* style)
+{
+ Vector<int> propertiesToRemove(style->length());
+ size_t i = 0;
+ CSSMutableStyleDeclaration::const_iterator end = style->end();
+ for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it, ++i)
+ propertiesToRemove[i] = it->id();
+
+ styleToRemovePropertiesFrom->removePropertiesInSet(propertiesToRemove.data(), propertiesToRemove.size());
+}
+
void EditingStyle::removeStyleFromRulesAndContext(StyledElement* element, Node* context)
{
ASSERT(element);
@@ -1070,7 +1081,10 @@
// 2. Remove style present in context and not overriden by matched rules.
RefPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingInheritablePropertiesAndBackgroundColorInEffect);
if (computedStyle->m_mutableStyle) {
- computedStyle->removePropertiesInElementDefaultStyle(element);
+ if (!computedStyle->m_mutableStyle->getPropertyCSSValue(CSSPropertyBackgroundColor))
+ computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColor, CSSValueTransparent);
+
+ removePropertiesInStyle(computedStyle->m_mutableStyle.get(), styleFromMatchedRules.get());
m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle->m_mutableStyle.get());
}
@@ -1091,13 +1105,7 @@
RefPtr<CSSMutableStyleDeclaration> defaultStyle = styleFromMatchedRulesForElement(element, CSSStyleSelector::UAAndUserCSSRules);
- Vector<int> propertiesToRemove(defaultStyle->length());
- size_t i = 0;
- CSSMutableStyleDeclaration::const_iterator end = defaultStyle->end();
- for (CSSMutableStyleDeclaration::const_iterator it = defaultStyle->begin(); it != end; ++it, ++i)
- propertiesToRemove[i] = it->id();
-
- m_mutableStyle->removePropertiesInSet(propertiesToRemove.data(), propertiesToRemove.size());
+ removePropertiesInStyle(m_mutableStyle.get(), defaultStyle.get());
}
void EditingStyle::forceInline()
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698