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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 1738133002: Add support for media attribute on link (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 6bc0897a56d9bcfb50e61291919ab2641b6485f9..875eea3a54024e0f4a9d65f4cb24f6ec3ac72b7f 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -212,9 +212,9 @@ bool HTMLLinkElement::shouldLoadLink()
return inDocument();
}
-bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL& url)
+bool HTMLLinkElement::loadLink(const String& type, const String& as, const String& media, const KURL& url)
{
- return m_linkLoader->loadLink(m_relAttribute, crossOriginAttributeValue(fastGetAttribute(HTMLNames::crossoriginAttr)), type, as, url, document(), NetworkHintsInterfaceImpl());
+ return m_linkLoader->loadLink(m_relAttribute, crossOriginAttributeValue(fastGetAttribute(HTMLNames::crossoriginAttr)), type, as, media, url, document(), NetworkHintsInterfaceImpl());
}
LinkResource* HTMLLinkElement::linkResourceToProcess()
@@ -702,6 +702,7 @@ void LinkStyle::process()
ASSERT(m_owner->shouldProcessStyle());
String type = m_owner->typeValue().lower();
String as = m_owner->asValue().lower();
+ String media = m_owner->media().lower();
LinkRequestBuilder builder(m_owner);
if (m_owner->relAttribute().getIconType() != InvalidIcon && builder.url().isValid() && !builder.url().isEmpty()) {
@@ -715,7 +716,7 @@ void LinkStyle::process()
document().frame()->loader().client()->dispatchDidChangeIcons(m_owner->relAttribute().getIconType());
}
- if (!m_owner->loadLink(type, as, builder.url()))
+ if (!m_owner->loadLink(type, as, media, builder.url()))
return;
if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() && styleSheetTypeIsSupported(type) && shouldLoadResource() && builder.url().isValid()) {

Powered by Google App Engine
This is Rietveld 408576698