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

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

Issue 400763002: Adding relList attr to link and anchor element Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: modified as per review comment Created 6 years, 5 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 10 matching lines...) Expand all
21 * 21 *
22 */ 22 */
23 23
24 #ifndef HTMLAnchorElement_h 24 #ifndef HTMLAnchorElement_h
25 #define HTMLAnchorElement_h 25 #define HTMLAnchorElement_h
26 26
27 #include "core/HTMLNames.h" 27 #include "core/HTMLNames.h"
28 #include "core/dom/DOMURLUtils.h" 28 #include "core/dom/DOMURLUtils.h"
29 #include "core/dom/Document.h" 29 #include "core/dom/Document.h"
30 #include "core/html/HTMLElement.h" 30 #include "core/html/HTMLElement.h"
31 #include "core/html/RelList.h"
Inactive 2014/07/25 12:55:51 Cannot this be forward-declared?
31 #include "platform/LinkHash.h" 32 #include "platform/LinkHash.h"
32 33
33 namespace WebCore { 34 namespace WebCore {
34 35
35 // Link relation bitmask values. 36 // Link relation bitmask values.
36 // FIXME: Uncomment as the various link relations are implemented. 37 // FIXME: Uncomment as the various link relations are implemented.
37 enum { 38 enum {
38 // RelationAlternate = 0x00000001, 39 // RelationAlternate = 0x00000001,
39 // RelationArchives = 0x00000002, 40 // RelationArchives = 0x00000002,
40 // RelationAuthor = 0x00000004, 41 // RelationAuthor = 0x00000004,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 virtual String input() const OVERRIDE FINAL; 73 virtual String input() const OVERRIDE FINAL;
73 virtual void setInput(const String&) OVERRIDE FINAL; 74 virtual void setInput(const String&) OVERRIDE FINAL;
74 75
75 bool isLiveLink() const; 76 bool isLiveLink() const;
76 77
77 virtual bool willRespondToMouseClickEvents() OVERRIDE FINAL; 78 virtual bool willRespondToMouseClickEvents() OVERRIDE FINAL;
78 79
79 bool hasRel(uint32_t relation) const; 80 bool hasRel(uint32_t relation) const;
80 void setRel(const AtomicString&); 81 void setRel(const AtomicString&);
81 82
83 DOMTokenList& relList();
84
82 LinkHash visitedLinkHash() const; 85 LinkHash visitedLinkHash() const;
83 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; } 86 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; }
84 87
85 protected: 88 protected:
86 HTMLAnchorElement(const QualifiedName&, Document&); 89 HTMLAnchorElement(const QualifiedName&, Document&);
87 90
88 virtual void attributeWillChange(const QualifiedName&, const AtomicString& o ldValue, const AtomicString& newValue) OVERRIDE; 91 virtual void attributeWillChange(const QualifiedName&, const AtomicString& o ldValue, const AtomicString& newValue) OVERRIDE;
89 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 92 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
90 virtual bool supportsFocus() const OVERRIDE; 93 virtual bool supportsFocus() const OVERRIDE;
91 94
92 private: 95 private:
93 virtual bool isMouseFocusable() const OVERRIDE; 96 virtual bool isMouseFocusable() const OVERRIDE;
94 virtual bool isKeyboardFocusable() const OVERRIDE; 97 virtual bool isKeyboardFocusable() const OVERRIDE;
95 virtual void defaultEventHandler(Event*) OVERRIDE FINAL; 98 virtual void defaultEventHandler(Event*) OVERRIDE FINAL;
96 virtual void setActive(bool = true) OVERRIDE FINAL; 99 virtual void setActive(bool = true) OVERRIDE FINAL;
97 virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE FINAL; 100 virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE FINAL;
98 virtual bool isURLAttribute(const Attribute&) const OVERRIDE FINAL; 101 virtual bool isURLAttribute(const Attribute&) const OVERRIDE FINAL;
99 virtual bool hasLegalLinkAttribute(const QualifiedName&) const OVERRIDE FINA L; 102 virtual bool hasLegalLinkAttribute(const QualifiedName&) const OVERRIDE FINA L;
100 virtual bool canStartSelection() const OVERRIDE FINAL; 103 virtual bool canStartSelection() const OVERRIDE FINAL;
101 virtual short tabIndex() const OVERRIDE FINAL; 104 virtual short tabIndex() const OVERRIDE FINAL;
102 virtual bool draggable() const OVERRIDE FINAL; 105 virtual bool draggable() const OVERRIDE FINAL;
103 virtual bool isInteractiveContent() const OVERRIDE FINAL; 106 virtual bool isInteractiveContent() const OVERRIDE FINAL;
104 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 107 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
105 108
106 void sendPings(const KURL& destinationURL); 109 void sendPings(const KURL& destinationURL);
107 void handleClick(Event*); 110 void handleClick(Event*);
108 111
109 uint32_t m_linkRelations; 112 uint32_t m_linkRelations;
110 mutable LinkHash m_cachedVisitedLinkHash; 113 mutable LinkHash m_cachedVisitedLinkHash;
114 OwnPtrWillBeMember<RelList> m_relList;
111 }; 115 };
112 116
113 inline LinkHash HTMLAnchorElement::visitedLinkHash() const 117 inline LinkHash HTMLAnchorElement::visitedLinkHash() const
114 { 118 {
115 if (!m_cachedVisitedLinkHash) 119 if (!m_cachedVisitedLinkHash)
116 m_cachedVisitedLinkHash = WebCore::visitedLinkHash(document().baseURL(), fastGetAttribute(HTMLNames::hrefAttr)); 120 m_cachedVisitedLinkHash = WebCore::visitedLinkHash(document().baseURL(), fastGetAttribute(HTMLNames::hrefAttr));
117 return m_cachedVisitedLinkHash; 121 return m_cachedVisitedLinkHash;
118 } 122 }
119 123
120 // Functions shared with the other anchor elements (i.e., SVG). 124 // Functions shared with the other anchor elements (i.e., SVG).
121 125
122 bool isEnterKeyKeydownEvent(Event*); 126 bool isEnterKeyKeydownEvent(Event*);
123 bool isLinkClick(Event*); 127 bool isLinkClick(Event*);
124 128
125 } // namespace WebCore 129 } // namespace WebCore
126 130
127 #endif // HTMLAnchorElement_h 131 #endif // HTMLAnchorElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698