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

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: Add new baselines for Mac and Windows 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 StyleAutoColor autoColor =
2084 visitedLink ? visitedLinkCaretColor() : caretColor();
2085 // TODO(rego): We may want to adjust the caret color if it's the same than
2086 // the background to ensure good visibility and contrast.
2087 result = autoColor.isAutoColor() ? StyleColor::currentColor() : autoColor;
2088 break;
2089 }
2078 case CSSPropertyColor: 2090 case CSSPropertyColor:
2079 result = visitedLink ? visitedLinkColor() : color(); 2091 result = visitedLink ? visitedLinkColor() : color();
2080 break; 2092 break;
2081 case CSSPropertyOutlineColor: 2093 case CSSPropertyOutlineColor:
2082 result = visitedLink ? visitedLinkOutlineColor() : outlineColor(); 2094 result = visitedLink ? visitedLinkOutlineColor() : outlineColor();
2083 break; 2095 break;
2084 case CSSPropertyColumnRuleColor: 2096 case CSSPropertyColumnRuleColor:
2085 result = visitedLink ? visitedLinkColumnRuleColor() : columnRuleColor(); 2097 result = visitedLink ? visitedLinkColumnRuleColor() : columnRuleColor();
2086 break; 2098 break;
2087 case CSSPropertyWebkitTextEmphasisColor: 2099 case CSSPropertyWebkitTextEmphasisColor:
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 if (value < 0) 2458 if (value < 0)
2447 fvalue -= 0.5f; 2459 fvalue -= 0.5f;
2448 else 2460 else
2449 fvalue += 0.5f; 2461 fvalue += 0.5f;
2450 } 2462 }
2451 2463
2452 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2464 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2453 } 2465 }
2454 2466
2455 } // namespace blink 2467 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698