Skip to content

Some reftests rely on how style sharing works. #15907

Open
@emilio

Description

See the comment at https://bugzilla.mozilla.org/show_bug.cgi?id=1346062#c2.

Mainly we have some logic to merge consecutive fragments that were broken by line breaking in components/layout/inline.rs, which reads like this:

            let need_to_merge = match (&mut result.specific, &candidate.specific) {
                (&mut SpecificFragmentInfo::ScannedText(ref mut result_info),
                 &SpecificFragmentInfo::ScannedText(ref candidate_info)) => {
                    result.margin.inline_end == Au(0) &&
                    candidate.margin.inline_start == Au(0) &&
                    result.border_padding.inline_end == Au(0) &&
                    candidate.border_padding.inline_start == Au(0) &&
                    result_info.selected() == candidate_info.selected() &&
                    arc_ptr_eq(&result_info.run, &candidate_info.run) &&
                        inline_contexts_are_equal(&result.inline_context,
                                                  &candidate.inline_context)
                }

where inline_contexts_are_equal compares the style of the fragment by pointer. This causes unexpected results that depend on style sharing, like fragments being merged depending on whether the style of two siblings was shared. I believe this is wrong, and the intention is to see if they're the same node itself that was broken?

See the failures at #15891 to see an example of such failures, and the irc conversation linked from the bug above.

@mbrubeck or @pcwalton, do you have any opinions on this? I believe the intention was to merge fragments from the same nodes only, right?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions