mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Fully support <input type=color>
(#36992)
This change adds a shadow-tree widget for `<input type=color>` elements. It also involves some changes to the way layout interacts with the DOM, because currently all `input` and `textarea` elements are rendered as plain text and their descendants are ignored. This obviously doesn't work for `<input type={color, date, range, etc}>`.  <details><summary>HTML used for the screenshot above</summary> ```html <input type=color> ``` </details> Testing: I doubt that this affects WPT tests, because the appearance and behaviour of the widget is almost entirely unspecified. --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
f9382fcaa0
commit
b100a98e1d
14 changed files with 469 additions and 100 deletions
|
@ -609,6 +609,15 @@ impl WebViewDelegate for RunningAppState {
|
|||
let offset = self.inner().window.toolbar_height();
|
||||
self.add_dialog(webview, Dialog::new_select_element_dialog(prompt, offset));
|
||||
},
|
||||
FormControl::ColorPicker(color_picker) => {
|
||||
// FIXME: Reading the toolbar height is needed here to properly position the select dialog.
|
||||
// But if the toolbar height changes while the dialog is open then the position won't be updated
|
||||
let offset = self.inner().window.toolbar_height();
|
||||
self.add_dialog(
|
||||
webview,
|
||||
Dialog::new_color_picker_dialog(color_picker, offset),
|
||||
);
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue