| OLD | NEW |
| 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 | 1214 |
| 1215 // The property value, if it's a percentage, may not reflect the actual comp
uted value. | 1215 // The property value, if it's a percentage, may not reflect the actual comp
uted value. |
| 1216 // For example: style="height: 1%; overflow: visible;" in quirksmode | 1216 // For example: style="height: 1%; overflow: visible;" in quirksmode |
| 1217 // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot
copy/paste fidelity problem | 1217 // FIXME: There are others like this, see <rdar://problem/5195123> Slashdot
copy/paste fidelity problem |
| 1218 CSSComputedStyleDeclaration* computedStyleForElement = CSSComputedStyleDecla
ration::create(element); | 1218 CSSComputedStyleDeclaration* computedStyleForElement = CSSComputedStyleDecla
ration::create(element); |
| 1219 MutableStylePropertySet* fromComputedStyle = MutableStylePropertySet::create
(HTMLQuirksMode); | 1219 MutableStylePropertySet* fromComputedStyle = MutableStylePropertySet::create
(HTMLQuirksMode); |
| 1220 { | 1220 { |
| 1221 unsigned propertyCount = m_mutableStyle->propertyCount(); | 1221 unsigned propertyCount = m_mutableStyle->propertyCount(); |
| 1222 for (unsigned i = 0; i < propertyCount; ++i) { | 1222 for (unsigned i = 0; i < propertyCount; ++i) { |
| 1223 StylePropertySet::PropertyReference property = m_mutableStyle->prope
rtyAt(i); | 1223 StylePropertySet::PropertyReference property = m_mutableStyle->prope
rtyAt(i); |
| 1224 CSSValue* value = property.value(); | 1224 const CSSValue* value = property.value(); |
| 1225 if (!value->isPrimitiveValue()) | 1225 if (!value->isPrimitiveValue()) |
| 1226 continue; | 1226 continue; |
| 1227 if (toCSSPrimitiveValue(value)->isPercentage()) { | 1227 if (toCSSPrimitiveValue(value)->isPercentage()) { |
| 1228 if (const CSSValue* computedPropertyValue = computedStyleForElem
ent->getPropertyCSSValue(property.id())) | 1228 if (const CSSValue* computedPropertyValue = computedStyleForElem
ent->getPropertyCSSValue(property.id())) |
| 1229 fromComputedStyle->addRespectingCascade(CSSProperty(property
.id(), *computedPropertyValue)); | 1229 fromComputedStyle->addRespectingCascade(CSSProperty(property
.id(), *computedPropertyValue)); |
| 1230 } | 1230 } |
| 1231 } | 1231 } |
| 1232 } | 1232 } |
| 1233 m_mutableStyle->mergeAndOverrideOnConflict(fromComputedStyle); | 1233 m_mutableStyle->mergeAndOverrideOnConflict(fromComputedStyle); |
| 1234 } | 1234 } |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 { | 1757 { |
| 1758 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1758 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
| 1759 CSSComputedStyleDeclaration* ancestorStyle = CSSComputedStyleDeclaration
::create(ancestor); | 1759 CSSComputedStyleDeclaration* ancestorStyle = CSSComputedStyleDeclaration
::create(ancestor); |
| 1760 if (!hasTransparentBackgroundColor(ancestorStyle)) | 1760 if (!hasTransparentBackgroundColor(ancestorStyle)) |
| 1761 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1761 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
| 1762 } | 1762 } |
| 1763 return nullptr; | 1763 return nullptr; |
| 1764 } | 1764 } |
| 1765 | 1765 |
| 1766 } // namespace blink | 1766 } // namespace blink |
| OLD | NEW |