mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rewrite <input type=number> to avoid an anonymous input.
Instead, subclass nsTextControlFrame. This simplifies the code and avoids correctness issues. I kept the localization functionality though it is not spec compliant. But I filed a bug to remove it in a followup. Differential Revision: https://phabricator.services.mozilla.com/D57193
This commit is contained in:
parent
c569d314a5
commit
9026720f04
1 changed files with 1 additions and 16 deletions
|
@ -1869,22 +1869,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
|||
#[inline]
|
||||
fn pseudo_element_originating_element(&self) -> Option<Self> {
|
||||
debug_assert!(self.is_pseudo_element());
|
||||
let parent = self.closest_anon_subtree_root_parent()?;
|
||||
|
||||
// FIXME(emilio): Special-case for <input type="number">s
|
||||
// pseudo-elements, which are nested NAC. Probably nsNumberControlFrame
|
||||
// should instead inherit from nsTextControlFrame, and then this could
|
||||
// go away.
|
||||
if let Some(PseudoElement::MozNumberText) = parent.implemented_pseudo_element() {
|
||||
debug_assert_eq!(
|
||||
self.implemented_pseudo_element().unwrap(),
|
||||
PseudoElement::Placeholder,
|
||||
"You added a new pseudo, do you really want this?"
|
||||
);
|
||||
return parent.closest_anon_subtree_root_parent();
|
||||
}
|
||||
|
||||
Some(parent)
|
||||
self.closest_anon_subtree_root_parent()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue