mirror of
https://github.com/servo/servo.git
synced 2025-07-29 02:00:23 +01:00
Add support for caseless group name matching in HTML input elements
This commit is contained in:
parent
4823ec947e
commit
5c9a25d46b
6 changed files with 19 additions and 23 deletions
|
@ -90,3 +90,4 @@ euclid = "0.2"
|
|||
tendril = "0.1.1"
|
||||
rand = "0.3"
|
||||
serde = "0.6"
|
||||
caseless = "0.1.0"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use caseless::compatibility_caseless_match_str;
|
||||
use dom::activation::Activatable;
|
||||
use dom::attr::{Attr, AttrValue};
|
||||
use dom::bindings::cell::DOMRefCell;
|
||||
|
@ -388,9 +389,8 @@ fn in_same_group(other: &HTMLInputElement, owner: Option<&HTMLFormElement>,
|
|||
other.input_type.get() == InputType::InputRadio &&
|
||||
// TODO Both a and b are in the same home subtree.
|
||||
other_owner == owner &&
|
||||
// TODO should be a unicode compatibility caseless match
|
||||
match (other.get_radio_group_name(), group) {
|
||||
(Some(ref s1), Some(s2)) => s1 == s2 && s2 != &atom!(""),
|
||||
(Some(ref s1), Some(s2)) => compatibility_caseless_match_str(s1, s2) && s2 != &atom!(""),
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ extern crate util;
|
|||
extern crate angle;
|
||||
extern crate canvas;
|
||||
extern crate canvas_traits;
|
||||
extern crate caseless;
|
||||
extern crate core;
|
||||
extern crate cssparser;
|
||||
extern crate devtools_traits;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue