Closed Bug 2010247 Opened 1 month ago Closed 1 month ago

`margin: inherit` doesn't respect position-try flipped values

Categories

(Core :: Layout: Positioned, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2010367
Tracking Status
firefox149 --- affected

People

(Reporter: jakea, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached video Demo

Ignore the viewport overflowing, I've filed that in https://bugzilla.mozilla.org/show_bug.cgi?id=2010246

https://codepen.io/t_afif/pen/QwyMrvG

This demo uses margin: inherit to inherit margin values that are flipped by position-try, however Firefox does not inherit the flipped values.

The severity field is not set for this bug.
:jwatt, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mozmail)

I suspect this might be related to the fact that we don't interleave restyling in the same way that other browsers do... Maybe emilio can confirm whether this inheritance outcome is expected (based on our current setup) or not?

For reference, this seems to be the code that handles flip-block -- I'm not clear on whether the comment's mention of a possible-future-migration-to to_computed_value might be related to this or not. (Seems conceivable that it might be related, since the computed value is the thing that inherits. I don't have a good mental model for where style_adjuster fits in, but I could imagine it making its adjustments as an after-effect, without impacting the value that inherits...)

https://searchfox.org/firefox-main/rev/c206271d981e72dac0fdd91625b2c0709129a7d6/servo/components/style/style_adjuster.rs#877-884,892-895

/// Performs adjustments for position-try-fallbacks. The properties that need adjustments here
/// are luckily not affected by previous adjustments nor by other computed-value-time effects,
/// so we can just perform them here.
///
/// NOTE(emilio): If we ever perform the interleaving dance, this could / should probably move
/// around to the specific properties' to_computed_value implementations, but that seems
/// overkill for now.
fn adjust_for_try_tactic(&mut self, tactic: &PositionTryFallbacksTryTactic) {
...
            FlipBlock => {
                self.flip_self_alignment(/* block = */ true);
                self.flip_insets_and_margins(/* horizontal = */ wm.is_vertical());
            },

Tentatively triaging as S3.

Severity: -- → S3
Flags: needinfo?(mozmail) → needinfo?(emilio)

Yeah, same commentary as bug 2010367 comment 2

Thanks. I'll dupe this to that bug since that one's already in the anchor-positioning-triage-queue (and they're about the same codepen).

Status: NEW → RESOLVED
Closed: 1 month ago
Duplicate of bug: 2010367
Resolution: --- → DUPLICATE
Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: