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

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

Issue 992903002: Oilpan: implement StyleRuleList without an extra wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 if (mode == OverrideValues || (mode == DoNotOverrideValues && !value)) 1129 if (mode == OverrideValues || (mode == DoNotOverrideValues && !value))
1130 m_mutableStyle->setProperty(property.id(), property.value()->cssText (), property.isImportant()); 1130 m_mutableStyle->setProperty(property.id(), property.value()->cssText (), property.isImportant());
1131 } 1131 }
1132 } 1132 }
1133 1133
1134 static PassRefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRulesForE lement(Element* element, unsigned rulesToInclude) 1134 static PassRefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRulesForE lement(Element* element, unsigned rulesToInclude)
1135 { 1135 {
1136 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet: :create(); 1136 RefPtrWillBeRawPtr<MutableStylePropertySet> style = MutableStylePropertySet: :create();
1137 RefPtrWillBeRawPtr<StyleRuleList> matchedRules = element->document().ensureS tyleResolver().styleRulesForElement(element, rulesToInclude); 1137 RefPtrWillBeRawPtr<StyleRuleList> matchedRules = element->document().ensureS tyleResolver().styleRulesForElement(element, rulesToInclude);
1138 if (matchedRules) { 1138 if (matchedRules) {
1139 for (unsigned i = 0; i < matchedRules->m_list.size(); ++i) 1139 for (unsigned i = 0; i < matchedRules->size(); ++i)
1140 style->mergeAndOverrideOnConflict(&matchedRules->m_list[i]->properti es()); 1140 style->mergeAndOverrideOnConflict(&matchedRules->at(i)->properties() );
1141 } 1141 }
1142 return style.release(); 1142 return style.release();
1143 } 1143 }
1144 1144
1145 void EditingStyle::mergeStyleFromRules(Element* element) 1145 void EditingStyle::mergeStyleFromRules(Element* element)
1146 { 1146 {
1147 RefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFro mMatchedRulesForElement(element, 1147 RefPtrWillBeRawPtr<MutableStylePropertySet> styleFromMatchedRules = styleFro mMatchedRulesForElement(element,
1148 StyleResolver::AuthorCSSRules | StyleResolver::CrossOriginCSSRules); 1148 StyleResolver::AuthorCSSRules | StyleResolver::CrossOriginCSSRules);
1149 // Styles from the inline style declaration, held in the variable "style", t ake precedence 1149 // Styles from the inline style declaration, held in the variable "style", t ake precedence
1150 // over those from matched rules. 1150 // over those from matched rules.
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 { 1678 {
1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); 1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor);
1681 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1681 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1683 } 1683 }
1684 return nullptr; 1684 return nullptr;
1685 } 1685 }
1686 1686
1687 } 1687 }
OLDNEW
« Source/core/css/ElementRuleCollector.h ('K') | « Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698