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

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

Issue 2623163002: Updating href attribute should not blur. (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/update-href-of-focused-anchor-expected.txt ('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 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return; 249 return;
250 250
251 ContainerNode::setActive(down); 251 ContainerNode::setActive(down);
252 } 252 }
253 253
254 void HTMLAnchorElement::attributeChanged( 254 void HTMLAnchorElement::attributeChanged(
255 const AttributeModificationParams& params) { 255 const AttributeModificationParams& params) {
256 HTMLElement::attributeChanged(params); 256 HTMLElement::attributeChanged(params);
257 if (params.reason != AttributeModificationReason::kDirectly) 257 if (params.reason != AttributeModificationReason::kDirectly)
258 return; 258 return;
259 if (params.name != hrefAttr && isLink()) 259 if (params.name != hrefAttr)
260 return; 260 return;
261 if (adjustedFocusedElementInTreeScope() != this) 261 if (!isLink() && adjustedFocusedElementInTreeScope() == this)
262 return; 262 blur();
263 blur();
264 } 263 }
265 264
266 void HTMLAnchorElement::parseAttribute( 265 void HTMLAnchorElement::parseAttribute(
267 const AttributeModificationParams& params) { 266 const AttributeModificationParams& params) {
268 if (params.name == hrefAttr) { 267 if (params.name == hrefAttr) {
269 bool wasLink = isLink(); 268 bool wasLink = isLink();
270 setIsLink(!params.newValue.isNull()); 269 setIsLink(!params.newValue.isNull());
271 if (wasLink || isLink()) { 270 if (wasLink || isLink()) {
272 pseudoStateChanged(CSSSelector::PseudoLink); 271 pseudoStateChanged(CSSSelector::PseudoLink);
273 pseudoStateChanged(CSSSelector::PseudoVisited); 272 pseudoStateChanged(CSSSelector::PseudoVisited);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 480 }
482 481
483 HTMLAnchorElement::NavigationHintSender* 482 HTMLAnchorElement::NavigationHintSender*
484 HTMLAnchorElement::ensureNavigationHintSender() { 483 HTMLAnchorElement::ensureNavigationHintSender() {
485 if (!m_navigationHintSender) 484 if (!m_navigationHintSender)
486 m_navigationHintSender = NavigationHintSender::create(this); 485 m_navigationHintSender = NavigationHintSender::create(this);
487 return m_navigationHintSender; 486 return m_navigationHintSender;
488 } 487 }
489 488
490 } // namespace blink 489 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/update-href-of-focused-anchor-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698