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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2520873002: [css-ui] Add support for caret-color property (Closed)
Patch Set: Fix tests that were listing all the CSS properties 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 other.m_rareInheritedData->visitedLinkTextFillColor() || 1124 other.m_rareInheritedData->visitedLinkTextFillColor() ||
1125 m_rareInheritedData->visitedLinkTextStrokeColor() != 1125 m_rareInheritedData->visitedLinkTextStrokeColor() !=
1126 other.m_rareInheritedData->visitedLinkTextStrokeColor() || 1126 other.m_rareInheritedData->visitedLinkTextStrokeColor() ||
1127 m_rareInheritedData->visitedLinkTextEmphasisColor() != 1127 m_rareInheritedData->visitedLinkTextEmphasisColor() !=
1128 other.m_rareInheritedData->visitedLinkTextEmphasisColor() || 1128 other.m_rareInheritedData->visitedLinkTextEmphasisColor() ||
1129 m_rareInheritedData->textEmphasisFill != 1129 m_rareInheritedData->textEmphasisFill !=
1130 other.m_rareInheritedData->textEmphasisFill || 1130 other.m_rareInheritedData->textEmphasisFill ||
1131 m_rareInheritedData->m_textDecorationSkip != 1131 m_rareInheritedData->m_textDecorationSkip !=
1132 other.m_rareInheritedData->m_textDecorationSkip || 1132 other.m_rareInheritedData->m_textDecorationSkip ||
1133 m_rareInheritedData->appliedTextDecorations != 1133 m_rareInheritedData->appliedTextDecorations !=
1134 other.m_rareInheritedData->appliedTextDecorations)) { 1134 other.m_rareInheritedData->appliedTextDecorations ||
1135 m_rareInheritedData->caretColor() !=
1136 other.m_rareInheritedData->caretColor() ||
1137 m_rareInheritedData->visitedLinkCaretColor() !=
1138 other.m_rareInheritedData->visitedLinkCaretColor())) {
1135 diff.setTextDecorationOrColorChanged(); 1139 diff.setTextDecorationOrColorChanged();
1136 } 1140 }
1137 } 1141 }
1138 } 1142 }
1139 1143
1140 void ComputedStyle::addPaintImage(StyleImage* image) { 1144 void ComputedStyle::addPaintImage(StyleImage* image) {
1141 if (!m_rareNonInheritedData.access()->m_paintImages) { 1145 if (!m_rareNonInheritedData.access()->m_paintImages) {
1142 m_rareNonInheritedData.access()->m_paintImages = 1146 m_rareNonInheritedData.access()->m_paintImages =
1143 makeUnique<Vector<Persistent<StyleImage>>>(); 1147 makeUnique<Vector<Persistent<StyleImage>>>();
1144 } 1148 }
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 break; 2072 break;
2069 case CSSPropertyBorderTopColor: 2073 case CSSPropertyBorderTopColor:
2070 result = visitedLink ? visitedLinkBorderTopColor() : borderTopColor(); 2074 result = visitedLink ? visitedLinkBorderTopColor() : borderTopColor();
2071 borderStyle = borderTopStyle(); 2075 borderStyle = borderTopStyle();
2072 break; 2076 break;
2073 case CSSPropertyBorderBottomColor: 2077 case CSSPropertyBorderBottomColor:
2074 result = 2078 result =
2075 visitedLink ? visitedLinkBorderBottomColor() : borderBottomColor(); 2079 visitedLink ? visitedLinkBorderBottomColor() : borderBottomColor();
2076 borderStyle = borderBottomStyle(); 2080 borderStyle = borderBottomStyle();
2077 break; 2081 break;
2082 case CSSPropertyCaretColor:
2083 result = visitedLink ? visitedLinkCaretColor() : caretColor();
2084 if (result.isAutoColor())
Timothy Loh 2016/11/22 02:17:35 Maybe this logic for resolving auto is better in p
Manuel Rego 2016/11/22 09:36:01 If we don't do this here, we need to modify the if
2085 result = StyleColor::currentColor();
yosin_UTC9 2016/11/22 02:25:10 Could you add TODO for improving "auto" color hand
Manuel Rego 2016/11/22 09:36:01 Sure that would allow us to pass: caret-color-006.
2086 break;
2078 case CSSPropertyColor: 2087 case CSSPropertyColor:
2079 result = visitedLink ? visitedLinkColor() : color(); 2088 result = visitedLink ? visitedLinkColor() : color();
2080 break; 2089 break;
2081 case CSSPropertyOutlineColor: 2090 case CSSPropertyOutlineColor:
2082 result = visitedLink ? visitedLinkOutlineColor() : outlineColor(); 2091 result = visitedLink ? visitedLinkOutlineColor() : outlineColor();
2083 break; 2092 break;
2084 case CSSPropertyColumnRuleColor: 2093 case CSSPropertyColumnRuleColor:
2085 result = visitedLink ? visitedLinkColumnRuleColor() : columnRuleColor(); 2094 result = visitedLink ? visitedLinkColumnRuleColor() : columnRuleColor();
2086 break; 2095 break;
2087 case CSSPropertyWebkitTextEmphasisColor: 2096 case CSSPropertyWebkitTextEmphasisColor:
(...skipping 20 matching lines...) Expand all
2108 break; 2117 break;
2109 case CSSPropertyTextDecorationColor: 2118 case CSSPropertyTextDecorationColor:
2110 result = decorationColorIncludingFallback(visitedLink); 2119 result = decorationColorIncludingFallback(visitedLink);
2111 break; 2120 break;
2112 default: 2121 default:
2113 ASSERT_NOT_REACHED(); 2122 ASSERT_NOT_REACHED();
2114 break; 2123 break;
2115 } 2124 }
2116 2125
2117 if (!result.isCurrentColor()) 2126 if (!result.isCurrentColor())
2118 return result.getColor(); 2127 return result.getColor();
Manuel Rego 2016/11/22 09:36:01 The call to getColor() will ASSERT if it's "auto".
2119 2128
2120 // FIXME: Treating styled borders with initial color differently causes 2129 // FIXME: Treating styled borders with initial color differently causes
2121 // problems, see crbug.com/316559, crbug.com/276231 2130 // problems, see crbug.com/316559, crbug.com/276231
2122 if (!visitedLink && 2131 if (!visitedLink &&
2123 (borderStyle == BorderStyleInset || borderStyle == BorderStyleOutset || 2132 (borderStyle == BorderStyleInset || borderStyle == BorderStyleOutset ||
2124 borderStyle == BorderStyleRidge || borderStyle == BorderStyleGroove)) 2133 borderStyle == BorderStyleRidge || borderStyle == BorderStyleGroove))
2125 return Color(238, 238, 238); 2134 return Color(238, 238, 238);
2126 return visitedLink ? visitedLinkColor() : color(); 2135 return visitedLink ? visitedLinkColor() : color();
2127 } 2136 }
2128 2137
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 if (value < 0) 2455 if (value < 0)
2447 fvalue -= 0.5f; 2456 fvalue -= 0.5f;
2448 else 2457 else
2449 fvalue += 0.5f; 2458 fvalue += 0.5f;
2450 } 2459 }
2451 2460
2452 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2461 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2453 } 2462 }
2454 2463
2455 } // namespace blink 2464 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698