| 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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 | 1060 |
| 1061 PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization
(Node* context, bool shouldAnnotate) | 1061 PassRefPtrWillBeRawPtr<EditingStyle> EditingStyle::wrappingStyleForSerialization
(Node* context, bool shouldAnnotate) |
| 1062 { | 1062 { |
| 1063 RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = nullptr; | 1063 RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = nullptr; |
| 1064 if (shouldAnnotate) { | 1064 if (shouldAnnotate) { |
| 1065 wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPrope
rtiesInEffect); | 1065 wrappingStyle = EditingStyle::create(context, EditingStyle::EditingPrope
rtiesInEffect); |
| 1066 | 1066 |
| 1067 // Styles that Mail blockquotes contribute should only be placed on the
Mail blockquote, | 1067 // Styles that Mail blockquotes contribute should only be placed on the
Mail blockquote, |
| 1068 // to help us differentiate those styles from ones that the user has app
lied. | 1068 // to help us differentiate those styles from ones that the user has app
lied. |
| 1069 // This helps us get the color of content pasted into blockquotes right. | 1069 // This helps us get the color of content pasted into blockquotes right. |
| 1070 wrappingStyle->removeStyleAddedByNode(enclosingNodeOfType(firstPositionI
nOrBeforeNode(context), isMailBlockquote, CanCrossEditingBoundary)); | 1070 wrappingStyle->removeStyleAddedByNode(enclosingNodeOfType(firstPositionI
nOrBeforeNode(context), isMailHTMLBlockquoteElement, CanCrossEditingBoundary)); |
| 1071 | 1071 |
| 1072 // Call collapseTextDecorationProperties first or otherwise it'll copy t
he value over from in-effect to text-decorations. | 1072 // Call collapseTextDecorationProperties first or otherwise it'll copy t
he value over from in-effect to text-decorations. |
| 1073 wrappingStyle->collapseTextDecorationProperties(); | 1073 wrappingStyle->collapseTextDecorationProperties(); |
| 1074 | 1074 |
| 1075 return wrappingStyle.release(); | 1075 return wrappingStyle.release(); |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 wrappingStyle = EditingStyle::create(); | 1078 wrappingStyle = EditingStyle::create(); |
| 1079 | 1079 |
| 1080 // When not annotating for interchange, we only preserve inline style declar
ations. | 1080 // When not annotating for interchange, we only preserve inline style declar
ations. |
| 1081 for (Node* node = context; node && !node->isDocumentNode(); node = node->par
entNode()) { | 1081 for (Node* node = context; node && !node->isDocumentNode(); node = node->par
entNode()) { |
| 1082 if (node->isStyledElement() && !isMailBlockquote(node)) { | 1082 if (node->isStyledElement() && !isMailHTMLBlockquoteElement(node)) { |
| 1083 wrappingStyle->mergeInlineAndImplicitStyleOfElement(toElement(node),
EditingStyle::DoNotOverrideValues, | 1083 wrappingStyle->mergeInlineAndImplicitStyleOfElement(toElement(node),
EditingStyle::DoNotOverrideValues, |
| 1084 EditingStyle::EditingPropertiesInEffect); | 1084 EditingStyle::EditingPropertiesInEffect); |
| 1085 } | 1085 } |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 return wrappingStyle.release(); | 1088 return wrappingStyle.release(); |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 | 1091 |
| 1092 static void mergeTextDecorationValues(CSSValueList* mergedValue, const CSSValueL
ist* valueToMerge) | 1092 static void mergeTextDecorationValues(CSSValueList* mergedValue, const CSSValueL
ist* valueToMerge) |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 { | 1676 { |
| 1677 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1677 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
| 1678 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu
tedStyleDeclaration::create(ancestor); | 1678 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu
tedStyleDeclaration::create(ancestor); |
| 1679 if (!hasTransparentBackgroundColor(ancestorStyle.get())) | 1679 if (!hasTransparentBackgroundColor(ancestorStyle.get())) |
| 1680 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1680 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
| 1681 } | 1681 } |
| 1682 return nullptr; | 1682 return nullptr; |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 } | 1685 } |
| OLD | NEW |