aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlelement.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-18 11:25:00 -0600
committerbors-servo <metajack+bors@gmail.com>2015-03-18 11:25:00 -0600
commit99cf9dbfc107bacb84dfe5afa9539a0ede3beac2 (patch)
treecc36210329cb1a31709a03685c05c4aaa99407e3 /components/script/dom/htmlelement.rs
parent65d4b12bf20783ea784f1c61f4b33ec0fc975f4f (diff)
parent5f15eb5fbfb7a8649132cc8b3a07314389836714 (diff)
downloadservo-99cf9dbfc107bacb84dfe5afa9539a0ede3beac2.tar.gz
servo-99cf9dbfc107bacb84dfe5afa9539a0ede3beac2.zip
auto merge of #5256 : servo/servo/rustup_20150311, r=jdm
...v. Relies on: * https://github.com/servo/rust-geom/pull/72 * https://github.com/servo/rust-glx/pull/10 * https://github.com/servo/gleam/pull/15 * https://github.com/servo/rust-mozjs/pull/137 * https://github.com/servo/rust-core-text/pull/35 * https://github.com/servo/rust-io-surface/pull/28
Diffstat (limited to 'components/script/dom/htmlelement.rs')
-rw-r--r--components/script/dom/htmlelement.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index 98bcbd6d92e..973de33d34d 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -32,6 +32,7 @@ use util::str::DOMString;
use string_cache::Atom;
+use std::ascii::AsciiExt;
use std::borrow::ToOwned;
use std::default::Default;
@@ -161,7 +162,7 @@ impl<'a> HTMLElementCustomAttributeHelpers for JSRef<'a, HTMLElement> {
fn set_custom_attr(self, name: DOMString, value: DOMString) -> ErrorResult {
if name.as_slice().chars()
.skip_while(|&ch| ch != '\u{2d}')
- .nth(1).map_or(false, |ch| ch as u8 - b'a' < 26) {
+ .nth(1).map_or(false, |ch| ch >= 'a' && ch <= 'z') {
return Err(Syntax);
}
let element: JSRef<Element> = ElementCast::from_ref(self);
@@ -172,7 +173,10 @@ impl<'a> HTMLElementCustomAttributeHelpers for JSRef<'a, HTMLElement> {
let element: JSRef<Element> = ElementCast::from_ref(self);
element.get_attribute(ns!(""), &Atom::from_slice(to_snake_case(name).as_slice())).map(|attr| {
let attr = attr.root();
- attr.r().value().as_slice().to_owned()
+ // FIXME(https://github.com/rust-lang/rust/issues/23338)
+ let attr = attr.r();
+ let value = attr.value();
+ value.as_slice().to_owned()
})
}