Revert "Backport several style changes from Gecko (5) (#30099)" (#30104)

This reverts commit 8e15389cae.
This commit is contained in:
Oriol Brufau 2023-08-16 08:24:42 +02:00 committed by GitHub
parent 8e15389cae
commit d6ae8dc112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
152 changed files with 4622 additions and 5862 deletions

View file

@ -275,11 +275,11 @@ fn fixup_stops(
for item in items {
match item {
GradientItem::SimpleColorStop(color) => stops.push(ColorStop {
color: super::rgba(style.resolve_color(color.clone())),
color: super::rgba(style.resolve_color(*color)),
position: None,
}),
GradientItem::ComplexColorStop { color, position } => stops.push(ColorStop {
color: super::rgba(style.resolve_color(color.clone())),
color: super::rgba(style.resolve_color(*color)),
position: Some(if gradient_line_length.px() == 0. {
0.
} else {

View file

@ -352,7 +352,7 @@ impl Fragment {
let text_decoration_color = fragment
.parent_style
.clone_text_decoration_color()
.into_rgba(color);
.to_rgba(color);
let text_decoration_style = fragment.parent_style.clone_text_decoration_style();
if text_decoration_style == ComputedTextDecorationStyle::MozNone {
return;
@ -535,7 +535,7 @@ impl<'a> BuilderForBoxFragment<'a> {
let source = background::Source::Fragment;
let style = &self.fragment.style;
let b = style.get_background();
let background_color = style.resolve_color(b.background_color.clone());
let background_color = style.resolve_color(b.background_color);
if background_color.alpha > 0 {
// https://drafts.csswg.org/css-backgrounds/#background-color
// “The background color is clipped according to the background-clip
@ -685,15 +685,10 @@ impl<'a> BuilderForBoxFragment<'a> {
}
let common = builder.common_properties(self.border_rect, &self.fragment.style);
let details = wr::BorderDetails::Normal(wr::NormalBorder {
top: self.build_border_side(border.border_top_style, border.border_top_color.clone()),
right: self
.build_border_side(border.border_right_style, border.border_right_color.clone()),
bottom: self.build_border_side(
border.border_bottom_style,
border.border_bottom_color.clone(),
),
left: self
.build_border_side(border.border_left_style, border.border_left_color.clone()),
top: self.build_border_side(border.border_top_style, border.border_top_color),
right: self.build_border_side(border.border_right_style, border.border_right_color),
bottom: self.build_border_side(border.border_bottom_style, border.border_bottom_color),
left: self.build_border_side(border.border_left_style, border.border_left_color),
radius: self.border_radius,
do_aa: true,
});
@ -723,7 +718,7 @@ impl<'a> BuilderForBoxFragment<'a> {
OutlineStyle::Auto => BorderStyle::Solid,
OutlineStyle::BorderStyle(s) => s,
};
let side = self.build_border_side(style, outline.outline_color.clone());
let side = self.build_border_side(style, outline.outline_color);
let details = wr::BorderDetails::Normal(wr::NormalBorder {
top: side,
right: side,

View file

@ -404,7 +404,7 @@ impl StackingContext {
.union(&fragment_tree.scrollable_overflow)
.to_webrender();
let background_color = style.resolve_color(style.get_background().background_color.clone());
let background_color = style.resolve_color(style.get_background().background_color);
if background_color.alpha > 0 {
let common = builder.common_properties(painting_area, &style);
let color = super::rgba(background_color);

View file

@ -361,13 +361,7 @@ pub fn process_resolved_style_request_for_unstyled_node<'dom>(
};
let element = node.as_element().unwrap();
let styles = resolve_style(
&mut context,
element,
RuleInclusion::All,
pseudo.as_ref(),
None,
);
let styles = resolve_style(&mut context, element, RuleInclusion::All, pseudo.as_ref());
let style = styles.primary();
let longhand_id = match *property {
PropertyId::LonghandAlias(id, _) | PropertyId::Longhand(id) => id,

View file

@ -465,7 +465,7 @@ impl ComputedValuesExt for ComputedValues {
/// Whether or not this style specifies a non-transparent background.
fn background_is_transparent(&self) -> bool {
let background = self.get_background();
let color = self.resolve_color(background.background_color.clone());
let color = self.resolve_color(background.background_color);
color.alpha == 0 &&
background
.background_image