aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-09-29 16:13:12 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-10-01 15:40:36 -0400
commit5794da904eb758ebb1f143b172dae515379fad43 (patch)
treea5847e29971bca917223843f34b9862c4f4ff9ff /components/layout/construct.rs
parentca5d4633c23f73187f76f546dd9fa04cd1769bde (diff)
downloadservo-5794da904eb758ebb1f143b172dae515379fad43.tar.gz
servo-5794da904eb758ebb1f143b172dae515379fad43.zip
Remove unneeded input type information from layout.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 2897f04fa43..818fa1602e6 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -31,8 +31,8 @@ use fragment::{InlineBlockFragment, InlineBlockFragmentInfo, InputFragment};
use fragment::{Fragment, GenericFragment, IframeFragment, IframeFragmentInfo};
use fragment::{ImageFragment, ImageFragmentInfo, SpecificFragmentInfo, TableFragment};
use fragment::{TableCellFragment, TableColumnFragment, TableColumnFragmentInfo};
-use fragment::{TableRowFragment, TableWrapperFragment, UnscannedTextFragment, InputRadioButton};
-use fragment::{UnscannedTextFragmentInfo, InputCheckbox, InputButton, InputText, InputFile};
+use fragment::{TableRowFragment, TableWrapperFragment, UnscannedTextFragment};
+use fragment::{UnscannedTextFragmentInfo, InputFragmentInfo};
use inline::{InlineFragments, InlineFlow};
use parallel;
use table_wrapper::TableWrapperFlow;
@@ -226,14 +226,14 @@ impl<'a> FlowConstructor<'a> {
// value? definitely for string comparisons.
let elem = node.as_element();
let data = match elem.get_attr(&ns!(""), "type") {
- Some("checkbox") => InputCheckbox,
+ Some("checkbox") | Some("radio") => None,
Some("button") | Some("submit") | Some("reset") =>
- InputButton(node.get_input_value().len() as u32),
- Some("radio") => InputRadioButton,
- Some("file") => InputFile(node.get_input_size()),
- _ => InputText(node.get_input_size()),
+ Some(node.get_input_value().len() as u32),
+ Some("file") => Some(node.get_input_size()),
+ _ => Some(node.get_input_size()),
};
- InputFragment(data)
+ data.map(|size| InputFragment(InputFragmentInfo { size: size }))
+ .unwrap_or(GenericFragment)
}
/// Builds specific `Fragment` info for the given node.