OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 8 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 9 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 namespace { | 86 namespace { |
87 | 87 |
88 static inline bool isValidVisitedLinkProperty(CSSPropertyID id) { | 88 static inline bool isValidVisitedLinkProperty(CSSPropertyID id) { |
89 switch (id) { | 89 switch (id) { |
90 case CSSPropertyBackgroundColor: | 90 case CSSPropertyBackgroundColor: |
91 case CSSPropertyBorderLeftColor: | 91 case CSSPropertyBorderLeftColor: |
92 case CSSPropertyBorderRightColor: | 92 case CSSPropertyBorderRightColor: |
93 case CSSPropertyBorderTopColor: | 93 case CSSPropertyBorderTopColor: |
94 case CSSPropertyBorderBottomColor: | 94 case CSSPropertyBorderBottomColor: |
| 95 case CSSPropertyCaretColor: |
95 case CSSPropertyColor: | 96 case CSSPropertyColor: |
96 case CSSPropertyFill: | 97 case CSSPropertyFill: |
97 case CSSPropertyOutlineColor: | 98 case CSSPropertyOutlineColor: |
98 case CSSPropertyStroke: | 99 case CSSPropertyStroke: |
99 case CSSPropertyTextDecorationColor: | 100 case CSSPropertyTextDecorationColor: |
100 case CSSPropertyColumnRuleColor: | 101 case CSSPropertyColumnRuleColor: |
101 case CSSPropertyWebkitTextEmphasisColor: | 102 case CSSPropertyWebkitTextEmphasisColor: |
102 case CSSPropertyWebkitTextFillColor: | 103 case CSSPropertyWebkitTextFillColor: |
103 case CSSPropertyWebkitTextStrokeColor: | 104 case CSSPropertyWebkitTextStrokeColor: |
104 return true; | 105 return true; |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 NOTREACHED(); | 1035 NOTREACHED(); |
1035 } | 1036 } |
1036 } | 1037 } |
1037 | 1038 |
1038 void StyleBuilderFunctions::applyInheritCSSPropertyPosition( | 1039 void StyleBuilderFunctions::applyInheritCSSPropertyPosition( |
1039 StyleResolverState& state) { | 1040 StyleResolverState& state) { |
1040 if (!state.parentNode()->isDocumentNode()) | 1041 if (!state.parentNode()->isDocumentNode()) |
1041 state.style()->setPosition(state.parentStyle()->position()); | 1042 state.style()->setPosition(state.parentStyle()->position()); |
1042 } | 1043 } |
1043 | 1044 |
| 1045 void StyleBuilderFunctions::applyInitialCSSPropertyCaretColor( |
| 1046 StyleResolverState& state) { |
| 1047 StyleAutoColor color = StyleAutoColor::autoColor(); |
| 1048 if (state.applyPropertyToRegularStyle()) |
| 1049 state.style()->setCaretColor(color); |
| 1050 if (state.applyPropertyToVisitedLinkStyle()) |
| 1051 state.style()->setVisitedLinkCaretColor(color); |
| 1052 } |
| 1053 |
| 1054 void StyleBuilderFunctions::applyInheritCSSPropertyCaretColor( |
| 1055 StyleResolverState& state) { |
| 1056 StyleAutoColor color = state.parentStyle()->caretColor(); |
| 1057 if (state.applyPropertyToRegularStyle()) |
| 1058 state.style()->setCaretColor(color); |
| 1059 if (state.applyPropertyToVisitedLinkStyle()) |
| 1060 state.style()->setVisitedLinkCaretColor(color); |
| 1061 } |
| 1062 |
| 1063 void StyleBuilderFunctions::applyValueCSSPropertyCaretColor( |
| 1064 StyleResolverState& state, |
| 1065 const CSSValue& value) { |
| 1066 if (state.applyPropertyToRegularStyle()) { |
| 1067 state.style()->setCaretColor( |
| 1068 StyleBuilderConverter::convertStyleAutoColor(state, value)); |
| 1069 } |
| 1070 if (state.applyPropertyToVisitedLinkStyle()) { |
| 1071 state.style()->setVisitedLinkCaretColor( |
| 1072 StyleBuilderConverter::convertStyleAutoColor(state, value, true)); |
| 1073 } |
| 1074 } |
| 1075 |
1044 } // namespace blink | 1076 } // namespace blink |
OLD | NEW |