stylo: Backdrop pseudo should not inherit.

RESOLVED FIXED

Status

()

RESOLVED FIXED
2 years ago
2 months ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Right now ServoStyleSet ignores the aParentStyleContext argument arriving to ResolvePseudoElementStyle, assuming the pseudo should inherit from the element.

This is completely wrong for ::backdrop, which should not inherit from anything.

I'm adding restyling for ::backdrop in bug 1364871. I plan to fix the behavior of ::backdrop here.
(Assignee)

Updated

2 years ago
Blocks: 1243581
Comment hidden (mozreview-request)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8869693 [details]
Bug 1366427: Make backdrop not inherit from the parent element.

https://reviewboard.mozilla.org/r/141268/#review144900

::: servo/ports/geckolib/glue.rs:1185
(Diff revision 1)
> -            let base = styles.primary.values();
> +            let base = if pseudo.inherits_from_parent() {
> +                styles.primary.values()
> +            } else {
> +                d.default_computed_values()
> +            };

Since the usual behaviour is to inherit from the parent, I think it might make sense to invert the function here, and have it be "inherits_from_default_styles" or something.  Reading this code here, otherwise, it's not obvious why if inherits_from_parent() is false, that we should use the default computed values.

Alternatively you could use an enum, but I think inheriting from the parent seems obvious enough to not need to be explicitly written.
Attachment #8869693 - Flags: review?(cam) → review+
(Assignee)

Comment 3

2 years ago
mozreview-review-reply
Comment on attachment 8869693 [details]
Bug 1366427: Make backdrop not inherit from the parent element.

https://reviewboard.mozilla.org/r/141268/#review144900

> Since the usual behaviour is to inherit from the parent, I think it might make sense to invert the function here, and have it be "inherits_from_default_styles" or something.  Reading this code here, otherwise, it's not obvious why if inherits_from_parent() is false, that we should use the default computed values.
> 
> Alternatively you could use an enum, but I think inheriting from the parent seems obvious enough to not need to be explicitly written.

Sounds good, will do :)
Emilio, did this land?
Flags: needinfo?(emilio+bugs)
(Assignee)

Comment 5

2 years ago
Yes, https://hg.mozilla.org/mozilla-central/rev/73f9c356e367
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(emilio+bugs)
Resolution: --- → FIXED
Assignee: nobody → emilio
You need to log in before you can comment on or make changes to this bug.