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

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

Issue 2778173002: Revert of "Speculatively launch Service Workers on mouse/touch events." (Closed)
Patch Set: rebase Created 3 years, 8 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) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool willRespondToMouseClickEvents() final; 81 bool willRespondToMouseClickEvents() final;
82 82
83 bool hasRel(uint32_t relation) const; 83 bool hasRel(uint32_t relation) const;
84 void setRel(const AtomicString&); 84 void setRel(const AtomicString&);
85 85
86 LinkHash visitedLinkHash() const; 86 LinkHash visitedLinkHash() const;
87 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; } 87 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; }
88 88
89 void sendPings(const KURL& destinationURL) const; 89 void sendPings(const KURL& destinationURL) const;
90 90
91 DECLARE_VIRTUAL_TRACE();
92
93 protected: 91 protected:
94 HTMLAnchorElement(const QualifiedName&, Document&); 92 HTMLAnchorElement(const QualifiedName&, Document&);
95 93
96 void parseAttribute(const AttributeModificationParams&) override; 94 void parseAttribute(const AttributeModificationParams&) override;
97 bool supportsFocus() const override; 95 bool supportsFocus() const override;
98 bool matchesEnabledPseudoClass() const override; 96 bool matchesEnabledPseudoClass() const override;
99 97
100 private: 98 private:
101 class NavigationHintSender;
102
103 void attributeChanged(const AttributeModificationParams&) override; 99 void attributeChanged(const AttributeModificationParams&) override;
104 bool shouldHaveFocusAppearance() const final; 100 bool shouldHaveFocusAppearance() const final;
105 void dispatchFocusEvent(Element* oldFocusedElement, 101 void dispatchFocusEvent(Element* oldFocusedElement,
106 WebFocusType, 102 WebFocusType,
107 InputDeviceCapabilities* sourceCapabilities) override; 103 InputDeviceCapabilities* sourceCapabilities) override;
108 void dispatchBlurEvent(Element* newFocusedElement, 104 void dispatchBlurEvent(Element* newFocusedElement,
109 WebFocusType, 105 WebFocusType,
110 InputDeviceCapabilities* sourceCapabilities) override; 106 InputDeviceCapabilities* sourceCapabilities) override;
111 bool isMouseFocusable() const override; 107 bool isMouseFocusable() const override;
112 bool isKeyboardFocusable() const override; 108 bool isKeyboardFocusable() const override;
113 void defaultEventHandler(Event*) final; 109 void defaultEventHandler(Event*) final;
114 void setActive(bool = true) final; 110 void setActive(bool = true) final;
115 void accessKeyAction(bool sendMouseEvents) final; 111 void accessKeyAction(bool sendMouseEvents) final;
116 bool isURLAttribute(const Attribute&) const final; 112 bool isURLAttribute(const Attribute&) const final;
117 bool hasLegalLinkAttribute(const QualifiedName&) const final; 113 bool hasLegalLinkAttribute(const QualifiedName&) const final;
118 bool canStartSelection() const final; 114 bool canStartSelection() const final;
119 int tabIndex() const final; 115 int tabIndex() const final;
120 bool draggable() const final; 116 bool draggable() const final;
121 bool isInteractiveContent() const final; 117 bool isInteractiveContent() const final;
122 InsertionNotificationRequest insertedInto(ContainerNode*) override; 118 InsertionNotificationRequest insertedInto(ContainerNode*) override;
123 void handleClick(Event*); 119 void handleClick(Event*);
124 NavigationHintSender* ensureNavigationHintSender();
125 120
126 uint32_t m_linkRelations; 121 uint32_t m_linkRelations;
127 mutable LinkHash m_cachedVisitedLinkHash; 122 mutable LinkHash m_cachedVisitedLinkHash;
128 bool m_wasFocusedByMouse; 123 bool m_wasFocusedByMouse;
129 Member<NavigationHintSender> m_navigationHintSender;
130 }; 124 };
131 125
132 inline LinkHash HTMLAnchorElement::visitedLinkHash() const { 126 inline LinkHash HTMLAnchorElement::visitedLinkHash() const {
133 if (!m_cachedVisitedLinkHash) 127 if (!m_cachedVisitedLinkHash)
134 m_cachedVisitedLinkHash = blink::visitedLinkHash( 128 m_cachedVisitedLinkHash = blink::visitedLinkHash(
135 document().baseURL(), fastGetAttribute(HTMLNames::hrefAttr)); 129 document().baseURL(), fastGetAttribute(HTMLNames::hrefAttr));
136 return m_cachedVisitedLinkHash; 130 return m_cachedVisitedLinkHash;
137 } 131 }
138 132
139 // Functions shared with the other anchor elements (i.e., SVG). 133 // Functions shared with the other anchor elements (i.e., SVG).
140 134
141 bool isEnterKeyKeydownEvent(Event*); 135 bool isEnterKeyKeydownEvent(Event*);
142 bool isLinkClick(Event*); 136 bool isLinkClick(Event*);
143 137
144 } // namespace blink 138 } // namespace blink
145 139
146 #endif // HTMLAnchorElement_h 140 #endif // HTMLAnchorElement_h
OLDNEW
« no previous file with comments | « content/public/common/content_features.cc ('k') | third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698