auto merge of #2483 : zwarich/servo/remove-10683-workaround, r=jdm

This commit is contained in:
bors-servo 2014-05-24 06:28:24 -04:00
commit 10d9bad973
5 changed files with 12 additions and 37 deletions

View file

@ -267,9 +267,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> {
if "sandbox" == name {
let mut modes = AllowNothing as u8;
for word in value.split(' ') {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let word_lower = word.to_ascii_lower();
modes |= match word_lower.as_slice() {
modes |= match word.to_ascii_lower().as_slice() {
"allow-same-origin" => AllowSameOrigin,
"allow-forms" => AllowForms,
"allow-pointer-lock" => AllowPointerLock,

View file

@ -54,9 +54,7 @@ pub mod specified {
Length::parse_internal(input, /* negative_ok = */ false)
}
pub fn parse_dimension(value: CSSFloat, unit: &str) -> Option<Length> {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let unit_lower = unit.to_ascii_lower();
match unit_lower.as_slice() {
match unit.to_ascii_lower().as_slice() {
"px" => Some(Length::from_px(value)),
"in" => Some(Au_(Au((value * AU_PER_IN) as i32))),
"cm" => Some(Au_(Au((value * AU_PER_CM) as i32))),

View file

@ -83,9 +83,7 @@ pub fn parse_media_query_list(input: &[ComponentValue]) -> MediaQueryList {
loop {
let mq = match next {
Some(&Ident(ref value)) => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let value_lower = value.as_slice().to_ascii_lower();
match value_lower.as_slice() {
match value.as_slice().to_ascii_lower().as_slice() {
"screen" => Some(MediaQuery{ media_type: MediaType(Screen) }),
"print" => Some(MediaQuery{ media_type: MediaType(Print) }),
"all" => Some(MediaQuery{ media_type: All }),

View file

@ -237,9 +237,7 @@ pub mod longhands {
-> Option<specified::Length> {
match component_value {
&Ident(ref value) => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let value_lower = value.to_owned().to_ascii_lower();
match value_lower.as_slice() {
match value.to_owned().to_ascii_lower().as_slice() {
"thin" => Some(specified::Length::from_px(1.)),
"medium" => Some(specified::Length::from_px(3.)),
"thick" => Some(specified::Length::from_px(5.)),
@ -462,9 +460,7 @@ pub mod longhands {
-> Option<SpecifiedValue> {
match input {
&Ident(ref value) => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let value_lower = value.to_owned().to_ascii_lower();
match value_lower.as_slice() {
match value.to_owned().to_ascii_lower().as_slice() {
% for keyword in vertical_align_keywords:
"${keyword}" => Some(Specified_${to_rust_ident(keyword)}),
% endfor
@ -539,10 +535,7 @@ pub mod longhands {
pub fn parse(input: &[ComponentValue], _base_url: &Url) -> Option<SpecifiedValue> {
match one_component_value(input) {
Some(&Ident(ref keyword)) => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let keyword_lower = keyword.to_owned().to_ascii_lower();
match keyword_lower.as_slice() {
match keyword.to_owned().to_ascii_lower().as_slice() {
"normal" => return Some(normal),
"none" => return Some(none),
_ => ()
@ -735,9 +728,7 @@ pub mod longhands {
// TODO: avoid copying strings?
Some(&String(ref value)) => add!(FamilyName(value.to_owned()), break 'outer),
Some(&Ident(ref value)) => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let value_lower = value.to_owned().to_ascii_lower();
match value_lower.as_slice() {
match value.to_owned().to_ascii_lower().as_slice() {
// "serif" => add!(Serif, break 'outer),
// "sans-serif" => add!(SansSerif, break 'outer),
// "cursive" => add!(Cursive, break 'outer),
@ -787,9 +778,7 @@ pub mod longhands {
-> Option<SpecifiedValue> {
match input {
&Ident(ref value) => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let value_lower = value.to_owned().to_ascii_lower();
match value_lower.as_slice() {
match value.to_owned().to_ascii_lower().as_slice() {
"bold" => Some(SpecifiedWeight700),
"normal" => Some(SpecifiedWeight400),
"bolder" => Some(Bolder),

View file

@ -329,9 +329,7 @@ fn parse_one_simple_selector(iter: &mut Iter, namespaces: &NamespaceMap, inside_
match iter.next() {
Some(Ident(name)) => match parse_simple_pseudo_class(name.as_slice()) {
None => {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let name_lower = name.as_slice().to_ascii_lower();
match name_lower.as_slice() {
match name.as_slice().to_ascii_lower().as_slice() {
// Supported CSS 2.1 pseudo-elements only.
// ** Do not add to this list! **
"before" => PseudoElementResult(Before),
@ -475,9 +473,7 @@ fn parse_attribute_selector(content: Vec<ComponentValue>, namespaces: &Namespace
fn parse_simple_pseudo_class(name: &str) -> Option<SimpleSelector> {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let name_lower = name.to_ascii_lower();
match name_lower.as_slice() {
match name.to_ascii_lower().as_slice() {
"any-link" => Some(AnyLink),
"link" => Some(Link),
"visited" => Some(Visited),
@ -498,9 +494,7 @@ fn parse_simple_pseudo_class(name: &str) -> Option<SimpleSelector> {
fn parse_functional_pseudo_class(name: StrBuf, arguments: Vec<ComponentValue>,
namespaces: &NamespaceMap, inside_negation: bool)
-> Option<SimpleSelector> {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let name_lower = name.as_slice().to_ascii_lower();
match name_lower.as_slice() {
match name.as_slice().to_ascii_lower().as_slice() {
// "lang" => parse_lang(arguments),
"nth-child" => parse_nth(arguments.as_slice()).map(|(a, b)| NthChild(a, b)),
"nth-last-child" => parse_nth(arguments.as_slice()).map(|(a, b)| NthLastChild(a, b)),
@ -513,9 +507,7 @@ fn parse_functional_pseudo_class(name: StrBuf, arguments: Vec<ComponentValue>,
fn parse_pseudo_element(name: StrBuf) -> Option<PseudoElement> {
// FIXME: Workaround for https://github.com/mozilla/rust/issues/10683
let name_lower = name.as_slice().to_ascii_lower();
match name_lower.as_slice() {
match name.as_slice().to_ascii_lower().as_slice() {
// All supported pseudo-elements
"before" => Some(Before),
"after" => Some(After),