Changeset 97638 in webkit
- Timestamp:
- Oct 17, 2011 12:49:07 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r97637 r97638 1 2011-10-17 Antti Koivisto <antti@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=69966 4 Eliminate separate RenderStyle for visited link style 5 6 Reviewed by Dave Hyatt and Nikolas Zimmermann. 7 8 There are only a few properties that can apply to visited links and they can 9 be part of the regular style. Many things will get simpler when the separate 10 RenderStyle for visited links is eliminated. 11 12 - Add valid visited link properties as separate fields to RenderStyle. The 13 visitedLinkColor goes to inherited, everything else goes to rare data structures. 14 - Make RenderStyle::visitedDependentColor() get the visited style from the new fields. 15 - As VISITED_LINK pseudo style doesn't exists anymore, remove all code dealing with it. 16 - Make CSSStyleSelector and ApplyPropertyColor apply the visited link style to the 17 newly added fields instead of a separate RenderStyle. 18 - Same thing with SVGRenderStyle, SVGCSSStyleSelector. 19 - Fixup the SVG visited link style code to use the new fields. 20 21 This is ~15% progression in styleForElement performance over the HTML5 spec load. 22 23 * css/CSSStyleApplyProperty.cpp: 24 (WebCore::ApplyPropertyColor::ApplyPropertyColor): 25 (WebCore::ApplyPropertyColor::applyInheritValue): 26 (WebCore::ApplyPropertyColor::applyInitialValue): 27 (WebCore::ApplyPropertyColor::applyValue): 28 (WebCore::ApplyPropertyColor::applyColorValue): 29 (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): 30 * css/CSSStyleSelector.cpp: 31 (WebCore::CSSStyleSelector::CSSStyleSelector): 32 (WebCore::CSSStyleSelector::styleForElement): 33 (WebCore::CSSStyleSelector::pseudoStyleForElement): 34 (WebCore::CSSStyleSelector::updateFont): 35 (WebCore::CSSStyleSelector::applyDeclaration): 36 (WebCore::CSSStyleSelector::applyDeclarations): 37 (WebCore::CSSStyleSelector::applyProperty): 38 (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): 39 * css/CSSStyleSelector.h: 40 (WebCore::CSSStyleSelector::applyPropertyToRegularStyle): 41 (WebCore::CSSStyleSelector::applyPropertyToVisitedLinkStyle): 42 * css/SVGCSSStyleSelector.cpp: 43 (WebCore::CSSStyleSelector::applySVGProperty): 44 * dom/Element.cpp: 45 (WebCore::Element::pseudoStyleCacheIsInvalid): 46 * rendering/style/RenderStyle.cpp: 47 (WebCore::RenderStyle::getCachedPseudoStyle): 48 (WebCore::RenderStyle::colorIncludingFallback): 49 (WebCore::RenderStyle::visitedDependentColor): 50 * rendering/style/RenderStyle.h: 51 (WebCore::InheritedFlags::setVisitedLinkColor): 52 (WebCore::InheritedFlags::setVisitedLinkBackgroundColor): 53 (WebCore::InheritedFlags::setVisitedLinkBorderLeftColor): 54 (WebCore::InheritedFlags::setVisitedLinkBorderRightColor): 55 (WebCore::InheritedFlags::setVisitedLinkBorderBottomColor): 56 (WebCore::InheritedFlags::setVisitedLinkBorderTopColor): 57 (WebCore::InheritedFlags::setVisitedLinkOutlineColor): 58 (WebCore::InheritedFlags::setVisitedLinkColumnRuleColor): 59 (WebCore::InheritedFlags::setVisitedLinkTextEmphasisColor): 60 (WebCore::InheritedFlags::setVisitedLinkTextFillColor): 61 (WebCore::InheritedFlags::setVisitedLinkTextStrokeColor): 62 * rendering/style/RenderStyleConstants.h: 63 * rendering/style/SVGRenderStyle.h: 64 (WebCore::SVGRenderStyle::setVisitedLinkFillPaint): 65 (WebCore::SVGRenderStyle::setVisitedLinkStrokePaint): 66 (WebCore::SVGRenderStyle::visitedLinkFillPaintType): 67 (WebCore::SVGRenderStyle::visitedLinkFillPaintColor): 68 (WebCore::SVGRenderStyle::visitedLinkStrokePaintType): 69 (WebCore::SVGRenderStyle::visitedLinkStrokePaintColor): 70 * rendering/style/SVGRenderStyleDefs.cpp: 71 (WebCore::StyleFillData::StyleFillData): 72 (WebCore::StyleFillData::operator==): 73 (WebCore::StyleStrokeData::StyleStrokeData): 74 (WebCore::StyleStrokeData::operator==): 75 * rendering/style/SVGRenderStyleDefs.h: 76 * rendering/style/StyleInheritedData.cpp: 77 (WebCore::StyleInheritedData::StyleInheritedData): 78 (WebCore::StyleInheritedData::operator==): 79 * rendering/style/StyleInheritedData.h: 80 * rendering/style/StyleMultiColData.cpp: 81 (WebCore::StyleMultiColData::StyleMultiColData): 82 (WebCore::StyleMultiColData::operator==): 83 * rendering/style/StyleMultiColData.h: 84 * rendering/style/StyleRareInheritedData.cpp: 85 (WebCore::StyleRareInheritedData::StyleRareInheritedData): 86 (WebCore::StyleRareInheritedData::operator==): 87 * rendering/style/StyleRareInheritedData.h: 88 * rendering/style/StyleRareNonInheritedData.cpp: 89 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 90 (WebCore::StyleRareNonInheritedData::operator==): 91 * rendering/style/StyleRareNonInheritedData.h: 92 * rendering/svg/RenderSVGResource.cpp: 93 (WebCore::requestPaintingResource): 94 1 95 2011-10-17 Eric Carlson <eric.carlson@apple.com> 2 96 -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r97046 r97638 225 225 typedef Color (*InitialFunction)(); 226 226 227 ApplyPropertyColor(GetterFunction getter, SetterFunction setter, DefaultFunction defaultFunction, InitialFunction initialFunction = 0)227 ApplyPropertyColor(GetterFunction getter, SetterFunction setter, SetterFunction visitedLinkSetter, DefaultFunction defaultFunction, InitialFunction initialFunction = 0) 228 228 : m_getter(getter) 229 229 , m_setter(setter) 230 , m_visitedLinkSetter(visitedLinkSetter) 230 231 , m_default(defaultFunction) 231 232 , m_initial(initialFunction) … … 236 237 virtual void applyInheritValue(CSSStyleSelector* selector) const 237 238 { 239 // Visited link style can never explicitly inherit from parent visited link style so no separate getters are needed. 238 240 const Color& color = (selector->parentStyle()->*m_getter)(); 239 241 if (m_default && !color.isValid()) 240 (selector->style()->*m_setter)((selector->parentStyle()->*m_default)());242 applyColorValue(selector, (selector->parentStyle()->*m_default)()); 241 243 else 242 (selector->style()->*m_setter)(color);244 applyColorValue(selector, color); 243 245 } 244 246 245 247 virtual void applyInitialValue(CSSStyleSelector* selector) const 246 248 { 247 (selector->style()->*m_setter)(m_initial ? m_initial() : Color());249 applyColorValue(selector, m_initial ? m_initial() : Color()); 248 250 } 249 251 … … 256 258 if (inheritColorFromParent && primitiveValue->getIdent() == CSSValueCurrentcolor) 257 259 applyInheritValue(selector); 258 else 259 (selector->style()->*m_setter)(selector->getColorFromPrimitiveValue(primitiveValue)); 260 else { 261 if (selector->applyPropertyToRegularStyle()) 262 (selector->style()->*m_setter)(selector->getColorFromPrimitiveValue(primitiveValue, false)); 263 if (selector->applyPropertyToVisitedLinkStyle() && m_visitedLinkSetter) 264 (selector->style()->*m_visitedLinkSetter)(selector->getColorFromPrimitiveValue(primitiveValue, true)); 265 } 266 } 267 268 void applyColorValue(CSSStyleSelector* selector, const Color& color) const 269 { 270 if (selector->applyPropertyToRegularStyle()) 271 (selector->style()->*m_setter)(color); 272 if (selector->applyPropertyToVisitedLinkStyle() && m_visitedLinkSetter) 273 (selector->style()->*m_visitedLinkSetter)(color); 260 274 } 261 275 262 276 GetterFunction m_getter; 263 277 SetterFunction m_setter; 278 SetterFunction m_visitedLinkSetter; 264 279 DefaultFunction m_default; 265 280 InitialFunction m_initial; … … 894 909 m_propertyMap[i] = 0; 895 910 896 setPropertyHandler(CSSPropertyColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::color, &RenderStyle::setColor, 0, RenderStyle::initialColor));911 setPropertyHandler(CSSPropertyColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, 0, RenderStyle::initialColor)); 897 912 setPropertyHandler(CSSPropertyDirection, new ApplyPropertyDirection(&RenderStyle::direction, &RenderStyle::setDirection, RenderStyle::initialDirection)); 898 913 … … 955 970 setPropertyHandler(CSSPropertyWebkitMaskRepeat, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyBackgroundRepeatX), propertyHandler(CSSPropertyBackgroundRepeatY))); 956 971 957 setPropertyHandler(CSSPropertyBackgroundColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, 0));958 setPropertyHandler(CSSPropertyBorderBottomColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle:: color));959 setPropertyHandler(CSSPropertyBorderLeftColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle:: color));960 setPropertyHandler(CSSPropertyBorderRightColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle:: color));961 setPropertyHandler(CSSPropertyBorderTopColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle:: color));972 setPropertyHandler(CSSPropertyBackgroundColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::backgroundColor, &RenderStyle::setBackgroundColor, &RenderStyle::setVisitedLinkBackgroundColor, 0)); 973 setPropertyHandler(CSSPropertyBorderBottomColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color)); 974 setPropertyHandler(CSSPropertyBorderLeftColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color)); 975 setPropertyHandler(CSSPropertyBorderRightColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color)); 976 setPropertyHandler(CSSPropertyBorderTopColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color)); 962 977 963 978 setPropertyHandler(CSSPropertyBorderTopStyle, new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::borderTopStyle, &RenderStyle::setBorderTopStyle, &RenderStyle::initialBorderStyle)); … … 1017 1032 1018 1033 setPropertyHandler(CSSPropertyOutlineStyle, new ApplyPropertyExpanding<ExpandValue>(new ApplyPropertyDefault<OutlineIsAuto>(&RenderStyle::outlineStyleIsAuto, &RenderStyle::setOutlineStyleIsAuto, &RenderStyle::initialOutlineStyleIsAuto), new ApplyPropertyDefault<EBorderStyle>(&RenderStyle::outlineStyle, &RenderStyle::setOutlineStyle, &RenderStyle::initialBorderStyle))); 1019 setPropertyHandler(CSSPropertyOutlineColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle:: color));1034 setPropertyHandler(CSSPropertyOutlineColor, new ApplyPropertyColor<InheritFromParent>(&RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color)); 1020 1035 setPropertyHandler(CSSPropertyOutlineOffset, new ApplyPropertyComputeLength<int>(&RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset)); 1021 1036 … … 1024 1039 setPropertyHandler(CSSPropertyOverflow, new ApplyPropertyExpanding<ExpandValue>(propertyHandler(CSSPropertyOverflowX), propertyHandler(CSSPropertyOverflowY))); 1025 1040 1026 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle:: color));1027 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle:: color));1028 setPropertyHandler(CSSPropertyWebkitTextFillColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle:: color));1029 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle:: color));1041 setPropertyHandler(CSSPropertyWebkitColumnRuleColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color)); 1042 setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color)); 1043 setPropertyHandler(CSSPropertyWebkitTextFillColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color)); 1044 setPropertyHandler(CSSPropertyWebkitTextStrokeColor, new ApplyPropertyColor<NoInheritFromParent>(&RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color)); 1030 1045 1031 1046 setPropertyHandler(CSSPropertyTop, new ApplyPropertyLength<AutoEnabled>(&RenderStyle::top, &RenderStyle::setTop, &RenderStyle::initialOffset)); -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r97502 r97638 346 346 , m_sameOriginOnly(false) 347 347 , m_fontSelector(CSSFontSelector::create(document)) 348 , m_applyPropertyToRegularStyle(true) 349 , m_applyPropertyToVisitedLinkStyle(false) 348 350 , m_applyProperty(CSSStyleApplyProperty::sharedCSSStyleApplyProperty()) 349 351 { … … 1086 1088 m_style = RenderStyle::create(); 1087 1089 1088 if (m_parentStyle) {1090 if (m_parentStyle) 1089 1091 m_style->inheritFrom(m_parentStyle); 1090 1091 // For links and elements inside links we compute both the regular and visited style. 1092 // FIXME: Visited link style doesn't need a separate RenderStyle. The few properties allowed should be part of the regular RenderStyle instead. 1093 if (e->isLink()) { 1094 m_visitedLinkStyle = RenderStyle::clone(m_style.get()); 1095 m_visitedLinkParentStyle = m_parentStyle; 1096 } else if (m_parentStyle->insideLink()) { 1097 m_visitedLinkParentStyle = m_parentStyle->getCachedPseudoStyle(VISITED_LINK); 1098 if (!m_visitedLinkParentStyle) 1099 m_visitedLinkParentStyle = m_parentStyle; 1100 m_visitedLinkStyle = RenderStyle::create(); 1101 m_visitedLinkStyle->inheritFrom(m_visitedLinkParentStyle); 1102 } 1103 } else { 1092 else { 1104 1093 m_parentStyle = style(); 1105 1094 // Make sure our fonts are initialized if we don't inherit them from our parent style. … … 1287 1276 m_style->setUnique(); 1288 1277 1289 if (m_visitedLinkStyle) {1290 // Copy any pseudo bits that the visited style has to the primary style so that pseudo1291 // element styles will continue to work for pseudo elements inside :visited links.1292 for (unsigned pseudo = FIRST_PUBLIC_PSEUDOID; pseudo < FIRST_INTERNAL_PSEUDOID; ++pseudo) {1293 if (m_visitedLinkStyle->hasPseudoStyle(static_cast<PseudoId>(pseudo)))1294 m_style->setHasPseudoStyle(static_cast<PseudoId>(pseudo));1295 }1296 if (m_elementLinkState == InsideUnvisitedLink)1297 m_visitedLinkStyle = 0; // We made the style to avoid timing attacks. Just throw it away now that we did that, since we don't need it.1298 else {1299 // Add the visited style off the main style.1300 m_visitedLinkStyle->setStyleType(VISITED_LINK);1301 m_style->addCachedPseudoStyle(m_visitedLinkStyle.release());1302 }1303 m_visitedLinkParentStyle = 0;1304 }1305 1306 1278 initElement(0); // Clear out for the next resolve. 1307 1279 … … 1425 1397 m_style = RenderStyle::create(); 1426 1398 1427 if (m_parentStyle) {1399 if (m_parentStyle) 1428 1400 m_style->inheritFrom(m_parentStyle); 1429 1430 // For links and elements inside links we compute both the regular and visited style.1431 if (m_parentStyle->insideLink()) {1432 m_visitedLinkParentStyle = m_parentStyle->getCachedPseudoStyle(VISITED_LINK);1433 if (!m_visitedLinkParentStyle)1434 m_visitedLinkParentStyle = m_parentStyle;1435 m_visitedLinkStyle = RenderStyle::create();1436 m_visitedLinkStyle->inheritFrom(m_visitedLinkParentStyle);1437 }1438 }1439 1401 1440 1402 // Since we don't use pseudo-elements in any of our quirk/print user agent rules, don't waste time walking … … 1490 1452 // Start loading images referenced by this style. 1491 1453 loadPendingImages(); 1492 1493 // Hang our visited style off m_style.1494 if (m_visitedLinkStyle) {1495 m_visitedLinkStyle->setStyleType(VISITED_LINK);1496 m_style->addCachedPseudoStyle(m_visitedLinkStyle.release());1497 m_visitedLinkParentStyle = 0;1498 }1499 1454 1500 1455 // Now return the style. … … 1747 1702 void CSSStyleSelector::updateFont() 1748 1703 { 1749 ASSERT(m_style != m_visitedLinkStyle);1750 1704 if (!m_fontDirty) 1751 1705 return; … … 2204 2158 // we apply line-height later 2205 2159 if (property == CSSPropertyLineHeight) { 2206 if (m_style == m_visitedLinkStyle)2207 continue;2208 2160 m_lineHeightValue = current.value(); 2209 2161 continue; … … 2223 2175 return; 2224 2176 2225 for (int i = startIndex; i <= endIndex; i++) { 2226 CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration; 2227 if (m_visitedLinkStyle && m_matchedDecls[i].linkMatchType & SelectorChecker::MatchVisited) { 2228 // FIXME: Style should be passed to applyProperty as an argument, not as a member. 2229 RefPtr<RenderStyle> savedStyle = m_style.release(); 2230 RenderStyle* savedParentStyle = m_parentStyle; 2231 m_style = m_visitedLinkStyle; 2232 m_parentStyle = m_visitedLinkParentStyle; 2233 2234 applyDeclaration<applyFirst>(styleDeclaration, isImportant); 2235 2236 m_style = savedStyle.release(); 2237 m_parentStyle = savedParentStyle; 2238 } 2239 if (m_matchedDecls[i].linkMatchType & SelectorChecker::MatchLink) 2177 if (m_element->isLink()) { 2178 for (int i = startIndex; i <= endIndex; ++i) { 2179 CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration; 2180 unsigned linkMatchType = m_matchedDecls[i].linkMatchType; 2181 // FIXME: It would be nicer to pass these as arguments but that requires changes in many places. 2182 m_applyPropertyToRegularStyle = linkMatchType & SelectorChecker::MatchLink; 2183 m_applyPropertyToVisitedLinkStyle = linkMatchType & SelectorChecker::MatchVisited; 2184 2240 2185 applyDeclaration<applyFirst>(styleDeclaration, isImportant); 2241 } 2186 } 2187 m_applyPropertyToRegularStyle = true; 2188 m_applyPropertyToVisitedLinkStyle = false; 2189 return; 2190 } 2191 for (int i = startIndex; i <= endIndex; ++i) 2192 applyDeclaration<applyFirst>(m_matchedDecls[i].styleDeclaration, isImportant); 2242 2193 } 2243 2194 … … 2424 2375 bool isInitial = valueType == CSSValue::CSS_INITIAL || (!m_parentNode && valueType == CSSValue::CSS_INHERIT); 2425 2376 2426 if ( m_style == m_visitedLinkStyle && !isValidVisitedLinkProperty(id)) {2377 if (!applyPropertyToRegularStyle() && (!applyPropertyToVisitedLinkStyle() || !isValidVisitedLinkProperty(id))) { 2427 2378 // Limit the properties that can be applied to only the ones honored by :visited. 2428 2379 return; … … 4943 4894 } 4944 4895 4945 Color CSSStyleSelector::getColorFromPrimitiveValue(CSSPrimitiveValue* primitiveValue ) const4896 Color CSSStyleSelector::getColorFromPrimitiveValue(CSSPrimitiveValue* primitiveValue, bool forVisitedLink) const 4946 4897 { 4947 4898 Color col; … … 4951 4902 col = m_element->document()->textColor(); 4952 4903 else if (ident == CSSValueWebkitLink) 4953 col = m_element->isLink() && m_style == m_visitedLinkStyle? m_element->document()->visitedLinkColor() : m_element->document()->linkColor();4904 col = (m_element->isLink() && forVisitedLink) ? m_element->document()->visitedLinkColor() : m_element->document()->linkColor(); 4954 4905 else if (ident == CSSValueWebkitActivelink) 4955 4906 col = m_element->document()->activeLinkColor(); -
trunk/Source/WebCore/css/CSSStyleSelector.h
r97248 r97638 174 174 bool useSVGZoomRules(); 175 175 176 Color getColorFromPrimitiveValue(CSSPrimitiveValue* ) const;176 Color getColorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink = false) const; 177 177 178 178 bool hasSelectorForAttribute(const AtomicString&) const; … … 261 261 StyleImage* styleImage(CSSPropertyID, CSSValue*); 262 262 StyleImage* cachedOrPendingFromValue(CSSPropertyID, CSSImageValue*); 263 264 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularStyle; } 265 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisitedLinkStyle; } 263 266 264 267 private: … … 335 338 336 339 RefPtr<RenderStyle> m_style; 337 RefPtr<RenderStyle> m_visitedLinkStyle;338 340 RenderStyle* m_parentStyle; 339 RenderStyle* m_visitedLinkParentStyle;340 341 RenderStyle* m_rootElementStyle; 341 342 Element* m_element; … … 352 353 Vector<MediaQueryResult*> m_viewportDependentMediaQueryResults; 353 354 355 bool m_applyPropertyToRegularStyle; 356 bool m_applyPropertyToVisitedLinkStyle; 354 357 const CSSStyleApplyProperty& m_applyProperty; 355 358 -
trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp
r92047 r97638 227 227 if (isInherit) { 228 228 const SVGRenderStyle* svgParentStyle = m_parentStyle->svgStyle(); 229 svgstyle->setFillPaint(svgParentStyle->fillPaintType(), svgParentStyle->fillPaintColor(), svgParentStyle->fillPaintUri() );229 svgstyle->setFillPaint(svgParentStyle->fillPaintType(), svgParentStyle->fillPaintColor(), svgParentStyle->fillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle()); 230 230 return; 231 231 } 232 232 if (isInitial) { 233 svgstyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri() );233 svgstyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle()); 234 234 return; 235 235 } 236 236 if (value->isSVGPaint()) { 237 237 SVGPaint* svgPaint = static_cast<SVGPaint*>(value); 238 svgstyle->setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri() );238 svgstyle->setFillPaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle()); 239 239 } 240 240 break; … … 244 244 if (isInherit) { 245 245 const SVGRenderStyle* svgParentStyle = m_parentStyle->svgStyle(); 246 svgstyle->setStrokePaint(svgParentStyle->strokePaintType(), svgParentStyle->strokePaintColor(), svgParentStyle->strokePaintUri() );246 svgstyle->setStrokePaint(svgParentStyle->strokePaintType(), svgParentStyle->strokePaintColor(), svgParentStyle->strokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle()); 247 247 return; 248 248 } 249 249 if (isInitial) { 250 svgstyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri() );250 svgstyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle()); 251 251 return; 252 252 } 253 253 if (value->isSVGPaint()) { 254 254 SVGPaint* svgPaint = static_cast<SVGPaint*>(value); 255 svgstyle->setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri() );255 svgstyle->setStrokePaint(svgPaint->paintType(), colorFromSVGColorCSSValue(svgPaint, m_style->color()), svgPaint->uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle()); 256 256 } 257 257 break; -
trunk/Source/WebCore/dom/Element.cpp
r96859 r97638 1018 1018 RefPtr<RenderStyle> newPseudoStyle; 1019 1019 PseudoId pseudoId = pseudoStyleCache->at(i)->styleType(); 1020 if (pseudoId == VISITED_LINK) { 1021 newPseudoStyle = newStyle->getCachedPseudoStyle(VISITED_LINK); // This pseudo-style was aggressively computed already when we first called styleForElement on the new style. 1022 if (!newPseudoStyle || *newPseudoStyle != *pseudoStyleCache->at(i)) 1023 return true; 1024 } else if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) 1020 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) 1025 1021 newPseudoStyle = renderer()->uncachedFirstLineStyle(newStyle); 1026 1022 else -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r97248 r97638 233 233 RenderStyle* RenderStyle::getCachedPseudoStyle(PseudoId pid) const 234 234 { 235 ASSERT(styleType() != VISITED_LINK);236 237 235 if (!m_cachedPseudoStyles || !m_cachedPseudoStyles->size()) 238 236 return 0; 239 237 240 if (styleType() != NOPSEUDO) { 241 if (pid == VISITED_LINK) 242 return m_cachedPseudoStyles->at(0)->styleType() == VISITED_LINK ? m_cachedPseudoStyles->at(0).get() : 0; 238 if (styleType() != NOPSEUDO) 243 239 return 0; 244 }245 240 246 241 for (size_t i = 0; i < m_cachedPseudoStyles->size(); ++i) { … … 1124 1119 } 1125 1120 1126 Color RenderStyle::colorIncludingFallback(int colorProperty ) const1121 Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) const 1127 1122 { 1128 1123 Color result; … … 1130 1125 switch (colorProperty) { 1131 1126 case CSSPropertyBackgroundColor: 1132 return backgroundColor(); // Background color doesn't fall back.1127 return visitedLink ? rareNonInheritedData->m_visitedLinkBackgroundColor : backgroundColor(); // Background color doesn't fall back. 1133 1128 case CSSPropertyBorderLeftColor: 1134 result = borderLeftColor();1129 result = visitedLink ? rareNonInheritedData->m_visitedLinkBorderLeftColor : borderLeftColor(); 1135 1130 borderStyle = borderLeftStyle(); 1136 1131 break; 1137 1132 case CSSPropertyBorderRightColor: 1138 result = borderRightColor();1133 result = visitedLink ? rareNonInheritedData->m_visitedLinkBorderRightColor : borderRightColor(); 1139 1134 borderStyle = borderRightStyle(); 1140 1135 break; 1141 1136 case CSSPropertyBorderTopColor: 1142 result = borderTopColor();1137 result = visitedLink ? rareNonInheritedData->m_visitedLinkBorderTopColor : borderTopColor(); 1143 1138 borderStyle = borderTopStyle(); 1144 1139 break; 1145 1140 case CSSPropertyBorderBottomColor: 1146 result = borderBottomColor();1141 result = visitedLink ? rareNonInheritedData->m_visitedLinkBorderBottomColor : borderBottomColor(); 1147 1142 borderStyle = borderBottomStyle(); 1148 1143 break; 1149 1144 case CSSPropertyColor: 1150 result = color();1145 result = visitedLink ? inherited->visitedLinkColor : color(); 1151 1146 break; 1152 1147 case CSSPropertyOutlineColor: 1153 result = outlineColor();1148 result = visitedLink ? rareNonInheritedData->m_visitedLinkOutlineColor : outlineColor(); 1154 1149 break; 1155 1150 case CSSPropertyWebkitColumnRuleColor: 1156 result = columnRuleColor();1151 result = visitedLink ? rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor : columnRuleColor(); 1157 1152 break; 1158 1153 case CSSPropertyWebkitTextEmphasisColor: 1159 result = textEmphasisColor();1154 result = visitedLink ? rareInheritedData->visitedLinkTextEmphasisColor : textEmphasisColor(); 1160 1155 break; 1161 1156 case CSSPropertyWebkitTextFillColor: 1162 result = textFillColor();1157 result = visitedLink ? rareInheritedData->visitedLinkTextFillColor : textFillColor(); 1163 1158 break; 1164 1159 case CSSPropertyWebkitTextStrokeColor: 1165 result = textStrokeColor();1160 result = visitedLink ? rareInheritedData->visitedLinkTextStrokeColor : textStrokeColor(); 1166 1161 break; 1167 1162 default: … … 1171 1166 1172 1167 if (!result.isValid()) { 1173 if ( borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE || borderStyle == GROOVE)1168 if (!visitedLink && (borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE || borderStyle == GROOVE)) 1174 1169 result.setRGB(238, 238, 238); 1175 1170 else 1176 result = color(); 1177 } 1178 1171 result = visitedLink ? inherited->visitedLinkColor : color(); 1172 } 1179 1173 return result; 1180 1174 } … … 1182 1176 Color RenderStyle::visitedDependentColor(int colorProperty) const 1183 1177 { 1184 Color unvisitedColor = colorIncludingFallback(colorProperty );1178 Color unvisitedColor = colorIncludingFallback(colorProperty, false); 1185 1179 if (insideLink() != InsideVisitedLink) 1186 1180 return unvisitedColor; 1187 1181 1188 RenderStyle* visitedStyle = getCachedPseudoStyle(VISITED_LINK); 1189 if (!visitedStyle) 1190 return unvisitedColor; 1191 Color visitedColor = visitedStyle->colorIncludingFallback(colorProperty); 1182 Color visitedColor = colorIncludingFallback(colorProperty, true); 1192 1183 1193 1184 // FIXME: Technically someone could explicitly specify the color transparent, but for now we'll just -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r97314 r97638 1481 1481 #endif 1482 1482 private: 1483 void setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v) } 1484 void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v) } 1485 void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v) } 1486 void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v) } 1487 void setVisitedLinkBorderBottomColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderBottomColor, v) } 1488 void setVisitedLinkBorderTopColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderTopColor, v) } 1489 void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v) } 1490 void setVisitedLinkColumnRuleColor(const Color& v) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_visitedLinkColumnRuleColor, v) } 1491 void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextEmphasisColor, v) } 1492 void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextFillColor, v) } 1493 void setVisitedLinkTextStrokeColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextStrokeColor, v) } 1494 1483 1495 void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags._unicodeBidi = parent->noninherited_flags._unicodeBidi; } 1484 1496 void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const; … … 1519 1531 const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; } 1520 1532 1521 Color colorIncludingFallback(int colorProperty ) const;1533 Color colorIncludingFallback(int colorProperty, bool visitedLink) const; 1522 1534 1523 1535 #if ENABLE(SVG) -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r97314 r97638 76 76 // Internal IDs follow: 77 77 SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER, 78 INPUT_LIST_BUTTON, VISITED_LINK,78 INPUT_LIST_BUTTON, 79 79 AFTER_LAST_INTERNAL_PSEUDOID, 80 80 FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_ANCESTOR, ANIMATING_FULL_SCREEN_TRANSITION, -
trunk/Source/WebCore/rendering/style/SVGRenderStyle.h
r93807 r97638 153 153 } 154 154 155 void setFillPaint(SVGPaint::SVGPaintType type, const Color& color, const String& uri) 156 { 157 if (!(fill->paintType == type)) 158 fill.access()->paintType = type; 159 if (!(fill->paintColor == color)) 160 fill.access()->paintColor = color; 161 if (!(fill->paintUri == uri)) 162 fill.access()->paintUri = uri; 155 void setFillPaint(SVGPaint::SVGPaintType type, const Color& color, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false) 156 { 157 if (applyToRegularStyle) { 158 if (!(fill->paintType == type)) 159 fill.access()->paintType = type; 160 if (!(fill->paintColor == color)) 161 fill.access()->paintColor = color; 162 if (!(fill->paintUri == uri)) 163 fill.access()->paintUri = uri; 164 } 165 if (applyToVisitedLinkStyle) { 166 if (!(fill->paintType == type)) 167 fill.access()->visitedLinkPaintType = type; 168 if (!(fill->paintColor == color)) 169 fill.access()->visitedLinkPaintColor = color; 170 if (!(fill->paintUri == uri)) 171 fill.access()->visitedLinkPaintUri = uri; 172 } 163 173 } 164 174 … … 169 179 } 170 180 171 void setStrokePaint(SVGPaint::SVGPaintType type, const Color& color, const String& uri) 172 { 173 if (!(stroke->paintType == type)) 174 stroke.access()->paintType = type; 175 if (!(stroke->paintColor == color)) 176 stroke.access()->paintColor = color; 177 if (!(stroke->paintUri == uri)) 178 stroke.access()->paintUri = uri; 181 void setStrokePaint(SVGPaint::SVGPaintType type, const Color& color, const String& uri, bool applyToRegularStyle = true, bool applyToVisitedLinkStyle = false) 182 { 183 if (applyToRegularStyle) { 184 if (!(stroke->paintType == type)) 185 stroke.access()->paintType = type; 186 if (!(stroke->paintColor == color)) 187 stroke.access()->paintColor = color; 188 if (!(stroke->paintUri == uri)) 189 stroke.access()->paintUri = uri; 190 } 191 if (applyToVisitedLinkStyle) { 192 if (!(stroke->paintType == type)) 193 stroke.access()->visitedLinkPaintType = type; 194 if (!(stroke->paintColor == color)) 195 stroke.access()->visitedLinkPaintColor = color; 196 if (!(stroke->paintUri == uri)) 197 stroke.access()->visitedLinkPaintUri = uri; 198 } 179 199 } 180 200 … … 328 348 String markerMidResource() const { return inheritedResources->markerMid; } 329 349 String markerEndResource() const { return inheritedResources->markerEnd; } 350 351 const SVGPaint::SVGPaintType& visitedLinkFillPaintType() const { return fill->visitedLinkPaintType; } 352 const Color& visitedLinkFillPaintColor() const { return fill->visitedLinkPaintColor; } 353 const String& visitedLinkFillPaintUri() const { return fill->visitedLinkPaintUri; } 354 const SVGPaint::SVGPaintType& visitedLinkStrokePaintType() const { return stroke->visitedLinkPaintType; } 355 const Color& visitedLinkStrokePaintColor() const { return stroke->visitedLinkPaintColor; } 356 const String& visitedLinkStrokePaintUri() const { return stroke->visitedLinkPaintUri; } 330 357 331 358 // convenience -
trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp
r85603 r97638 41 41 , paintColor(SVGRenderStyle::initialFillPaintColor()) 42 42 , paintUri(SVGRenderStyle::initialFillPaintUri()) 43 , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType()) 44 , visitedLinkPaintColor(SVGRenderStyle::initialFillPaintColor()) 45 , visitedLinkPaintUri(SVGRenderStyle::initialFillPaintUri()) 43 46 { 44 47 } … … 50 53 , paintColor(other.paintColor) 51 54 , paintUri(other.paintUri) 55 , visitedLinkPaintType(other.visitedLinkPaintType) 56 , visitedLinkPaintColor(other.visitedLinkPaintColor) 57 , visitedLinkPaintUri(other.visitedLinkPaintUri) 52 58 { 53 59 } … … 58 64 && paintType == other.paintType 59 65 && paintColor == other.paintColor 60 && paintUri == other.paintUri; 66 && paintUri == other.paintUri 67 && visitedLinkPaintType == other.visitedLinkPaintType 68 && visitedLinkPaintColor == other.visitedLinkPaintColor 69 && visitedLinkPaintUri == other.visitedLinkPaintUri; 61 70 } 62 71 … … 70 79 , paintColor(SVGRenderStyle::initialStrokePaintColor()) 71 80 , paintUri(SVGRenderStyle::initialStrokePaintUri()) 81 , visitedLinkPaintType(SVGRenderStyle::initialStrokePaintType()) 82 , visitedLinkPaintColor(SVGRenderStyle::initialStrokePaintColor()) 83 , visitedLinkPaintUri(SVGRenderStyle::initialStrokePaintUri()) 72 84 { 73 85 } … … 83 95 , paintColor(other.paintColor) 84 96 , paintUri(other.paintUri) 97 , visitedLinkPaintType(other.visitedLinkPaintType) 98 , visitedLinkPaintColor(other.visitedLinkPaintColor) 99 , visitedLinkPaintUri(other.visitedLinkPaintUri) 85 100 { 86 101 } … … 95 110 && paintType == other.paintType 96 111 && paintColor == other.paintColor 97 && paintUri == other.paintUri; 112 && paintUri == other.paintUri 113 && visitedLinkPaintType == other.visitedLinkPaintType 114 && visitedLinkPaintColor == other.visitedLinkPaintColor 115 && visitedLinkPaintUri == other.visitedLinkPaintUri; 98 116 } 99 117 -
trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h
r87121 r97638 104 104 Color paintColor; 105 105 String paintUri; 106 SVGPaint::SVGPaintType visitedLinkPaintType; 107 Color visitedLinkPaintColor; 108 String visitedLinkPaintUri; 106 109 107 110 private: … … 131 134 Color paintColor; 132 135 String paintUri; 136 SVGPaint::SVGPaintType visitedLinkPaintType; 137 Color visitedLinkPaintColor; 138 String visitedLinkPaintUri; 133 139 134 140 private: -
trunk/Source/WebCore/rendering/style/StyleInheritedData.cpp
r96935 r97638 34 34 , list_style_image(RenderStyle::initialListStyleImage()) 35 35 , color(RenderStyle::initialColor()) 36 , visitedLinkColor(RenderStyle::initialColor()) 36 37 { 37 38 } … … 49 50 , font(o.font) 50 51 , color(o.color) 52 , visitedLinkColor(o.visitedLinkColor) 51 53 { 52 54 } … … 54 56 bool StyleInheritedData::operator==(const StyleInheritedData& o) const 55 57 { 56 return 57 line_height == o.line_height &&58 StyleImage::imagesEquivalent(list_style_image.get(), o.list_style_image.get()) &&59 font == o.font &&60 color == o.color &&61 horizontal_border_spacing == o.horizontal_border_spacing &&62 vertical_border_spacing == o.vertical_border_spacing;58 return line_height == o.line_height 59 && StyleImage::imagesEquivalent(list_style_image.get(), o.list_style_image.get()) 60 && font == o.font 61 && color == o.color 62 && visitedLinkColor == o.visitedLinkColor 63 && horizontal_border_spacing == o.horizontal_border_spacing 64 && vertical_border_spacing == o.vertical_border_spacing; 63 65 } 64 66 -
trunk/Source/WebCore/rendering/style/StyleInheritedData.h
r96935 r97638 60 60 Font font; 61 61 Color color; 62 Color visitedLinkColor; 62 63 63 64 private: -
trunk/Source/WebCore/rendering/style/StyleMultiColData.cpp
r59968 r97638 47 47 , m_gap(o.m_gap) 48 48 , m_rule(o.m_rule) 49 , m_visitedLinkColumnRuleColor(o.m_visitedLinkColumnRuleColor) 49 50 , m_autoWidth(o.m_autoWidth) 50 51 , m_autoCount(o.m_autoCount) … … 60 61 { 61 62 return m_width == o.m_width && m_count == o.m_count && m_gap == o.m_gap 62 && m_rule == o.m_rule && m_ breakBefore == o.m_breakBefore63 && m_rule == o.m_rule && m_visitedLinkColumnRuleColor == o.m_visitedLinkColumnRuleColor && m_breakBefore == o.m_breakBefore 63 64 && m_autoWidth == o.m_autoWidth && m_autoCount == o.m_autoCount && m_normalGap == o.m_normalGap 64 65 && m_columnSpan == o.m_columnSpan && m_breakAfter == o.m_breakAfter && m_breakInside == o.m_breakInside; -
trunk/Source/WebCore/rendering/style/StyleMultiColData.h
r59968 r97638 58 58 float m_gap; 59 59 BorderValue m_rule; 60 Color m_visitedLinkColumnRuleColor; 60 61 61 62 bool m_autoWidth : 1; -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
r96433 r97638 69 69 , textFillColor(o.textFillColor) 70 70 , textEmphasisColor(o.textEmphasisColor) 71 , visitedLinkTextStrokeColor(o.visitedLinkTextStrokeColor) 72 , visitedLinkTextFillColor(o.visitedLinkTextFillColor) 73 , visitedLinkTextEmphasisColor(o.visitedLinkTextEmphasisColor) 71 74 , textShadow(o.textShadow ? adoptPtr(new ShadowData(*o.textShadow)) : nullptr) 72 75 , highlight(o.highlight) … … 124 127 && textFillColor == o.textFillColor 125 128 && textEmphasisColor == o.textEmphasisColor 129 && visitedLinkTextStrokeColor == o.visitedLinkTextStrokeColor 130 && visitedLinkTextFillColor == o.visitedLinkTextFillColor 131 && visitedLinkTextEmphasisColor == o.visitedLinkTextEmphasisColor 126 132 #if ENABLE(TOUCH_EVENTS) 127 133 && tapHighlightColor == o.tapHighlightColor -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h
r96433 r97638 58 58 Color textFillColor; 59 59 Color textEmphasisColor; 60 61 Color visitedLinkTextStrokeColor; 62 Color visitedLinkTextFillColor; 63 Color visitedLinkTextEmphasisColor; 60 64 61 65 OwnPtr<ShadowData> textShadow; // Our text shadow information for shadowed text drawing. -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r97308 r97638 45 45 , m_pageSize() 46 46 , m_wrapShape(RenderStyle::initialWrapShape()) 47 , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor()) 47 48 , m_flowThread(RenderStyle::initialFlowThread()) 48 49 , m_regionThread(RenderStyle::initialRegionThread()) … … 98 99 , m_pageSize(o.m_pageSize) 99 100 , m_wrapShape(o.m_wrapShape) 101 , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor) 102 , m_visitedLinkOutlineColor(o.m_visitedLinkBackgroundColor) 103 , m_visitedLinkBorderLeftColor(o.m_visitedLinkBorderLeftColor) 104 , m_visitedLinkBorderRightColor(o.m_visitedLinkBorderRightColor) 105 , m_visitedLinkBorderTopColor(o.m_visitedLinkBorderTopColor) 106 , m_visitedLinkBorderBottomColor(o.m_visitedLinkBorderBottomColor) 100 107 , m_flowThread(o.m_flowThread) 101 108 , m_regionThread(o.m_regionThread) … … 174 181 && (m_regionOverflow == o.m_regionOverflow) 175 182 && (m_wrapShape == o.m_wrapShape) 183 && m_visitedLinkBackgroundColor == o.m_visitedLinkBackgroundColor 184 && m_visitedLinkOutlineColor == o.m_visitedLinkOutlineColor 185 && m_visitedLinkBorderLeftColor == o.m_visitedLinkBorderLeftColor 186 && m_visitedLinkBorderRightColor == o.m_visitedLinkBorderRightColor 187 && m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor 188 && m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor 176 189 && (m_regionBreakAfter == o.m_regionBreakAfter) 177 190 && (m_regionBreakBefore == o.m_regionBreakBefore) -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r97308 r97638 130 130 131 131 RefPtr<CSSWrapShape> m_wrapShape; 132 133 Color m_visitedLinkBackgroundColor; 134 Color m_visitedLinkOutlineColor; 135 Color m_visitedLinkBorderLeftColor; 136 Color m_visitedLinkBorderRightColor; 137 Color m_visitedLinkBorderTopColor; 138 Color m_visitedLinkBorderBottomColor; 132 139 133 140 AtomicString m_flowThread; -
trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp
r89490 r97638 82 82 83 83 if (style->insideLink() == InsideVisitedLink) { 84 RenderStyle* visitedStyle = style->getCachedPseudoStyle(VISITED_LINK); 85 ASSERT(visitedStyle); 86 87 const SVGRenderStyle* svgVisitedStyle = visitedStyle->svgStyle(); 88 SVGPaint::SVGPaintType visitedPaintType = applyToFill ? svgVisitedStyle->fillPaintType() : svgVisitedStyle->strokePaintType(); 84 // FIXME: This code doesn't support the uri component of the visited link paint, https://bugs.webkit.org/show_bug.cgi?id=70006 85 SVGPaint::SVGPaintType visitedPaintType = applyToFill ? svgStyle->visitedLinkFillPaintType() : svgStyle->visitedLinkStrokePaintType(); 89 86 90 87 // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'. 91 88 if (visitedPaintType < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaintType != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) { 92 const Color& visitedColor = applyToFill ? svg VisitedStyle->fillPaintColor() : svgVisitedStyle->strokePaintColor();89 const Color& visitedColor = applyToFill ? svgStyle->visitedLinkFillPaintColor() : svgStyle->visitedLinkStrokePaintColor(); 93 90 if (visitedColor.isValid()) 94 91 color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
Note: See TracChangeset
for help on using the changeset viewer.