Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingStyle.cpp

Issue 2532873002: Get rid of wrong assumption in reconcileTextDecorationProperties() (Closed)
Patch Set: 2016-11-28T18:40:32 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/execCommand/insert-list-and-strikethrough.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 1702
1703 DEFINE_TRACE(EditingStyle) { 1703 DEFINE_TRACE(EditingStyle) {
1704 visitor->trace(m_mutableStyle); 1704 visitor->trace(m_mutableStyle);
1705 } 1705 }
1706 1706
1707 static void reconcileTextDecorationProperties(MutableStylePropertySet* style) { 1707 static void reconcileTextDecorationProperties(MutableStylePropertySet* style) {
1708 const CSSValue* textDecorationsInEffect = 1708 const CSSValue* textDecorationsInEffect =
1709 style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect); 1709 style->getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
1710 const CSSValue* textDecoration = 1710 const CSSValue* textDecoration =
1711 style->getPropertyCSSValue(textDecorationPropertyForEditing()); 1711 style->getPropertyCSSValue(textDecorationPropertyForEditing());
1712 // We shouldn't have both text-decoration and 1712 // "LayoutTests/editing/execCommand/insert-list-and-strikethrough.html" makes
1713 // -webkit-text-decorations-in-effect because that wouldn't make sense. 1713 // both |textDecorationsInEffect| and |textDecoration| non-null.
1714 DCHECK(!textDecorationsInEffect || !textDecoration);
1715 if (textDecorationsInEffect) { 1714 if (textDecorationsInEffect) {
1716 style->setProperty(textDecorationPropertyForEditing(), 1715 style->setProperty(textDecorationPropertyForEditing(),
1717 textDecorationsInEffect->cssText()); 1716 textDecorationsInEffect->cssText());
1718 style->removeProperty(CSSPropertyWebkitTextDecorationsInEffect); 1717 style->removeProperty(CSSPropertyWebkitTextDecorationsInEffect);
1719 textDecoration = textDecorationsInEffect; 1718 textDecoration = textDecorationsInEffect;
1720 } 1719 }
1721 1720
1722 // If text-decoration is set to "none", remove the property because we don't 1721 // If text-decoration is set to "none", remove the property because we don't
1723 // want to add redundant "text-decoration: none". 1722 // want to add redundant "text-decoration: none".
1724 if (textDecoration && !textDecoration->isValueList()) 1723 if (textDecoration && !textDecoration->isValueList())
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 2036 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
2038 CSSComputedStyleDeclaration* ancestorStyle = 2037 CSSComputedStyleDeclaration* ancestorStyle =
2039 CSSComputedStyleDeclaration::create(ancestor); 2038 CSSComputedStyleDeclaration::create(ancestor);
2040 if (!hasTransparentBackgroundColor(ancestorStyle)) 2039 if (!hasTransparentBackgroundColor(ancestorStyle))
2041 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor); 2040 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor);
2042 } 2041 }
2043 return nullptr; 2042 return nullptr;
2044 } 2043 }
2045 2044
2046 } // namespace blink 2045 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/execCommand/insert-list-and-strikethrough.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698