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

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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 HTMLElement::attributeWillChange(name, oldValue, newValue); 190 HTMLElement::attributeWillChange(name, oldValue, newValue);
191 } 191 }
192 192
193 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 193 void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
194 { 194 {
195 if (name == hrefAttr) { 195 if (name == hrefAttr) {
196 bool wasLink = isLink(); 196 bool wasLink = isLink();
197 setIsLink(!value.isNull()); 197 setIsLink(!value.isNull());
198 if (wasLink || isLink()) { 198 if (wasLink || isLink()) {
199 AffectedSelectorMask affectedPseudo = AffectedSelectorLink | Affecte dSelectorVisited; 199 pseudoStateChanged(CSSSelector::PseudoLink);
200 pseudoStateChanged(CSSSelector::PseudoVisited);
200 if (wasLink != isLink()) 201 if (wasLink != isLink())
201 affectedPseudo |= AffectedSelectorEnabled; 202 pseudoStateChanged(CSSSelector::PseudoEnabled);
202 didAffectSelector(affectedPseudo);
203 } 203 }
204 if (wasLink && !isLink() && treeScope().adjustedFocusedElement() == this ) { 204 if (wasLink && !isLink() && treeScope().adjustedFocusedElement() == this ) {
205 // We might want to call blur(), but it's dangerous to dispatch 205 // We might want to call blur(), but it's dangerous to dispatch
206 // events here. 206 // events here.
207 document().setNeedsFocusedElementCheck(); 207 document().setNeedsFocusedElementCheck();
208 } 208 }
209 if (isLink()) { 209 if (isLink()) {
210 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); 210 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
211 if (document().isDNSPrefetchEnabled()) { 211 if (document().isDNSPrefetchEnabled()) {
212 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//")) 212 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//"))
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 Vector<String> argv; 396 Vector<String> argv;
397 argv.append("a"); 397 argv.append("a");
398 argv.append(fastGetAttribute(hrefAttr)); 398 argv.append(fastGetAttribute(hrefAttr));
399 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() ); 399 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data() );
400 } 400 }
401 } 401 }
402 return HTMLElement::insertedInto(insertionPoint); 402 return HTMLElement::insertedInto(insertionPoint);
403 } 403 }
404 404
405 } 405 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698