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

Side by Side Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 889803003: Use style invalidation for :-webkit-any-link. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@kde.org>
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 192 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
193 { 193 {
194 if (name == hrefAttr) { 194 if (name == hrefAttr) {
195 bool wasLink = isLink(); 195 bool wasLink = isLink();
196 setIsLink(!value.isNull()); 196 setIsLink(!value.isNull());
197 if (wasLink || isLink()) { 197 if (wasLink || isLink()) {
198 pseudoStateChanged(CSSSelector::PseudoLink); 198 pseudoStateChanged(CSSSelector::PseudoLink);
199 pseudoStateChanged(CSSSelector::PseudoVisited); 199 pseudoStateChanged(CSSSelector::PseudoVisited);
200 pseudoStateChanged(CSSSelector::PseudoAnyLink);
esprehn 2015/02/01 14:41:49 Hopefully doing this tree times isn't too expensiv
200 } 201 }
201 if (wasLink && !isLink() && treeScope().adjustedFocusedElement() == this ) { 202 if (wasLink && !isLink() && treeScope().adjustedFocusedElement() == this ) {
202 // We might want to call blur(), but it's dangerous to dispatch 203 // We might want to call blur(), but it's dangerous to dispatch
203 // events here. 204 // events here.
204 document().setNeedsFocusedElementCheck(); 205 document().setNeedsFocusedElementCheck();
205 } 206 }
206 if (isLink()) { 207 if (isLink()) {
207 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); 208 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
208 if (document().isDNSPrefetchEnabled()) { 209 if (document().isDNSPrefetchEnabled()) {
209 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//")) 210 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//"))
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 Vector<String> argv; 390 Vector<String> argv;
390 argv.append("a"); 391 argv.append("a");
391 argv.append(fastGetAttribute(hrefAttr)); 392 argv.append(fastGetAttribute(hrefAttr));
392 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() ); 393 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() );
393 } 394 }
394 } 395 }
395 return HTMLElement::insertedInto(insertionPoint); 396 return HTMLElement::insertedInto(insertionPoint);
396 } 397 }
397 398
398 } 399 }
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698