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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | Source/core/html/HTMLLinkElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLinkElement.cpp
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index a1f97128ea5e919d88c93d68ce91c952e66607f7..f83508b317f36ba089a772243e7bde95c5b5c1e1 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -43,6 +43,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/SubresourceIntegrity.h"
+#include "core/frame/UseCounter.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/LinkDefaultPresentation.h"
#include "core/html/LinkManifest.h"
@@ -183,6 +184,7 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri
m_media = value.lower();
process();
} else if (name == disabledAttr) {
+ UseCounter::count(document(), UseCounter::HTMLLinkElementDisabled);
if (LinkStyle* link = linkStyle())
link->setDisabledState(!value.isNull());
} else {
@@ -222,8 +224,10 @@ LinkResource* HTMLLinkElement::linkResourceToProcess()
m_link = LinkDefaultPresentation::create(this);
} else {
OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this);
- if (fastHasAttribute(disabledAttr))
+ if (fastHasAttribute(disabledAttr)) {
+ UseCounter::count(document(), UseCounter::HTMLLinkElementDisabled);
link->setDisabledState(true);
+ }
m_link = link.release();
}
}
« 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