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

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

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 HTMLElement::attributeWillChange(name, oldValue, newValue); 187 HTMLElement::attributeWillChange(name, oldValue, newValue);
188 } 188 }
189 189
190 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 190 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
191 { 191 {
192 if (name == hrefAttr) { 192 if (name == hrefAttr) {
193 bool wasLink = isLink(); 193 bool wasLink = isLink();
194 setIsLink(!value.isNull()); 194 setIsLink(!value.isNull());
195 if (wasLink || isLink()) { 195 if (wasLink || isLink()) {
196 AffectedSelectorMask affectedPseudo = AffectedSelectorLink | Affecte dSelectorVisited; 196 pseudoStateChanged(CSSSelector::PseudoLink);
197 pseudoStateChanged(CSSSelector::PseudoVisited);
197 if (wasLink != isLink()) 198 if (wasLink != isLink())
198 affectedPseudo |= AffectedSelectorEnabled; 199 pseudoStateChanged(CSSSelector::PseudoEnabled);
199 didAffectSelector(affectedPseudo);
200 } 200 }
201 if (wasLink && !isLink() && treeScope().adjustedFocusedElement() == this ) { 201 if (wasLink && !isLink() && treeScope().adjustedFocusedElement() == this ) {
202 // We might want to call blur(), but it's dangerous to dispatch 202 // We might want to call blur(), but it's dangerous to dispatch
203 // events here. 203 // events here.
204 document().setNeedsFocusedElementCheck(); 204 document().setNeedsFocusedElementCheck();
205 } 205 }
206 if (isLink()) { 206 if (isLink()) {
207 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); 207 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
208 if (document().isDNSPrefetchEnabled()) { 208 if (document().isDNSPrefetchEnabled()) {
209 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//")) 209 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//"))
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 Vector<String> argv; 393 Vector<String> argv;
394 argv.append("a"); 394 argv.append("a");
395 argv.append(fastGetAttribute(hrefAttr)); 395 argv.append(fastGetAttribute(hrefAttr));
396 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() ); 396 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() );
397 } 397 }
398 } 398 }
399 return HTMLElement::insertedInto(insertionPoint); 399 return HTMLElement::insertedInto(insertionPoint);
400 } 400 }
401 401
402 } 402 }
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/SelectRuleFeatureSet.cpp ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698