提交 8106700a 编写于 作者: E Elliott Sprehn

Remove most of visited link support.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/667003003
上级 969ccf42
......@@ -272,33 +272,22 @@ static bool lengthTypeAndValueMatch(const BorderImageLengthBox& borderImageLengt
{% macro apply_color(property_id, initial_color='StyleColor::currentColor') %}
{% set property = properties[property_id] %}
{% set visited_link_setter = 'setVisitedLink' + property.name_for_methods %}
{{declare_initial_function(property_id)}}
{
StyleColor color = {{initial_color}}();
if (state.applyPropertyToRegularStyle())
{{set_value(property)}}(color);
if (state.applyPropertyToVisitedLinkStyle())
state.style()->{{visited_link_setter}}(color);
{{set_value(property)}}(color);
}
{{declare_inherit_function(property_id)}}
{
// Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed.
StyleColor color = state.parentStyle()->{{property.getter}}();
Color resolvedColor = color.resolve(state.parentStyle()->color());
if (state.applyPropertyToRegularStyle())
{{set_value(property)}}(resolvedColor);
if (state.applyPropertyToVisitedLinkStyle())
state.style()->{{visited_link_setter}}(resolvedColor);
{{set_value(property)}}(resolvedColor);
}
{{declare_value_function(property_id)}}
{
if (state.applyPropertyToRegularStyle())
{{set_value(property)}}(StyleBuilderConverter::convertColor(state, value));
if (state.applyPropertyToVisitedLinkStyle())
state.style()->{{visited_link_setter}}(StyleBuilderConverter::convertColor(state, value, true));
{{set_value(property)}}(StyleBuilderConverter::convertColor(state, value));
}
{% endmacro %}
{{apply_color('CSSPropertyBackgroundColor', initial_color='RenderStyle::initialBackgroundColor') }}
......
......@@ -92,22 +92,21 @@ double AnimatableColorImpl::distanceTo(const AnimatableColorImpl& other) const
+ square(m_alpha - other.m_alpha));
}
PassRefPtrWillBeRawPtr<AnimatableColor> AnimatableColor::create(const AnimatableColorImpl& color, const AnimatableColorImpl& visitedLinkColor)
PassRefPtrWillBeRawPtr<AnimatableColor> AnimatableColor::create(const AnimatableColorImpl& color)
{
return adoptRefWillBeNoop(new AnimatableColor(color, visitedLinkColor));
return adoptRefWillBeNoop(new AnimatableColor(color));
}
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableColor::interpolateTo(const AnimatableValue* value, double fraction) const
{
const AnimatableColor* color = toAnimatableColor(value);
return create(m_color.interpolateTo(color->m_color, fraction),
m_visitedLinkColor.interpolateTo(color->m_visitedLinkColor, fraction));
return create(m_color.interpolateTo(color->m_color, fraction));
}
bool AnimatableColor::equalTo(const AnimatableValue* value) const
{
const AnimatableColor* color = toAnimatableColor(value);
return m_color == color->m_color && m_visitedLinkColor == color->m_visitedLinkColor;
return m_color == color->m_color;
}
double AnimatableColor::distanceTo(const AnimatableValue* value) const
......
......@@ -58,9 +58,8 @@ private:
// but inefficient.
class AnimatableColor final : public AnimatableValue {
public:
static PassRefPtrWillBeRawPtr<AnimatableColor> create(const AnimatableColorImpl&, const AnimatableColorImpl& visitedLinkColor);
static PassRefPtrWillBeRawPtr<AnimatableColor> create(const AnimatableColorImpl&);
Color color() const { return m_color.toColor(); }
Color visitedLinkColor() const { return m_visitedLinkColor.toColor(); }
virtual void trace(Visitor* visitor) override { AnimatableValue::trace(visitor); }
......@@ -68,16 +67,14 @@ protected:
virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const override;
private:
AnimatableColor(const AnimatableColorImpl& color, const AnimatableColorImpl& visitedLinkColor)
AnimatableColor(const AnimatableColorImpl& color)
: m_color(color)
, m_visitedLinkColor(visitedLinkColor)
{
}
virtual AnimatableType type() const override { return TypeColor; }
virtual bool equalTo(const AnimatableValue*) const override;
virtual double distanceTo(const AnimatableValue*) const override;
const AnimatableColorImpl m_color;
const AnimatableColorImpl m_visitedLinkColor;
};
DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableColor, isColor());
......
......@@ -47,8 +47,7 @@ void PrintTo(const AnimatableClipPathOperation& animValue, ::std::ostream* os)
void PrintTo(const AnimatableColor& animColor, ::std::ostream* os)
{
*os << "AnimatableColor("
<< animColor.color().serialized().utf8().data() << ", "
<< animColor.visitedLinkColor().serialized().utf8().data() << ")";
<< animColor.color().serialized().utf8().data() << ")";
}
void PrintTo(const AnimatableImage& animImage, ::std::ostream* os)
......
......@@ -209,9 +209,8 @@ inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromFillLayers(const
PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::createFromColor(CSSPropertyID property, const RenderStyle& style)
{
Color color = style.colorIncludingFallback(property, false);
Color visitedLinkColor = style.colorIncludingFallback(property, true);
return AnimatableColor::create(color, visitedLinkColor);
Color color = style.colorIncludingFallback(property);
return AnimatableColor::create(color);
}
inline static PassRefPtrWillBeRawPtr<AnimatableValue> createFromShapeValue(ShapeValue* value)
......@@ -387,7 +386,7 @@ PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPro
case CSSPropertyRight:
return createFromLength(style.right(), style);
case CSSPropertyTextDecorationColor:
return AnimatableColor::create(style.textDecorationColor().resolve(style.color()), style.visitedLinkTextDecorationColor().resolve(style.visitedLinkColor()));
return AnimatableColor::create(style.textDecorationColor().resolve(style.color()));
case CSSPropertyTextIndent:
return createFromLength(style.textIndent(), style);
case CSSPropertyTextShadow:
......
......@@ -60,8 +60,7 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
{
switch (prop) {
case CSSPropertyBackgroundColor:
return a.backgroundColor().resolve(a.color()) == b.backgroundColor().resolve(b.color())
&& a.visitedLinkBackgroundColor().resolve(a.color()) == b.visitedLinkBackgroundColor().resolve(b.color());
return a.backgroundColor().resolve(a.color()) == b.backgroundColor().resolve(b.color());
case CSSPropertyBackgroundImage:
return fillLayersEqual<CSSPropertyBackgroundImage>(a.backgroundLayers(), b.backgroundLayers());
case CSSPropertyBackgroundPositionX:
......@@ -71,8 +70,7 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
case CSSPropertyBackgroundSize:
return fillLayersEqual<CSSPropertyBackgroundSize>(a.backgroundLayers(), b.backgroundLayers());
case CSSPropertyBorderBottomColor:
return a.borderBottomColor().resolve(a.color()) == b.borderBottomColor().resolve(b.color())
&& a.visitedLinkBorderBottomColor().resolve(a.color()) == b.visitedLinkBorderBottomColor().resolve(b.color());
return a.borderBottomColor().resolve(a.color()) == b.borderBottomColor().resolve(b.color());
case CSSPropertyBorderBottomLeftRadius:
return a.borderBottomLeftRadius() == b.borderBottomLeftRadius();
case CSSPropertyBorderBottomRightRadius:
......@@ -88,18 +86,15 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
case CSSPropertyBorderImageWidth:
return a.borderImageWidth() == b.borderImageWidth();
case CSSPropertyBorderLeftColor:
return a.borderLeftColor().resolve(a.color()) == b.borderLeftColor().resolve(b.color())
&& a.visitedLinkBorderLeftColor().resolve(a.color()) == b.visitedLinkBorderLeftColor().resolve(b.color());
return a.borderLeftColor().resolve(a.color()) == b.borderLeftColor().resolve(b.color());
case CSSPropertyBorderLeftWidth:
return a.borderLeftWidth() == b.borderLeftWidth();
case CSSPropertyBorderRightColor:
return a.borderRightColor().resolve(a.color()) == b.borderRightColor().resolve(b.color())
&& a.visitedLinkBorderRightColor().resolve(a.color()) == b.visitedLinkBorderRightColor().resolve(b.color());
return a.borderRightColor().resolve(a.color()) == b.borderRightColor().resolve(b.color());
case CSSPropertyBorderRightWidth:
return a.borderRightWidth() == b.borderRightWidth();
case CSSPropertyBorderTopColor:
return a.borderTopColor().resolve(a.color()) == b.borderTopColor().resolve(b.color())
&& a.visitedLinkBorderTopColor().resolve(a.color()) == b.visitedLinkBorderTopColor().resolve(b.color());
return a.borderTopColor().resolve(a.color()) == b.borderTopColor().resolve(b.color());
case CSSPropertyBorderTopLeftRadius:
return a.borderTopLeftRadius() == b.borderTopLeftRadius();
case CSSPropertyBorderTopRightRadius:
......@@ -113,7 +108,7 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
case CSSPropertyClip:
return a.clip() == b.clip();
case CSSPropertyColor:
return a.color() == b.color() && a.visitedLinkColor() == b.visitedLinkColor();
return a.color() == b.color();
case CSSPropertyFlexBasis:
return a.flexBasis() == b.flexBasis();
case CSSPropertyFlexGrow:
......@@ -163,8 +158,7 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
case CSSPropertyOrphans:
return a.orphans() == b.orphans();
case CSSPropertyOutlineColor:
return a.outlineColor().resolve(a.color()) == b.outlineColor().resolve(b.color())
&& a.visitedLinkOutlineColor().resolve(a.color()) == b.visitedLinkOutlineColor().resolve(b.color());
return a.outlineColor().resolve(a.color()) == b.outlineColor().resolve(b.color());
case CSSPropertyOutlineOffset:
return a.outlineOffset() == b.outlineOffset();
case CSSPropertyOutlineWidth:
......@@ -186,8 +180,7 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
case CSSPropertyShapeOutside:
return dataEquivalent(a.shapeOutside(), b.shapeOutside());
case CSSPropertyTextDecorationColor:
return a.textDecorationColor().resolve(a.color()) == b.textDecorationColor().resolve(b.color())
&& a.visitedLinkTextDecorationColor().resolve(a.color()) == b.visitedLinkTextDecorationColor().resolve(b.color());
return a.textDecorationColor().resolve(a.color()) == b.textDecorationColor().resolve(b.color());
case CSSPropertyTextIndent:
return a.textIndent() == b.textIndent();
case CSSPropertyTextShadow:
......@@ -230,8 +223,7 @@ bool CSSPropertyEquality::propertiesEqual(CSSPropertyID prop, const RenderStyle&
case CSSPropertyPerspectiveOrigin:
return a.perspectiveOriginX() == b.perspectiveOriginX() && a.perspectiveOriginY() == b.perspectiveOriginY();
case CSSPropertyWebkitTextStrokeColor:
return a.textStrokeColor().resolve(a.color()) == b.textStrokeColor().resolve(b.color())
&& a.visitedLinkTextStrokeColor().resolve(a.color()) == b.visitedLinkTextStrokeColor().resolve(b.color());
return a.textStrokeColor().resolve(a.color()) == b.textStrokeColor().resolve(b.color());
case CSSPropertyTransform:
return a.transform() == b.transform();
case CSSPropertyTransformOrigin:
......
......@@ -1471,7 +1471,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
break;
case CSSPropertyBackgroundColor:
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(*style, style->backgroundColor());
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->colorIncludingFallback(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidColor(*style, style->backgroundColor());
case CSSPropertyBackgroundImage:
case CSSPropertyWebkitMaskImage: {
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
......@@ -1579,13 +1579,13 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
return style->borderImageSource()->cssValue();
return cssValuePool().createIdentifierValue(CSSValueNone);
case CSSPropertyBorderTopColor:
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(*style, style->borderTopColor());
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->colorIncludingFallback(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(*style, style->borderTopColor());
case CSSPropertyBorderRightColor:
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidColor(*style, style->borderRightColor());
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->colorIncludingFallback(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidColor(*style, style->borderRightColor());
case CSSPropertyBorderBottomColor:
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValidColor(*style, style->borderBottomColor());
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->colorIncludingFallback(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValidColor(*style, style->borderBottomColor());
case CSSPropertyBorderLeftColor:
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidColor(*style, style->borderLeftColor());
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->colorIncludingFallback(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidColor(*style, style->borderLeftColor());
case CSSPropertyBorderTopStyle:
return cssValuePool().createValue(style->borderTopStyle());
case CSSPropertyBorderRightStyle:
......@@ -1616,7 +1616,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
case CSSPropertyClear:
return cssValuePool().createValue(style->clear());
case CSSPropertyColor:
return cssValuePool().createColorValue(m_allowVisitedStyle ? style->visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb());
return cssValuePool().createColorValue(m_allowVisitedStyle ? style->colorIncludingFallback(CSSPropertyColor).rgb() : style->color().rgb());
case CSSPropertyWebkitPrintColorAdjust:
return cssValuePool().createValue(style->printColorAdjust());
case CSSPropertyTabSize:
......@@ -1915,7 +1915,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
return cssValuePool().createIdentifierValue(CSSValueAuto);
return cssValuePool().createValue(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
case CSSPropertyOutlineColor:
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(*style, style->outlineColor());
return m_allowVisitedStyle ? cssValuePool().createColorValue(style->colorIncludingFallback(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(*style, style->outlineColor());
case CSSPropertyOutlineOffset:
return zoomAdjustedPixelValue(style->outlineOffset(), *style);
case CSSPropertyOutlineStyle:
......
......@@ -251,7 +251,6 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
switch (property) {
case CSSPropertyBackgroundColor:
style->setBackgroundColor(toAnimatableColor(value)->color());
style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBackgroundImage:
setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayers(), value, state);
......@@ -267,7 +266,6 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
return;
case CSSPropertyBorderBottomColor:
style->setBorderBottomColor(toAnimatableColor(value)->color());
style->setVisitedLinkBorderBottomColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBorderBottomLeftRadius:
style->setBorderBottomLeftRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
......@@ -292,21 +290,18 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
return;
case CSSPropertyBorderLeftColor:
style->setBorderLeftColor(toAnimatableColor(value)->color());
style->setVisitedLinkBorderLeftColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBorderLeftWidth:
style->setBorderLeftWidth(animatableValueRoundClampTo<unsigned>(value));
return;
case CSSPropertyBorderRightColor:
style->setBorderRightColor(toAnimatableColor(value)->color());
style->setVisitedLinkBorderRightColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBorderRightWidth:
style->setBorderRightWidth(animatableValueRoundClampTo<unsigned>(value));
return;
case CSSPropertyBorderTopColor:
style->setBorderTopColor(toAnimatableColor(value)->color());
style->setVisitedLinkBorderTopColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBorderTopLeftRadius:
style->setBorderTopLeftRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
......@@ -329,7 +324,6 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
return;
case CSSPropertyColor:
style->setColor(toAnimatableColor(value)->color());
style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyFlexGrow:
style->setFlexGrow(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0));
......@@ -403,7 +397,6 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
return;
case CSSPropertyOutlineColor:
style->setOutlineColor(toAnimatableColor(value)->color());
style->setVisitedLinkOutlineColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyOutlineOffset:
style->setOutlineOffset(animatableValueRoundClampTo<int>(value));
......@@ -428,7 +421,6 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
return;
case CSSPropertyTextDecorationColor:
style->setTextDecorationColor(toAnimatableColor(value)->color());
style->setVisitedLinkTextDecorationColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyTextIndent:
style->setTextIndent(animatableValueToLength(value, state));
......@@ -499,7 +491,6 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
return;
case CSSPropertyWebkitTextStrokeColor:
style->setTextStrokeColor(toAnimatableColor(value)->color());
style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyTransform: {
const TransformOperations& operations = toAnimatableTransform(value)->transformOperations();
......
......@@ -56,10 +56,10 @@ static GridLength convertGridTrackBreadth(const StyleResolverState& state, CSSPr
} // namespace
Color StyleBuilderConverter::convertColor(StyleResolverState& state, CSSValue* value, bool forVisitedLink)
Color StyleBuilderConverter::convertColor(StyleResolverState& state, CSSValue* value)
{
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
return state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color(), forVisitedLink);
return state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color());
}
AtomicString StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState& state, CSSValue* value)
......
......@@ -43,7 +43,7 @@ namespace blink {
class StyleBuilderConverter {
public:
static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*);
static Color convertColor(StyleResolverState&, CSSValue*, bool forVisitedLink = false);
static Color convertColor(StyleResolverState&, CSSValue*);
template <typename T> static T convertComputedLength(StyleResolverState&, CSSValue*);
static LengthBox convertClip(StyleResolverState&, CSSValue*);
template <typename T> static T convertFlags(StyleResolverState&, CSSValue*);
......
......@@ -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)
......
......@@ -35,8 +35,6 @@ StyleResolverState::StyleResolverState(Document& document, Element* element, Ren
, m_style(nullptr)
, m_cssToLengthConversionData(0, rootElementStyle(), document.renderView())
, m_parentStyle(parentStyle)
, m_applyPropertyToRegularStyle(true)
, m_applyPropertyToVisitedLinkStyle(false)
, m_lineHeightValue(nullptr)
, m_styleMap(*this, m_elementStyleResources)
{
......
......@@ -74,16 +74,6 @@ public:
const RenderStyle* parentStyle() const { return m_parentStyle.get(); }
RenderStyle* parentStyle() { return m_parentStyle.get(); }
// FIXME: These are effectively side-channel "out parameters" for the various
// map functions. When we map from CSS to style objects we use this state object
// to track various meta-data about that mapping (e.g. if it's cache-able).
// We need to move this data off of StyleResolverState and closer to the
// objects it applies to. Possibly separating (immutable) inputs from (mutable) outputs.
void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegularStyle = isApply; }
void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVisitedLinkStyle = isApply; }
bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularStyle; }
bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisitedLinkStyle; }
// Holds all attribute names found while applying "content" properties that contain an "attr()" value.
Vector<AtomicString>& contentAttrValues() { return m_contentAttrValues; }
......@@ -129,9 +119,6 @@ private:
OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate;
bool m_applyPropertyToRegularStyle;
bool m_applyPropertyToVisitedLinkStyle;
RawPtrWillBeMember<CSSValue> m_lineHeightValue;
FontBuilder m_fontBuilder;
......
......@@ -38,7 +38,6 @@ TextLinkColors::TextLinkColors()
: m_textColor(Color::black)
{
resetLinkColor();
resetVisitedLinkColor();
resetActiveLinkColor();
}
......@@ -47,17 +46,12 @@ void TextLinkColors::resetLinkColor()
m_linkColor = Color(0, 0, 238);
}
void TextLinkColors::resetVisitedLinkColor()
{
m_visitedLinkColor = Color(85, 26, 139);
}
void TextLinkColors::resetActiveLinkColor()
{
m_activeLinkColor = Color(255, 0, 0);
}
Color TextLinkColors::colorFromPrimitiveValue(const CSSPrimitiveValue* value, Color currentColor, bool forVisitedLink) const
Color TextLinkColors::colorFromPrimitiveValue(const CSSPrimitiveValue* value, Color currentColor) const
{
if (value->isRGBColor())
return Color(value->getRGBA32Value());
......
......@@ -44,20 +44,16 @@ public:
Color textColor() const { return m_textColor; }
const Color& linkColor() const { return m_linkColor; }
const Color& visitedLinkColor() const { return m_visitedLinkColor; }
const Color& activeLinkColor() const { return m_activeLinkColor; }
void setLinkColor(const Color& color) { m_linkColor = color; }
void setVisitedLinkColor(const Color& color) { m_visitedLinkColor = color; }
void setActiveLinkColor(const Color& color) { m_activeLinkColor = color; }
void resetLinkColor();
void resetVisitedLinkColor();
void resetActiveLinkColor();
Color colorFromPrimitiveValue(const CSSPrimitiveValue*, Color currentColor, bool forVisitedLink = false) const;
Color colorFromPrimitiveValue(const CSSPrimitiveValue*, Color currentColor) const;
private:
Color m_textColor;
Color m_linkColor;
Color m_visitedLinkColor;
Color m_activeLinkColor;
};
......
......@@ -1487,7 +1487,7 @@ Color FrameView::documentBackgroundColor() const
// otherwise poses problems when the aggregate is not
// fully opaque.
if (htmlElement && htmlElement->renderer())
result = result.blend(htmlElement->renderer()->style()->visitedDependentColor(CSSPropertyBackgroundColor));
result = result.blend(htmlElement->renderer()->style()->colorIncludingFallback(CSSPropertyBackgroundColor));
return result;
}
......
......@@ -4215,7 +4215,7 @@ LayoutSize RenderBox::computePreviousBorderBoxSize(const LayoutSize& previousBou
RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
{
backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
ASSERT(hasBackground == style.hasBackground());
hasBorder = style.hasBorder();
......
......@@ -2327,7 +2327,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
bool hasBorderRadius = s->hasBorderRadius();
bool isHorizontal = s->isHorizontalWritingMode();
bool hasOpaqueBackground = s->visitedDependentColor(CSSPropertyBackgroundColor).alpha() == 255;
bool hasOpaqueBackground = s->colorIncludingFallback(CSSPropertyBackgroundColor).alpha() == 255;
GraphicsContextStateSaver stateSaver(*context, false);
......
......@@ -2573,7 +2573,7 @@ void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
styleToUse = curr->style(firstlineStyle);
currDecs = styleToUse->textDecoration();
currDecs &= decorations;
resultColor = styleToUse->visitedDependentDecorationColor();
resultColor = styleToUse->decorationColor();
resultStyle = styleToUse->textDecorationStyle();
// Parameter 'decorations' is cast as an int to enable the bitwise operations below.
if (currDecs) {
......@@ -2601,7 +2601,7 @@ void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
// If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
if (decorations && curr) {
styleToUse = curr->style(firstlineStyle);
resultColor = styleToUse->visitedDependentDecorationColor();
resultColor = styleToUse->decorationColor();
if (decorations & TextDecorationUnderline) {
underline.color = resultColor;
underline.style = resultStyle;
......
......@@ -679,12 +679,12 @@ public:
inline Color resolveColor(const RenderStyle* styleToUse, int colorProperty) const
{
return styleToUse->visitedDependentColor(colorProperty);
return styleToUse->colorIncludingFallback(colorProperty);
}
inline Color resolveColor(int colorProperty) const
{
return style()->visitedDependentColor(colorProperty);
return style()->colorIncludingFallback(colorProperty);
}
virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
......
......@@ -58,7 +58,7 @@ void write(TextStream&, const RenderObject&, int indent = 0, RenderAsTextBehavio
class RenderTreeAsText {
// FIXME: This is a cheesy hack to allow easy access to RenderStyle colors. It won't be needed if we convert
// it to use visitedDependentColor instead. (This just involves rebaselining many results though, so for now it's
// it to use colorIncludingFallback instead. (This just involves rebaselining many results though, so for now it's
// not being done).
public:
static void writeRenderObject(TextStream& ts, const RenderObject& o, RenderAsTextBehavior behavior);
......
......@@ -773,9 +773,7 @@ void RenderStyle::setListStyleImage(PassRefPtr<StyleImage> v)
}
Color RenderStyle::color() const { return inherited->color; }
Color RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
void RenderStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); }
void RenderStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v); }
short RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
short RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
......@@ -1065,7 +1063,7 @@ void RenderStyle::applyTextDecorations()
return;
TextDecorationStyle style = textDecorationStyle();
StyleColor styleColor = visitedDependentDecorationStyleColor();
StyleColor styleColor = decorationStyleColor();
int decorations = textDecoration();
......@@ -1179,69 +1177,66 @@ void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn
}
}
StyleColor RenderStyle::visitedDependentDecorationStyleColor() const
StyleColor RenderStyle::decorationStyleColor() const
{
bool isVisited = false;
StyleColor styleColor = isVisited ? visitedLinkTextDecorationColor() : textDecorationColor();
StyleColor styleColor = textDecorationColor();
if (!styleColor.isCurrentColor())
return styleColor;
if (textStrokeWidth()) {
// Prefer stroke color if possible, but not if it's fully transparent.
StyleColor textStrokeStyleColor = isVisited ? visitedLinkTextStrokeColor() : textStrokeColor();
StyleColor textStrokeStyleColor = textStrokeColor();
if (!textStrokeStyleColor.isCurrentColor() && textStrokeStyleColor.color().alpha())
return textStrokeStyleColor;
}
return isVisited ? visitedLinkTextFillColor() : textFillColor();
return textFillColor();
}
Color RenderStyle::visitedDependentDecorationColor() const
Color RenderStyle::decorationColor() const
{
bool isVisited = false;
return visitedDependentDecorationStyleColor().resolve(isVisited ? visitedLinkColor() : color());
return decorationStyleColor().resolve(color());
}
Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) const
Color RenderStyle::colorIncludingFallback(int colorProperty) const
{
StyleColor result(StyleColor::currentColor());
EBorderStyle borderStyle = BNONE;
switch (colorProperty) {
case CSSPropertyBackgroundColor:
result = visitedLink ? visitedLinkBackgroundColor() : backgroundColor();
result = backgroundColor();
break;
case CSSPropertyBorderLeftColor:
result = visitedLink ? visitedLinkBorderLeftColor() : borderLeftColor();
result = borderLeftColor();
borderStyle = borderLeftStyle();
break;
case CSSPropertyBorderRightColor:
result = visitedLink ? visitedLinkBorderRightColor() : borderRightColor();
result = borderRightColor();
borderStyle = borderRightStyle();
break;
case CSSPropertyBorderTopColor:
result = visitedLink ? visitedLinkBorderTopColor() : borderTopColor();
result = borderTopColor();
borderStyle = borderTopStyle();
break;
case CSSPropertyBorderBottomColor:
result = visitedLink ? visitedLinkBorderBottomColor() : borderBottomColor();
result = borderBottomColor();
borderStyle = borderBottomStyle();
break;
case CSSPropertyColor:
result = visitedLink ? visitedLinkColor() : color();
result = color();
break;
case CSSPropertyOutlineColor:
result = visitedLink ? visitedLinkOutlineColor() : outlineColor();
result = outlineColor();
break;
case CSSPropertyWebkitTextEmphasisColor:
result = visitedLink ? visitedLinkTextEmphasisColor() : textEmphasisColor();
result = textEmphasisColor();
break;
case CSSPropertyWebkitTextFillColor:
result = visitedLink ? visitedLinkTextFillColor() : textFillColor();
result = textFillColor();
break;
case CSSPropertyWebkitTextStrokeColor:
result = visitedLink ? visitedLinkTextStrokeColor() : textStrokeColor();
result = textStrokeColor();
break;
case CSSPropertyWebkitTapHighlightColor:
result = tapHighlightColor();
......@@ -1256,15 +1251,9 @@ Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) c
// FIXME: Treating styled borders with initial color differently causes problems
// See crbug.com/316559, crbug.com/276231
if (!visitedLink && (borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE || borderStyle == GROOVE))
if ((borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE || borderStyle == GROOVE))
return Color(238, 238, 238);
return visitedLink ? visitedLinkColor() : color();
}
Color RenderStyle::visitedDependentColor(int colorProperty) const
{
// FIXME(sky): Remove visited colors.
return colorIncludingFallback(colorProperty, false);
return color();
}
const BorderValue& RenderStyle::borderBefore() const
......
......@@ -355,7 +355,7 @@ public:
bool hasBackground() const
{
Color color = visitedDependentColor(CSSPropertyBackgroundColor);
Color color = colorIncludingFallback(CSSPropertyBackgroundColor);
if (color.alpha())
return true;
return hasBackgroundImage();
......@@ -1350,9 +1350,8 @@ public:
bool lastChildState() const { return noninherited_flags.lastChildState; }
void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; }
StyleColor visitedDependentDecorationStyleColor() const;
Color visitedDependentDecorationColor() const;
Color visitedDependentColor(int colorProperty) const;
StyleColor decorationStyleColor() const;
Color decorationColor() const;
void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInheritance = true; }
bool hasExplicitlyInheritedProperties() const { return noninherited_flags.explicitInheritance; }
......@@ -1538,19 +1537,10 @@ public:
static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
static WebBlendMode initialBlendMode() { return WebBlendModeNormal; }
static EIsolation initialIsolation() { return IsolationAuto; }
private:
void setVisitedLinkColor(const Color&);
void setVisitedLinkBackgroundColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v); }
void setVisitedLinkBorderLeftColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v); }
void setVisitedLinkBorderRightColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v); }
void setVisitedLinkBorderBottomColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderBottomColor, v); }
void setVisitedLinkBorderTopColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderTopColor, v); }
void setVisitedLinkOutlineColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v); }
void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkTextDecorationColor, v); }
void setVisitedLinkTextEmphasisColor(const StyleColor& v) { SET_VAR_WITH_SETTER(rareInheritedData, visitedLinkTextEmphasisColor, setVisitedLinkTextEmphasisColor, v); }
void setVisitedLinkTextFillColor(const StyleColor& v) { SET_VAR_WITH_SETTER(rareInheritedData, visitedLinkTextFillColor, setVisitedLinkTextFillColor, v); }
void setVisitedLinkTextStrokeColor(const StyleColor& v) { SET_VAR_WITH_SETTER(rareInheritedData, visitedLinkTextStrokeColor, setVisitedLinkTextStrokeColor, v); }
Color colorIncludingFallback(int colorProperty) const;
private:
void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags.unicodeBidi = parent->noninherited_flags.unicodeBidi; }
void getShadowExtent(const ShadowList*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
LayoutBoxExtent getShadowInsetExtent(const ShadowList*) const;
......@@ -1585,7 +1575,7 @@ private:
return display == INLINE || isDisplayReplacedType(display);
}
// Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
// Color accessors are all private to make sure callers use colorIncludingFallback instead to access them.
StyleColor borderLeftColor() const { return surround->border.left().color(); }
StyleColor borderRightColor() const { return surround->border.right().color(); }
StyleColor borderTopColor() const { return surround->border.top().color(); }
......@@ -1596,20 +1586,8 @@ private:
StyleColor textEmphasisColor() const { return rareInheritedData->textEmphasisColor(); }
StyleColor textFillColor() const { return rareInheritedData->textFillColor(); }
StyleColor textStrokeColor() const { return rareInheritedData->textStrokeColor(); }
Color visitedLinkColor() const;
StyleColor visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
StyleColor visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
StyleColor visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
StyleColor visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
StyleColor visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
StyleColor visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
StyleColor textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
StyleColor visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; }
StyleColor visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor(); }
StyleColor visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor(); }
StyleColor visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor(); }
Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
StyleColor textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
void appendContent(PassOwnPtr<ContentData>);
void addAppliedTextDecoration(const AppliedTextDecoration&);
......
......@@ -31,7 +31,6 @@ StyleInheritedData::StyleInheritedData()
, vertical_border_spacing(RenderStyle::initialVerticalBorderSpacing())
, line_height(RenderStyle::initialLineHeight())
, color(RenderStyle::initialColor())
, visitedLinkColor(RenderStyle::initialColor())
{
}
......@@ -46,7 +45,6 @@ StyleInheritedData::StyleInheritedData(const StyleInheritedData& o)
, line_height(o.line_height)
, font(o.font)
, color(o.color)
, visitedLinkColor(o.visitedLinkColor)
{
}
......@@ -55,7 +53,6 @@ bool StyleInheritedData::operator==(const StyleInheritedData& o) const
return line_height == o.line_height
&& font == o.font
&& color == o.color
&& visitedLinkColor == o.visitedLinkColor
&& horizontal_border_spacing == o.horizontal_border_spacing
&& vertical_border_spacing == o.vertical_border_spacing;
}
......
......@@ -55,7 +55,6 @@ public:
Font font;
Color color;
Color visitedLinkColor;
private:
StyleInheritedData();
......
......@@ -37,7 +37,7 @@ struct SameSizeAsStyleRareInheritedData : public RefCounted<SameSizeAsStyleRareI
void* styleImage;
Color firstColor;
float firstFloat;
Color colors[5];
Color colors[2];
void* ownPtrs[1];
AtomicString atomicStrings[4];
void* refPtrs[3];
......@@ -65,9 +65,6 @@ StyleRareInheritedData::StyleRareInheritedData()
, m_textStrokeColorIsCurrentColor(true)
, m_textFillColorIsCurrentColor(true)
, m_textEmphasisColorIsCurrentColor(true)
, m_visitedLinkTextStrokeColorIsCurrentColor(true)
, m_visitedLinkTextFillColorIsCurrentColor(true)
, m_visitedLinkTextEmphasisColorIsCurrentColor(true)
, userModify(READ_ONLY)
, wordBreak(RenderStyle::initialWordBreak())
, overflowWrap(RenderStyle::initialOverflowWrap())
......@@ -104,9 +101,6 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, textStrokeWidth(o.textStrokeWidth)
, m_textFillColor(o.m_textFillColor)
, m_textEmphasisColor(o.m_textEmphasisColor)
, m_visitedLinkTextStrokeColor(o.m_visitedLinkTextStrokeColor)
, m_visitedLinkTextFillColor(o.m_visitedLinkTextFillColor)
, m_visitedLinkTextEmphasisColor(o.m_visitedLinkTextEmphasisColor)
, textShadow(o.textShadow)
, highlight(o.highlight)
, cursorData(o.cursorData)
......@@ -119,9 +113,6 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, m_textStrokeColorIsCurrentColor(o.m_textStrokeColorIsCurrentColor)
, m_textFillColorIsCurrentColor(o.m_textFillColorIsCurrentColor)
, m_textEmphasisColorIsCurrentColor(o.m_textEmphasisColorIsCurrentColor)
, m_visitedLinkTextStrokeColorIsCurrentColor(o.m_visitedLinkTextStrokeColorIsCurrentColor)
, m_visitedLinkTextFillColorIsCurrentColor(o.m_visitedLinkTextFillColorIsCurrentColor)
, m_visitedLinkTextEmphasisColorIsCurrentColor(o.m_visitedLinkTextEmphasisColorIsCurrentColor)
, userModify(o.userModify)
, wordBreak(o.wordBreak)
, overflowWrap(o.overflowWrap)
......@@ -165,9 +156,6 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& textStrokeWidth == o.textStrokeWidth
&& m_textFillColor == o.m_textFillColor
&& m_textEmphasisColor == o.m_textEmphasisColor
&& m_visitedLinkTextStrokeColor == o.m_visitedLinkTextStrokeColor
&& m_visitedLinkTextFillColor == o.m_visitedLinkTextFillColor
&& m_visitedLinkTextEmphasisColor == o.m_visitedLinkTextEmphasisColor
&& tapHighlightColor == o.tapHighlightColor
&& shadowDataEquivalent(o)
&& highlight == o.highlight
......@@ -181,9 +169,6 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
&& m_textStrokeColorIsCurrentColor == o.m_textStrokeColorIsCurrentColor
&& m_textFillColorIsCurrentColor == o.m_textFillColorIsCurrentColor
&& m_textEmphasisColorIsCurrentColor == o.m_textEmphasisColorIsCurrentColor
&& m_visitedLinkTextStrokeColorIsCurrentColor == o.m_visitedLinkTextStrokeColorIsCurrentColor
&& m_visitedLinkTextFillColorIsCurrentColor == o.m_visitedLinkTextFillColorIsCurrentColor
&& m_visitedLinkTextEmphasisColorIsCurrentColor == o.m_visitedLinkTextEmphasisColorIsCurrentColor
&& userModify == o.userModify
&& wordBreak == o.wordBreak
&& overflowWrap == o.overflowWrap
......
......@@ -67,26 +67,16 @@ public:
StyleColor textStrokeColor() const { return m_textStrokeColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textStrokeColor); }
StyleColor textFillColor() const { return m_textFillColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textFillColor); }
StyleColor textEmphasisColor() const { return m_textEmphasisColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textEmphasisColor); }
StyleColor visitedLinkTextStrokeColor() const { return m_visitedLinkTextStrokeColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextStrokeColor); }
StyleColor visitedLinkTextFillColor() const { return m_visitedLinkTextFillColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextFillColor); }
StyleColor visitedLinkTextEmphasisColor() const { return m_visitedLinkTextEmphasisColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextEmphasisColor); }
void setTextStrokeColor(const StyleColor& color) { m_textStrokeColor = color.resolve(Color()); m_textStrokeColorIsCurrentColor = color.isCurrentColor(); }
void setTextFillColor(const StyleColor& color) { m_textFillColor = color.resolve(Color()); m_textFillColorIsCurrentColor = color.isCurrentColor(); }
void setTextEmphasisColor(const StyleColor& color) { m_textEmphasisColor = color.resolve(Color()); m_textEmphasisColorIsCurrentColor = color.isCurrentColor(); }
void setVisitedLinkTextStrokeColor(const StyleColor& color) { m_visitedLinkTextStrokeColor = color.resolve(Color()); m_visitedLinkTextStrokeColorIsCurrentColor = color.isCurrentColor(); }
void setVisitedLinkTextFillColor(const StyleColor& color) { m_visitedLinkTextFillColor = color.resolve(Color()); m_visitedLinkTextFillColorIsCurrentColor = color.isCurrentColor(); }
void setVisitedLinkTextEmphasisColor(const StyleColor& color) { m_visitedLinkTextEmphasisColor = color.resolve(Color()); m_visitedLinkTextEmphasisColorIsCurrentColor = color.isCurrentColor(); }
Color m_textStrokeColor;
float textStrokeWidth;
Color m_textFillColor;
Color m_textEmphasisColor;
Color m_visitedLinkTextStrokeColor;
Color m_visitedLinkTextFillColor;
Color m_visitedLinkTextEmphasisColor;
RefPtr<ShadowList> textShadow; // Our text shadow information for shadowed text drawing.
AtomicString highlight; // Apple-specific extension for custom highlight rendering.
......@@ -103,9 +93,6 @@ public:
unsigned m_textStrokeColorIsCurrentColor : 1;
unsigned m_textFillColorIsCurrentColor : 1;
unsigned m_textEmphasisColorIsCurrentColor : 1;
unsigned m_visitedLinkTextStrokeColorIsCurrentColor : 1;
unsigned m_visitedLinkTextFillColorIsCurrentColor : 1;
unsigned m_visitedLinkTextEmphasisColorIsCurrentColor : 1;
unsigned userModify : 2; // EUserModify (editing)
unsigned wordBreak : 2; // EWordBreak
......
......@@ -46,13 +46,6 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
, m_shapeImageThreshold(RenderStyle::initialShapeImageThreshold())
, m_clipPath(RenderStyle::initialClipPath())
, m_textDecorationColor(StyleColor::currentColor())
, m_visitedLinkTextDecorationColor(StyleColor::currentColor())
, m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
, m_visitedLinkOutlineColor(StyleColor::currentColor())
, m_visitedLinkBorderLeftColor(StyleColor::currentColor())
, m_visitedLinkBorderRightColor(StyleColor::currentColor())
, m_visitedLinkBorderTopColor(StyleColor::currentColor())
, m_visitedLinkBorderBottomColor(StyleColor::currentColor())
, m_order(RenderStyle::initialOrder())
, m_objectPosition(RenderStyle::initialObjectPosition())
, m_pageSizeType(PAGE_SIZE_AUTO)
......@@ -124,13 +117,6 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
, m_shapeImageThreshold(o.m_shapeImageThreshold)
, m_clipPath(o.m_clipPath)
, m_textDecorationColor(o.m_textDecorationColor)
, m_visitedLinkTextDecorationColor(o.m_visitedLinkTextDecorationColor)
, m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor)
, m_visitedLinkOutlineColor(o.m_visitedLinkOutlineColor)
, m_visitedLinkBorderLeftColor(o.m_visitedLinkBorderLeftColor)
, m_visitedLinkBorderRightColor(o.m_visitedLinkBorderRightColor)
, m_visitedLinkBorderTopColor(o.m_visitedLinkBorderTopColor)
, m_visitedLinkBorderBottomColor(o.m_visitedLinkBorderBottomColor)
, m_order(o.m_order)
, m_objectPosition(o.m_objectPosition)
, m_pageSizeType(o.m_pageSizeType)
......@@ -205,13 +191,6 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
&& m_shapeImageThreshold == o.m_shapeImageThreshold
&& m_clipPath == o.m_clipPath
&& m_textDecorationColor == o.m_textDecorationColor
&& m_visitedLinkTextDecorationColor == o.m_visitedLinkTextDecorationColor
&& m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor
&& m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor
&& m_visitedLinkBorderLeftColor == o.m_visitedLinkBorderLeftColor
&& m_visitedLinkBorderRightColor == o.m_visitedLinkBorderRightColor
&& m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor
&& m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor
&& m_order == o.m_order
&& m_objectPosition == o.m_objectPosition
&& m_pageSizeType == o.m_pageSizeType
......
......@@ -125,13 +125,6 @@ public:
RefPtr<ClipPathOperation> m_clipPath;
StyleColor m_textDecorationColor;
StyleColor m_visitedLinkTextDecorationColor;
StyleColor m_visitedLinkBackgroundColor;
StyleColor m_visitedLinkOutlineColor;
StyleColor m_visitedLinkBorderLeftColor;
StyleColor m_visitedLinkBorderRightColor;
StyleColor m_visitedLinkBorderTopColor;
StyleColor m_visitedLinkBorderBottomColor;
int m_order;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册