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

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

Issue 2163893003: Start sending auxclick instead of click for non-primary buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing auxclick polyfill for remote devtools Created 4 years, 4 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 449 }
450 450
451 bool isEnterKeyKeydownEvent(Event* event) 451 bool isEnterKeyKeydownEvent(Event* event)
452 { 452 {
453 return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() && toKeyboardEvent(event)->key() == "Enter" && !toKeyboardEvent(event)->repeat() ; 453 return event->type() == EventTypeNames::keydown && event->isKeyboardEvent() && toKeyboardEvent(event)->key() == "Enter" && !toKeyboardEvent(event)->repeat() ;
454 } 454 }
455 455
456 bool isLinkClick(Event* event) 456 bool isLinkClick(Event* event)
457 { 457 {
458 // Allow detail <= 1 so that synthetic clicks work. They may have detail == 0. 458 // Allow detail <= 1 so that synthetic clicks work. They may have detail == 0.
459 return event->type() == EventTypeNames::click && (!event->isMouseEvent() || (toMouseEvent(event)->button() != RightButton && toMouseEvent(event)->detail() < = 1)); 459 return (event->type() == EventTypeNames::click || event->type() == EventType Names::auxclick) && (!event->isMouseEvent() || (toMouseEvent(event)->button() != RightButton && toMouseEvent(event)->detail() <= 1));
460 } 460 }
461 461
462 bool HTMLAnchorElement::willRespondToMouseClickEvents() 462 bool HTMLAnchorElement::willRespondToMouseClickEvents()
463 { 463 {
464 return isLink() || HTMLElement::willRespondToMouseClickEvents(); 464 return isLink() || HTMLElement::willRespondToMouseClickEvents();
465 } 465 }
466 466
467 bool HTMLAnchorElement::isInteractiveContent() const 467 bool HTMLAnchorElement::isInteractiveContent() const
468 { 468 {
469 return isLink(); 469 return isLink();
470 } 470 }
471 471
472 Node::InsertionNotificationRequest HTMLAnchorElement::insertedInto(ContainerNode * insertionPoint) 472 Node::InsertionNotificationRequest HTMLAnchorElement::insertedInto(ContainerNode * insertionPoint)
473 { 473 {
474 InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPo int); 474 InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPo int);
475 logAddElementIfIsolatedWorldAndInDocument("a", hrefAttr); 475 logAddElementIfIsolatedWorldAndInDocument("a", hrefAttr);
476 return request; 476 return request;
477 } 477 }
478 478
479 HTMLAnchorElement::NavigationHintSender* HTMLAnchorElement::ensureNavigationHint Sender() 479 HTMLAnchorElement::NavigationHintSender* HTMLAnchorElement::ensureNavigationHint Sender()
480 { 480 {
481 if (!m_navigationHintSender) 481 if (!m_navigationHintSender)
482 m_navigationHintSender = NavigationHintSender::create(this); 482 m_navigationHintSender = NavigationHintSender::create(this);
483 return m_navigationHintSender; 483 return m_navigationHintSender;
484 } 484 }
485 485
486 } // namespace blink 486 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698