| 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 12 matching lines...) Expand all Loading... |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/editing/EditingStyle.h" | 28 #include "core/editing/EditingStyle.h" |
| 29 | 29 |
| 30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
| 31 #include "bindings/v8/ExceptionStatePlaceholder.h" | 31 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 32 #include "core/css/CSSComputedStyleDeclaration.h" | 32 #include "core/css/CSSComputedStyleDeclaration.h" |
| 33 #include "core/css/CSSParser.h" | 33 #include "core/css/parser/BisonCSSParser.h" |
| 34 #include "core/css/CSSRuleList.h" | 34 #include "core/css/CSSRuleList.h" |
| 35 #include "core/css/CSSStyleRule.h" | 35 #include "core/css/CSSStyleRule.h" |
| 36 #include "core/css/CSSValueList.h" | 36 #include "core/css/CSSValueList.h" |
| 37 #include "core/css/FontSize.h" | 37 #include "core/css/FontSize.h" |
| 38 #include "core/css/RuntimeCSSEnabled.h" | 38 #include "core/css/RuntimeCSSEnabled.h" |
| 39 #include "core/css/StylePropertySet.h" | 39 #include "core/css/StylePropertySet.h" |
| 40 #include "core/css/StyleRule.h" | 40 #include "core/css/StyleRule.h" |
| 41 #include "core/css/resolver/StyleResolver.h" | 41 #include "core/css/resolver/StyleResolver.h" |
| 42 #include "core/dom/Element.h" | 42 #include "core/dom/Element.h" |
| 43 #include "core/dom/Node.h" | 43 #include "core/dom/Node.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 static RGBA32 cssValueToRGBA(CSSValue* colorValue) | 380 static RGBA32 cssValueToRGBA(CSSValue* colorValue) |
| 381 { | 381 { |
| 382 if (!colorValue || !colorValue->isPrimitiveValue()) | 382 if (!colorValue || !colorValue->isPrimitiveValue()) |
| 383 return Color::transparent; | 383 return Color::transparent; |
| 384 | 384 |
| 385 CSSPrimitiveValue* primitiveColor = toCSSPrimitiveValue(colorValue); | 385 CSSPrimitiveValue* primitiveColor = toCSSPrimitiveValue(colorValue); |
| 386 if (primitiveColor->isRGBColor()) | 386 if (primitiveColor->isRGBColor()) |
| 387 return primitiveColor->getRGBA32Value(); | 387 return primitiveColor->getRGBA32Value(); |
| 388 | 388 |
| 389 RGBA32 rgba = 0; | 389 RGBA32 rgba = 0; |
| 390 CSSParser::parseColor(rgba, colorValue->cssText()); | 390 BisonCSSParser::parseColor(rgba, colorValue->cssText()); |
| 391 return rgba; | 391 return rgba; |
| 392 } | 392 } |
| 393 | 393 |
| 394 static inline RGBA32 getRGBAFontColor(CSSStyleDeclaration* style) | 394 static inline RGBA32 getRGBAFontColor(CSSStyleDeclaration* style) |
| 395 { | 395 { |
| 396 return cssValueToRGBA(style->getPropertyCSSValueInternal(CSSPropertyColor).g
et()); | 396 return cssValueToRGBA(style->getPropertyCSSValueInternal(CSSPropertyColor).g
et()); |
| 397 } | 397 } |
| 398 | 398 |
| 399 static inline RGBA32 getRGBAFontColor(StylePropertySet* style) | 399 static inline RGBA32 getRGBAFontColor(StylePropertySet* style) |
| 400 { | 400 { |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 { | 1649 { |
| 1650 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1650 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
| 1651 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); | 1651 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl
aration::create(ancestor); |
| 1652 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1652 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
| 1653 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1653 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
| 1654 } | 1654 } |
| 1655 return 0; | 1655 return 0; |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 } | 1658 } |
| OLD | NEW |