mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Remove NS_AUTHOR_SPECIFIED_PADDING
There's only one meaningful usage of it, which is to disable native appearance of the <input type=range> (the windows native theme is no longer exposed to content). <input type=range> is inconsistent with every other native widget, which only disables native appearance if the author specifies backgrounds or borders. So make it match literally all other widgets and simplify a bit the code. We had no tests for this special behavior, let me know if you think it's worth adding one (but I don't feel very strongly about it). Differential Revision: https://phabricator.services.mozilla.com/D127082
This commit is contained in:
parent
3d54b27a50
commit
3c0a1f2cb2
3 changed files with 1 additions and 26 deletions
|
@ -794,12 +794,6 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
{
|
{
|
||||||
builder.add_flags(ComputedValueFlags::HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND);
|
builder.add_flags(ComputedValueFlags::HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND);
|
||||||
}
|
}
|
||||||
if self
|
|
||||||
.author_specified
|
|
||||||
.contains_any(LonghandIdSet::padding_properties())
|
|
||||||
{
|
|
||||||
builder.add_flags(ComputedValueFlags::HAS_AUTHOR_SPECIFIED_PADDING);
|
|
||||||
}
|
|
||||||
|
|
||||||
if self
|
if self
|
||||||
.author_specified
|
.author_specified
|
||||||
|
@ -863,8 +857,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
//
|
//
|
||||||
// Note that all the properties involved are non-inherited, so we don't
|
// Note that all the properties involved are non-inherited, so we don't
|
||||||
// need to do anything else other than just copying the bits over.
|
// need to do anything else other than just copying the bits over.
|
||||||
let reset_props_bits = ComputedValueFlags::HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND |
|
let reset_props_bits = ComputedValueFlags::HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND;
|
||||||
ComputedValueFlags::HAS_AUTHOR_SPECIFIED_PADDING;
|
|
||||||
builder.add_flags(cached_style.flags & reset_props_bits);
|
builder.add_flags(cached_style.flags & reset_props_bits);
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
|
@ -84,12 +84,6 @@ bitflags! {
|
||||||
/// https://github.com/w3c/csswg-drafts/issues/4777#issuecomment-604424845
|
/// https://github.com/w3c/csswg-drafts/issues/4777#issuecomment-604424845
|
||||||
const HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND = 1 << 14;
|
const HAS_AUTHOR_SPECIFIED_BORDER_BACKGROUND = 1 << 14;
|
||||||
|
|
||||||
/// Whether there are author-specified rules for padding-* properties.
|
|
||||||
///
|
|
||||||
/// FIXME(emilio): Try to merge this with BORDER_BACKGROUND, see
|
|
||||||
/// https://github.com/w3c/csswg-drafts/issues/4777
|
|
||||||
const HAS_AUTHOR_SPECIFIED_PADDING = 1 << 15;
|
|
||||||
|
|
||||||
/// Whether there are author-specified rules for `font-family`.
|
/// Whether there are author-specified rules for `font-family`.
|
||||||
const HAS_AUTHOR_SPECIFIED_FONT_FAMILY = 1 << 16;
|
const HAS_AUTHOR_SPECIFIED_FONT_FAMILY = 1 << 16;
|
||||||
|
|
||||||
|
|
|
@ -945,18 +945,6 @@ impl LonghandIdSet {
|
||||||
&HAS_NO_EFFECT_ON_SCROLLBARS
|
&HAS_NO_EFFECT_ON_SCROLLBARS
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the set of padding properties for the purpose of disabling
|
|
||||||
/// native appearance.
|
|
||||||
#[inline]
|
|
||||||
pub fn padding_properties() -> &'static Self {
|
|
||||||
<% assert "padding" in logical_groups %>
|
|
||||||
${static_longhand_id_set(
|
|
||||||
"PADDING_PROPERTIES",
|
|
||||||
lambda p: p.logical_group == "padding"
|
|
||||||
)}
|
|
||||||
&PADDING_PROPERTIES
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the set of border properties for the purpose of disabling native
|
/// Returns the set of border properties for the purpose of disabling native
|
||||||
/// appearance.
|
/// appearance.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue