Changeset 57299 in webkit
- Timestamp:
- Apr 8, 2010 3:37:37 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57297 r57299 1 2010-04-08 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Followup optimization to bug 24300, don't leak history info via CSS :visited. If a Web 6 site uses document colors that are the same for link and vlink in HTML and also doesn't 7 specify any :link or :visited rules, then don't waste time resolving visited styles. 8 9 There is a further optimization that could be done to detect when :link and :visited are 10 used together in the same rule to specify a color, and this is how most sites turn off 11 visited link colors, but this fix doesn't address that. It just restores the optimization 12 that existed prior to the patch in 24300 landing. 13 14 * css/CSSGrammar.y: 15 * css/CSSStyleSelector.cpp: 16 (WebCore::CSSStyleSelector::styleForElement): 17 * dom/Document.cpp: 18 (WebCore::Document::Document): 19 * dom/Document.h: 20 (WebCore::Document::usesLinkRules): 21 (WebCore::Document::setUsesLinkRules): 22 1 23 2010-04-08 David Hyatt <hyatt@apple.com> 2 24 -
trunk/WebCore/css/CSSGrammar.y
r57161 r57299 1096 1096 if (Document* doc = p->document()) 1097 1097 doc->setUsesBeforeAfterRules(true); 1098 } else if (type == CSSSelector::PseudoLink || type == CSSSelector::PseudoVisited) { 1099 CSSParser* p = static_cast<CSSParser*>(parser); 1100 if (Document* doc = p->document()) 1101 doc->setUsesLinkRules(true); 1098 1102 } 1099 1103 } -
trunk/WebCore/css/CSSStyleSelector.cpp
r57292 r57299 1319 1319 1320 1320 // Compute our style allowing :visited to match. 1321 if (!matchVisitedRules && m_style->insideLink() ) {1321 if (!matchVisitedRules && m_style->insideLink() && e->document()->usesLinkRules()) { 1322 1322 // Fetch our parent style. 1323 1323 RenderStyle* parentStyle = m_parentStyle; -
trunk/WebCore/dom/Document.cpp
r57210 r57299 429 429 m_usesBeforeAfterRules = false; 430 430 m_usesRemUnits = false; 431 m_usesLinkRules = false; 431 432 432 433 m_gotoAnchorNeededAfterStylesheetsLoad = false; -
trunk/WebCore/dom/Document.h
r57210 r57299 441 441 bool usesRemUnits() const { return m_usesRemUnits; } 442 442 void setUsesRemUnits(bool b) { m_usesRemUnits = b; } 443 bool usesLinkRules() const { return linkColor() != visitedLinkColor() || m_usesLinkRules; } 444 void setUsesLinkRules(bool b) { m_usesLinkRules = b; } 443 445 444 446 // Machinery for saving and restoring state when you leave and then go back to a page. … … 1102 1104 bool m_usesBeforeAfterRules; 1103 1105 bool m_usesRemUnits; 1106 bool m_usesLinkRules; 1104 1107 bool m_gotoAnchorNeededAfterStylesheetsLoad; 1105 1108 bool m_isDNSPrefetchEnabled;
Note: See TracChangeset
for help on using the changeset viewer.