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

Unified Diff: sky/engine/core/css/resolver/StyleBuilderCustom.cpp

Issue 667003003: Remove most of visited link support. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/sky/engine/core/css/resolver/StyleBuilderCustom.cpp b/sky/engine/core/css/resolver/StyleBuilderCustom.cpp
index dcb4c479408ebbb4c4fbf35adbe2fc9c64b363f2..27b8452555ed36f52a5f5cf439e3ca0b7482c8f5 100644
--- a/sky/engine/core/css/resolver/StyleBuilderCustom.cpp
+++ b/sky/engine/core/css/resolver/StyleBuilderCustom.cpp
@@ -75,30 +75,6 @@
namespace blink {
-namespace {
-
-static inline bool isValidVisitedLinkProperty(CSSPropertyID id)
-{
- switch (id) {
- case CSSPropertyBackgroundColor:
- case CSSPropertyBorderLeftColor:
- case CSSPropertyBorderRightColor:
- case CSSPropertyBorderTopColor:
- case CSSPropertyBorderBottomColor:
- case CSSPropertyColor:
- case CSSPropertyOutlineColor:
- case CSSPropertyTextDecorationColor:
- case CSSPropertyWebkitTextEmphasisColor:
- case CSSPropertyWebkitTextFillColor:
- case CSSPropertyWebkitTextStrokeColor:
- return true;
- default:
- return false;
- }
-}
-
-} // namespace
-
void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CSSValue* value)
{
ASSERT_WITH_MESSAGE(!isExpandedShorthand(id), "Shorthand property id = %d wasn't expanded at parsing time", id);
@@ -109,11 +85,6 @@ void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CS
ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial -> !isInherit
ASSERT(!isInherit || (state.parentNode() && state.parentStyle())); // isInherit -> (state.parentNode() && state.parentStyle())
- if (!state.applyPropertyToRegularStyle() && (!state.applyPropertyToVisitedLinkStyle() || !isValidVisitedLinkProperty(id))) {
- // Limit the properties that can be applied to only the ones honored by :visited.
- return;
- }
-
CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0;
if (primitiveValue && primitiveValue->getValueID() == CSSValueCurrentcolor)
state.style()->setHasCurrentColor();
@@ -127,19 +98,13 @@ void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CS
void StyleBuilderFunctions::applyInitialCSSPropertyColor(StyleResolverState& state)
{
Color color = RenderStyle::initialColor();
- if (state.applyPropertyToRegularStyle())
- state.style()->setColor(color);
- if (state.applyPropertyToVisitedLinkStyle())
- state.style()->setVisitedLinkColor(color);
+ state.style()->setColor(color);
}
void StyleBuilderFunctions::applyInheritCSSPropertyColor(StyleResolverState& state)
{
Color color = state.parentStyle()->color();
- if (state.applyPropertyToRegularStyle())
- state.style()->setColor(color);
- if (state.applyPropertyToVisitedLinkStyle())
- state.style()->setVisitedLinkColor(color);
+ state.style()->setColor(color);
}
void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state, CSSValue* value)
@@ -151,10 +116,7 @@ void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state
return;
}
- if (state.applyPropertyToRegularStyle())
- state.style()->setColor(StyleBuilderConverter::convertColor(state, value));
- if (state.applyPropertyToVisitedLinkStyle())
- state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(state, value, true));
+ state.style()->setColor(StyleBuilderConverter::convertColor(state, value));
}
void StyleBuilderFunctions::applyInitialCSSPropertyJustifyItems(StyleResolverState& state)
« no previous file with comments | « sky/engine/core/css/resolver/StyleBuilderConverter.cpp ('k') | sky/engine/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698