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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingStyle.cpp

Issue 2147163002: Make removeStyleFromRulesAndContext() to use style resolver after distribution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-14T12:46:21 Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/execCommand/insert_list/insert_list_in_summary_crash.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. 2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc.
3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 1242
1243 styleToRemovePropertiesFrom->removePropertiesInSet(propertiesToRemove.data() , propertiesToRemove.size()); 1243 styleToRemovePropertiesFrom->removePropertiesInSet(propertiesToRemove.data() , propertiesToRemove.size());
1244 } 1244 }
1245 1245
1246 void EditingStyle::removeStyleFromRulesAndContext(Element* element, ContainerNod e* context) 1246 void EditingStyle::removeStyleFromRulesAndContext(Element* element, ContainerNod e* context)
1247 { 1247 {
1248 DCHECK(element); 1248 DCHECK(element);
1249 if (!m_mutableStyle) 1249 if (!m_mutableStyle)
1250 return; 1250 return;
1251 1251
1252 // TODO(yosin): The use of updateStyleAndLayoutIgnorePendingStylesheets
1253 // needs to be audited. see http://crbug.com/590369 for more details.
1254 element->document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(elem ent);
1255
1252 // 1. Remove style from matched rules because style remain without repeating it in inline style declaration 1256 // 1. Remove style from matched rules because style remain without repeating it in inline style declaration
1253 MutableStylePropertySet* styleFromMatchedRules = styleFromMatchedRulesForEle ment(element, StyleResolver::AllButEmptyCSSRules); 1257 MutableStylePropertySet* styleFromMatchedRules = styleFromMatchedRulesForEle ment(element, StyleResolver::AllButEmptyCSSRules);
1254 if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty()) 1258 if (styleFromMatchedRules && !styleFromMatchedRules->isEmpty())
1255 m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatch edRules->ensureCSSStyleDeclaration()); 1259 m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), styleFromMatch edRules->ensureCSSStyleDeclaration());
1256 1260
1257 // 2. Remove style present in context and not overriden by matched rules. 1261 // 2. Remove style present in context and not overriden by matched rules.
1258 EditingStyle* computedStyle = EditingStyle::create(context, EditingPropertie sInEffect); 1262 EditingStyle* computedStyle = EditingStyle::create(context, EditingPropertie sInEffect);
1259 if (computedStyle->m_mutableStyle) { 1263 if (computedStyle->m_mutableStyle) {
1260 if (!computedStyle->m_mutableStyle->getPropertyCSSValue(CSSPropertyBackg roundColor)) 1264 if (!computedStyle->m_mutableStyle->getPropertyCSSValue(CSSPropertyBackg roundColor))
1261 computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColo r, CSSValueTransparent); 1265 computedStyle->m_mutableStyle->setProperty(CSSPropertyBackgroundColo r, CSSValueTransparent);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 { 1757 {
1754 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1758 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1755 CSSComputedStyleDeclaration* ancestorStyle = CSSComputedStyleDeclaration ::create(ancestor); 1759 CSSComputedStyleDeclaration* ancestorStyle = CSSComputedStyleDeclaration ::create(ancestor);
1756 if (!hasTransparentBackgroundColor(ancestorStyle)) 1760 if (!hasTransparentBackgroundColor(ancestorStyle))
1757 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1761 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1758 } 1762 }
1759 return nullptr; 1763 return nullptr;
1760 } 1764 }
1761 1765
1762 } // namespace blink 1766 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/execCommand/insert_list/insert_list_in_summary_crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698