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 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 | 956 |
957 // 2. Remove style present in context and not overriden by matched rules. | 957 // 2. Remove style present in context and not overriden by matched rules. |
958 RefPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingIn
heritablePropertiesAndBackgroundColorInEffect); | 958 RefPtr<EditingStyle> computedStyle = EditingStyle::create(context, EditingIn
heritablePropertiesAndBackgroundColorInEffect); |
959 if (computedStyle->m_mutableStyle) { | 959 if (computedStyle->m_mutableStyle) { |
960 computedStyle->removePropertiesInElementDefaultStyle(element); | 960 computedStyle->removePropertiesInElementDefaultStyle(element); |
961 m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle-
>m_mutableStyle.get()); | 961 m_mutableStyle = getPropertiesNotIn(m_mutableStyle.get(), computedStyle-
>m_mutableStyle.get()); |
962 } | 962 } |
963 | 963 |
964 // 3. If this element is a span and has display: inline or float: none, remo
ve them unless they are overriden by rules. | 964 // 3. If this element is a span and has display: inline or float: none, remo
ve them unless they are overriden by rules. |
965 // These rules are added by serialization code to wrap text nodes. | 965 // These rules are added by serialization code to wrap text nodes. |
966 if (isStyleSpanOrSpanWithOnlyStyleAttribute(element)) { | 966 if (isStyleSpan(element)) { |
967 if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyDisplay) && g
etIdentifierValue(m_mutableStyle.get(), CSSPropertyDisplay) == CSSValueInline) | 967 if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyDisplay) && g
etIdentifierValue(m_mutableStyle.get(), CSSPropertyDisplay) == CSSValueInline) |
968 m_mutableStyle->removeProperty(CSSPropertyDisplay); | 968 m_mutableStyle->removeProperty(CSSPropertyDisplay); |
969 if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && get
IdentifierValue(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone) | 969 if (!styleFromMatchedRules->getPropertyCSSValue(CSSPropertyFloat) && get
IdentifierValue(m_mutableStyle.get(), CSSPropertyFloat) == CSSValueNone) |
970 m_mutableStyle->removeProperty(CSSPropertyFloat); | 970 m_mutableStyle->removeProperty(CSSPropertyFloat); |
971 } | 971 } |
972 } | 972 } |
973 | 973 |
974 void EditingStyle::removePropertiesInElementDefaultStyle(Element* element) | 974 void EditingStyle::removePropertiesInElementDefaultStyle(Element* element) |
975 { | 975 { |
976 if (!m_mutableStyle || !m_mutableStyle->length()) | 976 if (!m_mutableStyle || !m_mutableStyle->length()) |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 { | 1266 { |
1267 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1267 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
1268 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = computedStyle(ancest
or); | 1268 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = computedStyle(ancest
or); |
1269 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1269 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
1270 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1270 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
1271 } | 1271 } |
1272 return 0; | 1272 return 0; |
1273 } | 1273 } |
1274 | 1274 |
1275 } | 1275 } |
OLD | NEW |