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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 } | 1028 } |
1029 | 1029 |
1030 ASSERT_NOT_REACHED(); | 1030 ASSERT_NOT_REACHED(); |
1031 return nullptr; | 1031 return nullptr; |
1032 } | 1032 } |
1033 | 1033 |
1034 void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPro
pertyOverrideMode mode, PropertiesToInclude propertiesToInclude) | 1034 void EditingStyle::mergeInlineAndImplicitStyleOfElement(Element* element, CSSPro
pertyOverrideMode mode, PropertiesToInclude propertiesToInclude) |
1035 { | 1035 { |
1036 RefPtrWillBeRawPtr<EditingStyle> styleFromRules = EditingStyle::create(); | 1036 RefPtrWillBeRawPtr<EditingStyle> styleFromRules = EditingStyle::create(); |
1037 styleFromRules->mergeStyleFromRulesForSerialization(element); | 1037 styleFromRules->mergeStyleFromRulesForSerialization(element); |
| 1038 |
| 1039 if (element->inlineStyle()) |
| 1040 styleFromRules->m_mutableStyle->mergeAndOverrideOnConflict(element->inli
neStyle()); |
| 1041 |
1038 styleFromRules->m_mutableStyle = extractEditingProperties(styleFromRules->m_
mutableStyle.get(), propertiesToInclude); | 1042 styleFromRules->m_mutableStyle = extractEditingProperties(styleFromRules->m_
mutableStyle.get(), propertiesToInclude); |
1039 mergeStyle(styleFromRules->m_mutableStyle.get(), mode); | 1043 mergeStyle(styleFromRules->m_mutableStyle.get(), mode); |
1040 | 1044 |
1041 mergeInlineStyleOfElement(element, mode, propertiesToInclude); | |
1042 | |
1043 const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent> >& elementE
quivalents = htmlElementEquivalents(); | 1045 const WillBeHeapVector<OwnPtrWillBeMember<HTMLElementEquivalent> >& elementE
quivalents = htmlElementEquivalents(); |
1044 for (size_t i = 0; i < elementEquivalents.size(); ++i) { | 1046 for (size_t i = 0; i < elementEquivalents.size(); ++i) { |
1045 if (elementMatchesAndPropertyIsNotInInlineStyleDecl(elementEquivalents[i
].get(), element, mode, m_mutableStyle.get())) | 1047 if (elementMatchesAndPropertyIsNotInInlineStyleDecl(elementEquivalents[i
].get(), element, mode, m_mutableStyle.get())) |
1046 elementEquivalents[i]->addToStyle(element, this); | 1048 elementEquivalents[i]->addToStyle(element, this); |
1047 } | 1049 } |
1048 | 1050 |
1049 const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent> >& attrib
uteEquivalents = htmlAttributeEquivalents(); | 1051 const WillBeHeapVector<OwnPtrWillBeMember<HTMLAttributeEquivalent> >& attrib
uteEquivalents = htmlAttributeEquivalents(); |
1050 for (size_t i = 0; i < attributeEquivalents.size(); ++i) { | 1052 for (size_t i = 0; i < attributeEquivalents.size(); ++i) { |
1051 if (attributeEquivalents[i]->attributeName() == HTMLNames::dirAttr) | 1053 if (attributeEquivalents[i]->attributeName() == HTMLNames::dirAttr) |
1052 continue; // We don't want to include directionality | 1054 continue; // We don't want to include directionality |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 { | 1675 { |
1674 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1676 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
1675 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu
tedStyleDeclaration::create(ancestor); | 1677 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu
tedStyleDeclaration::create(ancestor); |
1676 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1678 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
1677 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1679 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
1678 } | 1680 } |
1679 return nullptr; | 1681 return nullptr; |
1680 } | 1682 } |
1681 | 1683 |
1682 } | 1684 } |
OLD | NEW |