Chromium Code Reviews| 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 f6d32a7a5cff7fcb0e4ea9357b1ce220e256ad9a..e3babb089a2c16b38db1374be050feb7458c6932 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp |
| @@ -192,7 +192,8 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri |
| m_sizes->setValue(value); |
| } else if (name == mediaAttr) { |
| m_media = value.lower(); |
| - process(); |
| + if (m_link) |
| + m_link->mediaChanged(); |
|
Yoav Weiss
2016/03/14 15:23:51
Seems to me that we would want "process()" not to
rune
2016/04/07 07:56:07
Yes, mediaChanged() is necessary to trigger a styl
|
| } else if (name == disabledAttr) { |
| UseCounter::count(document(), UseCounter::HTMLLinkElementDisabled); |
| if (LinkStyle* link = linkStyle()) |
| @@ -687,6 +688,14 @@ void LinkStyle::setDisabledState(bool disabled) |
| } |
| } |
| +void LinkStyle::mediaChanged() |
| +{ |
| + if (m_sheet) { |
| + m_sheet->setMediaQueries(MediaQuerySet::create(m_owner->media())); |
| + document().modifiedStyleSheet(m_sheet.get()); |
| + } |
| +} |
| + |
| void LinkStyle::setCrossOriginStylesheetStatus(CSSStyleSheet* sheet) |
| { |
| if (m_fetchFollowingCORS && resource() && !resource()->errorOccurred()) { |