mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Audit usages of unicode case-changing methods.
This commit is contained in:
parent
58fd2956b3
commit
23e5bfaf27
6 changed files with 30 additions and 28 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::activation::Activatable;
|
||||
use std::ascii::AsciiExt;
|
||||
use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
|
||||
use dom::bindings::codegen::Bindings::HTMLAreaElementBinding;
|
||||
use dom::bindings::codegen::Bindings::HTMLAreaElementBinding::HTMLAreaElementMethods;
|
||||
|
@ -240,13 +241,13 @@ impl HTMLAreaElement {
|
|||
pub fn get_shape_from_coords(&self) -> Option<Area> {
|
||||
let elem = self.upcast::<Element>();
|
||||
let shape = elem.get_string_attribute(&"shape".into());
|
||||
let shp: Shape = match shape.to_lowercase().as_ref() {
|
||||
"circle" => Shape::Circle,
|
||||
"circ" => Shape::Circle,
|
||||
"rectangle" => Shape::Rectangle,
|
||||
"rect" => Shape::Rectangle,
|
||||
"polygon" => Shape::Rectangle,
|
||||
"poly" => Shape::Polygon,
|
||||
let shp: Shape = match &shape {
|
||||
s if s.eq_ignore_ascii_case("circle") => Shape::Circle,
|
||||
s if s.eq_ignore_ascii_case("circ") => Shape::Circle,
|
||||
s if s.eq_ignore_ascii_case("rectangle") => Shape::Rectangle,
|
||||
s if s.eq_ignore_ascii_case("rect") => Shape::Rectangle,
|
||||
s if s.eq_ignore_ascii_case("polygon") => Shape::Rectangle,
|
||||
s if s.eq_ignore_ascii_case("poly") => Shape::Polygon,
|
||||
_ => return None,
|
||||
};
|
||||
if elem.has_attribute(&"coords".into()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue