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

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

Issue 24066010: Implement URLUtils and URL interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git rebase Created 7 years, 2 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 | Annotate | Revision Log
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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
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 "HTMLNames.h" 27 #include "HTMLNames.h"
28 #include "core/html/DOMURLUtils.h"
28 #include "core/html/HTMLElement.h" 29 #include "core/html/HTMLElement.h"
29 #include "platform/LinkHash.h" 30 #include "platform/LinkHash.h"
30 31
31 namespace WebCore { 32 namespace WebCore {
32 33
33 // Link relation bitmask values. 34 // Link relation bitmask values.
34 // FIXME: Uncomment as the various link relations are implemented. 35 // FIXME: Uncomment as the various link relations are implemented.
35 enum { 36 enum {
36 // RelationAlternate = 0x00000001, 37 // RelationAlternate = 0x00000001,
37 // RelationArchives = 0x00000002, 38 // RelationArchives = 0x00000002,
38 // RelationAuthor = 0x00000004, 39 // RelationAuthor = 0x00000004,
39 // RelationBoomark = 0x00000008, 40 // RelationBoomark = 0x00000008,
40 // RelationExternal = 0x00000010, 41 // RelationExternal = 0x00000010,
41 // RelationFirst = 0x00000020, 42 // RelationFirst = 0x00000020,
42 // RelationHelp = 0x00000040, 43 // RelationHelp = 0x00000040,
43 // RelationIndex = 0x00000080, 44 // RelationIndex = 0x00000080,
44 // RelationLast = 0x00000100, 45 // RelationLast = 0x00000100,
45 // RelationLicense = 0x00000200, 46 // RelationLicense = 0x00000200,
46 // RelationNext = 0x00000400, 47 // RelationNext = 0x00000400,
47 // RelationNoFolow = 0x00000800, 48 // RelationNoFolow = 0x00000800,
48 RelationNoReferrer = 0x00001000, 49 RelationNoReferrer = 0x00001000,
49 // RelationPrev = 0x00002000, 50 // RelationPrev = 0x00002000,
50 // RelationSearch = 0x00004000, 51 // RelationSearch = 0x00004000,
51 // RelationSidebar = 0x00008000, 52 // RelationSidebar = 0x00008000,
52 // RelationTag = 0x00010000, 53 // RelationTag = 0x00010000,
53 // RelationUp = 0x00020000, 54 // RelationUp = 0x00020000,
54 }; 55 };
55 56
56 class HTMLAnchorElement : public HTMLElement { 57 class HTMLAnchorElement : public HTMLElement, public DOMURLUtils {
57 public: 58 public:
58 static PassRefPtr<HTMLAnchorElement> create(Document&); 59 static PassRefPtr<HTMLAnchorElement> create(Document&);
59 static PassRefPtr<HTMLAnchorElement> create(const QualifiedName&, Document&) ; 60 static PassRefPtr<HTMLAnchorElement> create(const QualifiedName&, Document&) ;
60 61
61 virtual ~HTMLAnchorElement(); 62 virtual ~HTMLAnchorElement();
62 63
63 KURL href() const; 64 KURL href() const;
64 void setHref(const AtomicString&); 65 void setHref(const AtomicString&);
65 66
66 const AtomicString& name() const; 67 const AtomicString& name() const;
67 68
68 String hash() const; 69 virtual KURL url() const;
69 void setHash(const String&); 70 virtual void setURL(const KURL&);
70 71
71 String host() const; 72 virtual String input() const;
72 void setHost(const String&); 73 virtual void setInput(const String&);
abarth-chromium 2013/10/10 04:17:34 OVERRIDE
arv (Not doing code reviews) 2013/10/10 13:03:13 Done.
73
74 String hostname() const;
75 void setHostname(const String&);
76
77 String pathname() const;
78 void setPathname(const String&);
79
80 String port() const;
81 void setPort(const String&);
82
83 String protocol() const;
84 void setProtocol(const String&);
85
86 String search() const;
87 void setSearch(const String&);
88
89 String origin() const;
90 74
91 String text(); 75 String text();
92 76
93 String toString() const;
94
95 bool isLiveLink() const; 77 bool isLiveLink() const;
96 78
97 virtual bool willRespondToMouseClickEvents() OVERRIDE; 79 virtual bool willRespondToMouseClickEvents() OVERRIDE;
98 80
99 bool hasRel(uint32_t relation) const; 81 bool hasRel(uint32_t relation) const;
100 void setRel(const String&); 82 void setRel(const String&);
101 83
102 LinkHash visitedLinkHash() const; 84 LinkHash visitedLinkHash() const;
103 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; } 85 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; }
104 86
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 152
171 inline HTMLAnchorElement* toHTMLAnchorElement(Node* node) 153 inline HTMLAnchorElement* toHTMLAnchorElement(Node* node)
172 { 154 {
173 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLAnchorElement(node)); 155 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLAnchorElement(node));
174 return static_cast<HTMLAnchorElement*>(node); 156 return static_cast<HTMLAnchorElement*>(node);
175 } 157 }
176 158
177 } // namespace WebCore 159 } // namespace WebCore
178 160
179 #endif // HTMLAnchorElement_h 161 #endif // HTMLAnchorElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698