aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/cssstyledeclaration.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-02-20 07:09:54 -0700
committerbors-servo <metajack+bors@gmail.com>2015-02-20 07:09:54 -0700
commit276f74b1ddec9dfa4cb053eb0802f95bd5ed6b66 (patch)
tree4c8fa052611da7fa05f107fb206d79aa17be1ecb /components/script/dom/cssstyledeclaration.rs
parent45a0e0e65c0d104c3e29f6521b11b4285cde58d2 (diff)
parent6d30ec77c89d157819a7c8e99d34b6aabf5bc5c6 (diff)
downloadservo-276f74b1ddec9dfa4cb053eb0802f95bd5ed6b66.tar.gz
servo-276f74b1ddec9dfa4cb053eb0802f95bd5ed6b66.zip
auto merge of #4979 : Ms2ger/servo/audit-ints, r=Manishearth
Diffstat (limited to 'components/script/dom/cssstyledeclaration.rs')
-rw-r--r--components/script/dom/cssstyledeclaration.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs
index 2de0942f968..2337e6c061a 100644
--- a/components/script/dom/cssstyledeclaration.rs
+++ b/components/script/dom/cssstyledeclaration.rs
@@ -109,17 +109,18 @@ impl<'a> CSSStyleDeclarationMethods for JSRef<'a, CSSStyleDeclaration> {
}
fn Item(self, index: u32) -> DOMString {
+ let index = index as usize;
let owner = self.owner.root();
let elem: JSRef<Element> = ElementCast::from_ref(owner.r());
let style_attribute = elem.style_attribute().borrow();
let result = style_attribute.as_ref().and_then(|declarations| {
- if index as uint > declarations.normal.len() {
+ if index > declarations.normal.len() {
declarations.important
- .get(index as uint - declarations.normal.len())
+ .get(index - declarations.normal.len())
.map(|decl| format!("{:?} !important", decl))
} else {
declarations.normal
- .get(index as uint)
+ .get(index)
.map(|decl| format!("{:?}", decl))
}
});