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

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

Issue 1159203004: Add use counters to determine the fate of the disabled attribute (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 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
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | Source/core/html/HTMLLinkElement.idl » ('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 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 25 matching lines...) Expand all
36 #include "core/dom/Document.h" 36 #include "core/dom/Document.h"
37 #include "core/dom/StyleEngine.h" 37 #include "core/dom/StyleEngine.h"
38 #include "core/events/Event.h" 38 #include "core/events/Event.h"
39 #include "core/events/EventSender.h" 39 #include "core/events/EventSender.h"
40 #include "core/fetch/CSSStyleSheetResource.h" 40 #include "core/fetch/CSSStyleSheetResource.h"
41 #include "core/fetch/FetchRequest.h" 41 #include "core/fetch/FetchRequest.h"
42 #include "core/fetch/ResourceFetcher.h" 42 #include "core/fetch/ResourceFetcher.h"
43 #include "core/frame/FrameView.h" 43 #include "core/frame/FrameView.h"
44 #include "core/frame/LocalFrame.h" 44 #include "core/frame/LocalFrame.h"
45 #include "core/frame/SubresourceIntegrity.h" 45 #include "core/frame/SubresourceIntegrity.h"
46 #include "core/frame/UseCounter.h"
46 #include "core/frame/csp/ContentSecurityPolicy.h" 47 #include "core/frame/csp/ContentSecurityPolicy.h"
47 #include "core/html/LinkDefaultPresentation.h" 48 #include "core/html/LinkDefaultPresentation.h"
48 #include "core/html/LinkManifest.h" 49 #include "core/html/LinkManifest.h"
49 #include "core/html/imports/LinkImport.h" 50 #include "core/html/imports/LinkImport.h"
50 #include "core/inspector/ConsoleMessage.h" 51 #include "core/inspector/ConsoleMessage.h"
51 #include "core/style/StyleInheritedData.h" 52 #include "core/style/StyleInheritedData.h"
52 #include "core/loader/FrameLoader.h" 53 #include "core/loader/FrameLoader.h"
53 #include "core/loader/FrameLoaderClient.h" 54 #include "core/loader/FrameLoaderClient.h"
54 #include "platform/RuntimeEnabledFeatures.h" 55 #include "platform/RuntimeEnabledFeatures.h"
55 #include "wtf/StdLibExtras.h" 56 #include "wtf/StdLibExtras.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 m_as = value; 177 m_as = value;
177 process(); 178 process();
178 } else if (name == sizesAttr) { 179 } else if (name == sizesAttr) {
179 m_sizes->setValue(value); 180 m_sizes->setValue(value);
180 parseSizesAttribute(value, m_iconSizes); 181 parseSizesAttribute(value, m_iconSizes);
181 process(); 182 process();
182 } else if (name == mediaAttr) { 183 } else if (name == mediaAttr) {
183 m_media = value.lower(); 184 m_media = value.lower();
184 process(); 185 process();
185 } else if (name == disabledAttr) { 186 } else if (name == disabledAttr) {
187 UseCounter::count(document(), UseCounter::HTMLLinkElementDisabled);
186 if (LinkStyle* link = linkStyle()) 188 if (LinkStyle* link = linkStyle())
187 link->setDisabledState(!value.isNull()); 189 link->setDisabledState(!value.isNull());
188 } else { 190 } else {
189 if (name == titleAttr) { 191 if (name == titleAttr) {
190 if (LinkStyle* link = linkStyle()) 192 if (LinkStyle* link = linkStyle())
191 link->setSheetTitle(value); 193 link->setSheetTitle(value);
192 } 194 }
193 195
194 HTMLElement::parseAttribute(name, value); 196 HTMLElement::parseAttribute(name, value);
195 } 197 }
(...skipping 19 matching lines...) Expand all
215 217
216 if (!m_link) { 218 if (!m_link) {
217 if (m_relAttribute.isImport()) { 219 if (m_relAttribute.isImport()) {
218 m_link = LinkImport::create(this); 220 m_link = LinkImport::create(this);
219 } else if (m_relAttribute.isManifest()) { 221 } else if (m_relAttribute.isManifest()) {
220 m_link = LinkManifest::create(this); 222 m_link = LinkManifest::create(this);
221 } else if (m_relAttribute.isDefaultPresentation()) { 223 } else if (m_relAttribute.isDefaultPresentation()) {
222 m_link = LinkDefaultPresentation::create(this); 224 m_link = LinkDefaultPresentation::create(this);
223 } else { 225 } else {
224 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this); 226 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this);
225 if (fastHasAttribute(disabledAttr)) 227 if (fastHasAttribute(disabledAttr)) {
228 UseCounter::count(document(), UseCounter::HTMLLinkElementDisable d);
226 link->setDisabledState(true); 229 link->setDisabledState(true);
230 }
227 m_link = link.release(); 231 m_link = link.release();
228 } 232 }
229 } 233 }
230 234
231 return m_link.get(); 235 return m_link.get();
232 } 236 }
233 237
234 LinkStyle* HTMLLinkElement::linkStyle() const 238 LinkStyle* HTMLLinkElement::linkStyle() const
235 { 239 {
236 if (!m_link || m_link->type() != LinkResource::Style) 240 if (!m_link || m_link->type() != LinkResource::Style)
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 removePendingSheet(); 770 removePendingSheet();
767 } 771 }
768 772
769 DEFINE_TRACE(LinkStyle) 773 DEFINE_TRACE(LinkStyle)
770 { 774 {
771 visitor->trace(m_sheet); 775 visitor->trace(m_sheet);
772 LinkResource::trace(visitor); 776 LinkResource::trace(visitor);
773 } 777 }
774 778
775 } // namespace blink 779 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | Source/core/html/HTMLLinkElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698