mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Disallow toggling radio buttons. Use generated content for checkboxes and radio buttons. Switching to the glyph 0 for the average advance width.
This commit is contained in:
parent
f70bb68503
commit
8112859d55
7 changed files with 15 additions and 36 deletions
|
@ -226,10 +226,10 @@ 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(node.get_input_checked()),
|
||||
Some("checkbox") => InputCheckbox,
|
||||
Some("button") | Some("submit") | Some("reset") =>
|
||||
InputButton(node.get_input_value().len() as u32),
|
||||
Some("radio") => InputRadioButton(node.get_input_checked()),
|
||||
Some("radio") => InputRadioButton,
|
||||
Some("file") => InputFile(node.get_input_size()),
|
||||
_ => InputText(node.get_input_size()),
|
||||
};
|
||||
|
|
|
@ -161,8 +161,8 @@ impl InlineBlockFragmentInfo {
|
|||
pub enum InputFragmentInfo {
|
||||
InputButton(u32),
|
||||
InputText(u32),
|
||||
InputCheckbox(bool),
|
||||
InputRadioButton(bool),
|
||||
InputCheckbox,
|
||||
InputRadioButton,
|
||||
InputFile(u32),
|
||||
}
|
||||
|
||||
|
|
|
@ -731,16 +731,6 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_input_checked(&self) -> bool {
|
||||
unsafe {
|
||||
if !self.get().is_htmlinputelement() {
|
||||
fail!("not an input element!")
|
||||
}
|
||||
let input: JS<HTMLInputElement> = self.get_jsmanaged().transmute_copy();
|
||||
input.get_checked_for_layout()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_input_value(&self) -> String {
|
||||
unsafe {
|
||||
if !self.get().is_htmlinputelement() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue