mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #10319 - Mylainos:Issue-#10284, r=emilio
Issue #10284 Ignore alternate stylesheets <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10319) <!-- Reviewable:end -->
This commit is contained in:
commit
6171188f59
6 changed files with 5460 additions and 4 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue