aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/str.rs')
-rw-r--r--components/script/dom/bindings/str.rs57
1 files changed, 0 insertions, 57 deletions
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index 6cb17fae4e3..4e579044491 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -113,63 +113,6 @@ pub fn is_token(s: &[u8]) -> bool {
})
}
-/// Returns whether the language is matched, as defined by
-/// [RFC 4647](https://tools.ietf.org/html/rfc4647#section-3.3.2).
-pub fn extended_filtering(tag: &str, range: &str) -> bool {
- let lang_ranges: Vec<&str> = range.split(',').collect();
-
- lang_ranges.iter().any(|&lang_range| {
- // step 1
- let range_subtags: Vec<&str> = lang_range.split('\x2d').collect();
- let tag_subtags: Vec<&str> = tag.split('\x2d').collect();
-
- let mut range_iter = range_subtags.iter();
- let mut tag_iter = tag_subtags.iter();
-
- // step 2
- // Note: [Level-4 spec](https://drafts.csswg.org/selectors/#lang-pseudo) check for wild card
- if let (Some(range_subtag), Some(tag_subtag)) = (range_iter.next(), tag_iter.next()) {
- if !(range_subtag.eq_ignore_ascii_case(tag_subtag) || range_subtag.eq_ignore_ascii_case("*")) {
- return false;
- }
- }
-
- let mut current_tag_subtag = tag_iter.next();
-
- // step 3
- for range_subtag in range_iter {
- // step 3a
- if range_subtag.eq_ignore_ascii_case("*") {
- continue;
- }
- match current_tag_subtag.clone() {
- Some(tag_subtag) => {
- // step 3c
- if range_subtag.eq_ignore_ascii_case(tag_subtag) {
- current_tag_subtag = tag_iter.next();
- continue;
- } else {
- // step 3d
- if tag_subtag.len() == 1 {
- return false;
- } else {
- // else step 3e - continue with loop
- current_tag_subtag = tag_iter.next();
- if current_tag_subtag.is_none() {
- return false;
- }
- }
- }
- },
- // step 3b
- None => { return false; }
- }
- }
- // step 4
- true
- })
-}
-
/// A DOMString.
///