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

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

Issue 196743002: Parse the link element's size attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix the space Created 6 years, 9 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
« no previous file with comments | « Source/core/dom/IconURL.cpp ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 KURL href() const; 126 KURL href() const;
127 const AtomicString& rel() const; 127 const AtomicString& rel() const;
128 String media() const { return m_media; } 128 String media() const { return m_media; }
129 String typeValue() const { return m_type; } 129 String typeValue() const { return m_type; }
130 const LinkRelAttribute& relAttribute() const { return m_relAttribute; } 130 const LinkRelAttribute& relAttribute() const { return m_relAttribute; }
131 131
132 const AtomicString& type() const; 132 const AtomicString& type() const;
133 133
134 IconType iconType() const; 134 IconType iconType() const;
135 135
136 // the icon size string as parsed from the HTML attribute 136 // the icon sizes as parsed from the HTML attribute
137 const AtomicString& iconSizes() const; 137 const Vector<IntSize>& iconSizes() const;
138 138
139 bool async() const; 139 bool async() const;
140 140
141 CSSStyleSheet* sheet() const { return linkStyle() ? linkStyle()->sheet() : 0 ; } 141 CSSStyleSheet* sheet() const { return linkStyle() ? linkStyle()->sheet() : 0 ; }
142 Document* import() const; 142 Document* import() const;
143 143
144 bool styleSheetIsLoading() const; 144 bool styleSheetIsLoading() const;
145 145
146 bool isImport() const { return linkImport(); } 146 bool isImport() const { return linkImport(); }
147 bool importOwnsLoader() const; 147 bool importOwnsLoader() const;
148 bool isDisabled() const { return linkStyle() && linkStyle()->isDisabled(); } 148 bool isDisabled() const { return linkStyle() && linkStyle()->isDisabled(); }
149 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl edViaScript(); } 149 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl edViaScript(); }
150 DOMSettableTokenList* sizes() const; 150 DOMSettableTokenList* sizes() const;
151 151
152 void dispatchPendingEvent(LinkEventSender*); 152 void dispatchPendingEvent(LinkEventSender*);
153 void scheduleEvent(); 153 void scheduleEvent();
154 void dispatchEventImmediately(); 154 void dispatchEventImmediately();
155 static void dispatchPendingLoadEvents(); 155 static void dispatchPendingLoadEvents();
156 156
157 // From LinkLoaderClient 157 // From LinkLoaderClient
158 virtual bool shouldLoadLink() OVERRIDE; 158 virtual bool shouldLoadLink() OVERRIDE;
159 159
160 // For LinkStyle 160 // For LinkStyle
161 bool loadLink(const String& type, const KURL&); 161 bool loadLink(const String& type, const KURL&);
162 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); } 162 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); }
163 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); } 163 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); }
164 bool isCreatedByParser() const { return m_createdByParser; } 164 bool isCreatedByParser() const { return m_createdByParser; }
165 165
166 // Parse the icon size attribute into |iconSizes|, make this method public
167 // visible for testing purpose.
168 static void parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes);
169
166 private: 170 private:
167 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 171 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
168 172
169 LinkStyle* linkStyle() const; 173 LinkStyle* linkStyle() const;
170 LinkImport* linkImport() const; 174 LinkImport* linkImport() const;
171 LinkResource* linkResourceToProcess(); 175 LinkResource* linkResourceToProcess();
172 176
173 void process(); 177 void process();
174 static void processCallback(Node*); 178 static void processCallback(Node*);
175 179
(...skipping 16 matching lines...) Expand all
192 196
193 private: 197 private:
194 HTMLLinkElement(Document&, bool createdByParser); 198 HTMLLinkElement(Document&, bool createdByParser);
195 199
196 OwnPtr<LinkResource> m_link; 200 OwnPtr<LinkResource> m_link;
197 LinkLoader m_linkLoader; 201 LinkLoader m_linkLoader;
198 202
199 String m_type; 203 String m_type;
200 String m_media; 204 String m_media;
201 RefPtr<DOMSettableTokenList> m_sizes; 205 RefPtr<DOMSettableTokenList> m_sizes;
206 Vector<IntSize> m_iconSizes;
202 LinkRelAttribute m_relAttribute; 207 LinkRelAttribute m_relAttribute;
203 208
204 bool m_createdByParser; 209 bool m_createdByParser;
205 bool m_isInShadowTree; 210 bool m_isInShadowTree;
206 int m_beforeLoadRecurseCount; 211 int m_beforeLoadRecurseCount;
207 }; 212 };
208 213
209 } //namespace 214 } //namespace
210 215
211 #endif 216 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/IconURL.cpp ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698