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

Side by Side Diff: Source/core/html/HTMLLinkElement.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 comments 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 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google 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 15 matching lines...) Expand all
26 26
27 #include "core/css/CSSStyleSheet.h" 27 #include "core/css/CSSStyleSheet.h"
28 #include "core/dom/DOMSettableTokenList.h" 28 #include "core/dom/DOMSettableTokenList.h"
29 #include "core/dom/IconURL.h" 29 #include "core/dom/IconURL.h"
30 #include "core/fetch/ResourceOwner.h" 30 #include "core/fetch/ResourceOwner.h"
31 #include "core/fetch/StyleSheetResource.h" 31 #include "core/fetch/StyleSheetResource.h"
32 #include "core/fetch/StyleSheetResourceClient.h" 32 #include "core/fetch/StyleSheetResourceClient.h"
33 #include "core/html/HTMLElement.h" 33 #include "core/html/HTMLElement.h"
34 #include "core/html/LinkRelAttribute.h" 34 #include "core/html/LinkRelAttribute.h"
35 #include "core/html/LinkResource.h" 35 #include "core/html/LinkResource.h"
36 #include "core/html/RelList.h"
36 #include "core/loader/LinkLoader.h" 37 #include "core/loader/LinkLoader.h"
37 #include "core/loader/LinkLoaderClient.h" 38 #include "core/loader/LinkLoaderClient.h"
38 39
39 namespace WebCore { 40 namespace WebCore {
40 41
41 class DocumentFragment; 42 class DocumentFragment;
42 class HTMLLinkElement; 43 class HTMLLinkElement;
43 class KURL; 44 class KURL;
44 class LinkImport; 45 class LinkImport;
45 46
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 }; 115 };
115 116
116 117
117 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient { 118 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient {
118 public: 119 public:
119 static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool create dByParser); 120 static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool create dByParser);
120 virtual ~HTMLLinkElement(); 121 virtual ~HTMLLinkElement();
121 122
122 KURL href() const; 123 KURL href() const;
123 const AtomicString& rel() const; 124 const AtomicString& rel() const;
125 DOMTokenList& relList();
124 String media() const { return m_media; } 126 String media() const { return m_media; }
125 String typeValue() const { return m_type; } 127 String typeValue() const { return m_type; }
126 const LinkRelAttribute& relAttribute() const { return m_relAttribute; } 128 const LinkRelAttribute& relAttribute() const { return m_relAttribute; }
127 129
128 const AtomicString& type() const; 130 const AtomicString& type() const;
129 131
130 IconType iconType() const; 132 IconType iconType() const;
131 133
132 // the icon sizes as parsed from the HTML attribute 134 // the icon sizes as parsed from the HTML attribute
133 const Vector<IntSize>& iconSizes() const; 135 const Vector<IntSize>& iconSizes() const;
(...skipping 10 matching lines...) Expand all
144 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl edViaScript(); } 146 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl edViaScript(); }
145 void enableIfExitTransitionStyle(); 147 void enableIfExitTransitionStyle();
146 148
147 DOMSettableTokenList* sizes() const; 149 DOMSettableTokenList* sizes() const;
148 150
149 void dispatchPendingEvent(LinkEventSender*); 151 void dispatchPendingEvent(LinkEventSender*);
150 void scheduleEvent(); 152 void scheduleEvent();
151 void dispatchEventImmediately(); 153 void dispatchEventImmediately();
152 static void dispatchPendingLoadEvents(); 154 static void dispatchPendingLoadEvents();
153 155
156 void setRelList(PassOwnPtrWillBeRawPtr<RelList> relList) { m_relList = relLi st; }
Inactive 2014/07/23 13:26:44 We don't really need this getter. Especially not a
157
154 // From LinkLoaderClient 158 // From LinkLoaderClient
155 virtual bool shouldLoadLink() OVERRIDE; 159 virtual bool shouldLoadLink() OVERRIDE;
156 160
157 // For LinkStyle 161 // For LinkStyle
158 bool loadLink(const String& type, const KURL&); 162 bool loadLink(const String& type, const KURL&);
159 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); } 163 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); }
160 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); } 164 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); }
161 bool isCreatedByParser() const { return m_createdByParser; } 165 bool isCreatedByParser() const { return m_createdByParser; }
162 166
163 // Parse the icon size attribute into |iconSizes|, make this method public 167 // Parse the icon size attribute into |iconSizes|, make this method public
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 HTMLLinkElement(Document&, bool createdByParser); 204 HTMLLinkElement(Document&, bool createdByParser);
201 205
202 OwnPtrWillBeMember<LinkResource> m_link; 206 OwnPtrWillBeMember<LinkResource> m_link;
203 LinkLoader m_linkLoader; 207 LinkLoader m_linkLoader;
204 208
205 String m_type; 209 String m_type;
206 String m_media; 210 String m_media;
207 RefPtrWillBeMember<DOMSettableTokenList> m_sizes; 211 RefPtrWillBeMember<DOMSettableTokenList> m_sizes;
208 Vector<IntSize> m_iconSizes; 212 Vector<IntSize> m_iconSizes;
209 LinkRelAttribute m_relAttribute; 213 LinkRelAttribute m_relAttribute;
214 OwnPtrWillBeMember<RelList> m_relList;
210 215
211 bool m_createdByParser; 216 bool m_createdByParser;
212 bool m_isInShadowTree; 217 bool m_isInShadowTree;
213 }; 218 };
214 219
215 } //namespace 220 } //namespace
216 221
217 #endif 222 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698