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

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

Issue 1094003002: CSSStyleDeclaration::setProperty should override important style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review feedback Created 5 years, 8 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 | « Source/core/css/resolver/ViewportStyleResolver.cpp ('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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 RefPtrWillBeRawPtr<MutableStylePropertySet> fromComputedStyle = MutableStyle PropertySet::create(); 1166 RefPtrWillBeRawPtr<MutableStylePropertySet> fromComputedStyle = MutableStyle PropertySet::create();
1167 { 1167 {
1168 unsigned propertyCount = m_mutableStyle->propertyCount(); 1168 unsigned propertyCount = m_mutableStyle->propertyCount();
1169 for (unsigned i = 0; i < propertyCount; ++i) { 1169 for (unsigned i = 0; i < propertyCount; ++i) {
1170 StylePropertySet::PropertyReference property = m_mutableStyle->prope rtyAt(i); 1170 StylePropertySet::PropertyReference property = m_mutableStyle->prope rtyAt(i);
1171 CSSValue* value = property.value(); 1171 CSSValue* value = property.value();
1172 if (!value->isPrimitiveValue()) 1172 if (!value->isPrimitiveValue())
1173 continue; 1173 continue;
1174 if (toCSSPrimitiveValue(value)->isPercentage()) { 1174 if (toCSSPrimitiveValue(value)->isPercentage()) {
1175 if (RefPtrWillBeRawPtr<CSSValue> computedPropertyValue = compute dStyleForElement->getPropertyCSSValue(property.id())) 1175 if (RefPtrWillBeRawPtr<CSSValue> computedPropertyValue = compute dStyleForElement->getPropertyCSSValue(property.id()))
1176 fromComputedStyle->addParsedProperty(CSSProperty(property.id (), computedPropertyValue)); 1176 fromComputedStyle->addRespectingCascade(CSSProperty(property .id(), computedPropertyValue));
1177 } 1177 }
1178 } 1178 }
1179 } 1179 }
1180 m_mutableStyle->mergeAndOverrideOnConflict(fromComputedStyle.get()); 1180 m_mutableStyle->mergeAndOverrideOnConflict(fromComputedStyle.get());
1181 } 1181 }
1182 1182
1183 static void removePropertiesInStyle(MutableStylePropertySet* styleToRemoveProper tiesFrom, StylePropertySet* style) 1183 static void removePropertiesInStyle(MutableStylePropertySet* styleToRemoveProper tiesFrom, StylePropertySet* style)
1184 { 1184 {
1185 unsigned propertyCount = style->propertyCount(); 1185 unsigned propertyCount = style->propertyCount();
1186 Vector<CSSPropertyID> propertiesToRemove(propertyCount); 1186 Vector<CSSPropertyID> propertiesToRemove(propertyCount);
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 { 1679 {
1680 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1680 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1681 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); 1681 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor);
1682 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1682 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1683 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1683 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1684 } 1684 }
1685 return nullptr; 1685 return nullptr;
1686 } 1686 }
1687 1687
1688 } 1688 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/ViewportStyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698