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

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

Issue 2715353003: Allow clicks > 1 to navigate. (Closed)
Patch Set: Created 3 years, 9 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/html/text-level-semantics/a-click.html ('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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() && 454 return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() &&
455 toKeyboardEvent(event)->key() == "Enter" && 455 toKeyboardEvent(event)->key() == "Enter" &&
456 !toKeyboardEvent(event)->repeat(); 456 !toKeyboardEvent(event)->repeat();
457 } 457 }
458 458
459 bool isLinkClick(Event* event) { 459 bool isLinkClick(Event* event) {
460 // Allow detail <= 1 so that synthetic clicks work. They may have detail == 0. 460 // Allow detail <= 1 so that synthetic clicks work. They may have detail == 0.
461 return (event->type() == EventTypeNames::click || 461 return (event->type() == EventTypeNames::click ||
462 event->type() == EventTypeNames::auxclick) && 462 event->type() == EventTypeNames::auxclick) &&
463 (!event->isMouseEvent() || 463 (!event->isMouseEvent() ||
464 (toMouseEvent(event)->button() != 464 toMouseEvent(event)->button() !=
465 static_cast<short>(WebPointerProperties::Button::Right) && 465 static_cast<short>(WebPointerProperties::Button::Right));
466 toMouseEvent(event)->detail() <= 1));
467 } 466 }
468 467
469 bool HTMLAnchorElement::willRespondToMouseClickEvents() { 468 bool HTMLAnchorElement::willRespondToMouseClickEvents() {
470 return isLink() || HTMLElement::willRespondToMouseClickEvents(); 469 return isLink() || HTMLElement::willRespondToMouseClickEvents();
471 } 470 }
472 471
473 bool HTMLAnchorElement::isInteractiveContent() const { 472 bool HTMLAnchorElement::isInteractiveContent() const {
474 return isLink(); 473 return isLink();
475 } 474 }
476 475
477 Node::InsertionNotificationRequest HTMLAnchorElement::insertedInto( 476 Node::InsertionNotificationRequest HTMLAnchorElement::insertedInto(
478 ContainerNode* insertionPoint) { 477 ContainerNode* insertionPoint) {
479 InsertionNotificationRequest request = 478 InsertionNotificationRequest request =
480 HTMLElement::insertedInto(insertionPoint); 479 HTMLElement::insertedInto(insertionPoint);
481 logAddElementIfIsolatedWorldAndInDocument("a", hrefAttr); 480 logAddElementIfIsolatedWorldAndInDocument("a", hrefAttr);
482 return request; 481 return request;
483 } 482 }
484 483
485 HTMLAnchorElement::NavigationHintSender* 484 HTMLAnchorElement::NavigationHintSender*
486 HTMLAnchorElement::ensureNavigationHintSender() { 485 HTMLAnchorElement::ensureNavigationHintSender() {
487 if (!m_navigationHintSender) 486 if (!m_navigationHintSender)
488 m_navigationHintSender = NavigationHintSender::create(this); 487 m_navigationHintSender = NavigationHintSender::create(this);
489 return m_navigationHintSender; 488 return m_navigationHintSender;
490 } 489 }
491 490
492 } // namespace blink 491 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/html/text-level-semantics/a-click.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698