aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/htmllinkelement.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs
index 00d382e48fc..e7af4f537be 100644
--- a/components/script/dom/htmllinkelement.rs
+++ b/components/script/dom/htmllinkelement.rs
@@ -89,8 +89,17 @@ fn get_attr(element: &Element, local_name: &Atom) -> Option<String> {
fn string_is_stylesheet(value: &Option<String>) -> bool {
match *value {
Some(ref value) => {
- value.split(HTML_SPACE_CHARACTERS)
- .any(|s| s.eq_ignore_ascii_case("stylesheet"))
+ let mut found_stylesheet = false;
+ for s in value.split(HTML_SPACE_CHARACTERS).into_iter() {
+ if s.eq_ignore_ascii_case("alternate") {
+ return false;
+ }
+
+ if s.eq_ignore_ascii_case("stylesheet") {
+ found_stylesheet = true;
+ }
+ }
+ found_stylesheet
},
None => false,
}