[FIX]Inserting inline child into inline with block :before and inline :after is broken

RESOLVED FIXED

Status

()

RESOLVED FIXED
10 years ago
2 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

Trunk
x86
Mac OS X
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

10 years ago
Created attachment 372179 [details]
reftest

Going to attach a testcase and reference.  The key ingredients are:

1)  Need to be in ContentInserted, not ContentAppended.
2)  Need to have no previous or next content sibling with a frame.
3)  Need to have an inline child with a block :before, and an inline :after.
4)  Need to be inline.

In Gecko 1.9.0 this situation could not arise because we did not allow creation of a block :before for an inline parent.

In Gecko 1.9.1, we do allow that, but don't take the :before and :after content into account when deciding whether to do an {ib} split (probably a bug, but not worth worrying about at this point).  So the rendering sorta ends up correct, because the frame order is correct and the block takes up all the width so the inline after it moves to the next line.

On trunk, the fix for bug 480979 (in fact part 1 of that fix) fixed the issue with not creating an {ib} split.  So now we have no prev sibling, no next sibling, don't find the :after frame (because we're looking for it inside the first inline in the {ib} split), don't find the :before frame (for the same reason) and end up inserting with no prevSibling, so insert before the :before frame.

I ran into this while redoing some of the isAppend stuff in ContentInserted for bug 487449.
(Assignee)

Comment 1

10 years ago
Created attachment 372181 [details]
reference
(Assignee)

Comment 2

10 years ago
Note that the span child with display:none is needed to force the ContentInserted codepath.
(Assignee)

Updated

10 years ago
Blocks: 487449
(Assignee)

Updated

10 years ago
Blocks: 480979
(Assignee)

Comment 3

10 years ago
Actually, putting borders on the outermost inline makes the breakage in 1.9.1 pretty clear; I'll add that to the reftest.
(Assignee)

Comment 4

10 years ago
Created attachment 372400 [details] [diff] [review]
Fix
Attachment #372400 - Flags: superreview?(roc)
Attachment #372400 - Flags: review?(roc)
(Assignee)

Updated

10 years ago
Summary: Inserting inline child into inline with block :before and inline :after is broken → [FIX]Inserting inline child into inline with block :before and inline :after is broken
Attachment #372400 - Flags: superreview?(roc)
Attachment #372400 - Flags: superreview+
Attachment #372400 - Flags: review?(roc)
Attachment #372400 - Flags: review+
(Assignee)

Comment 5

10 years ago
Pushed http://hg.mozilla.org/mozilla-central/rev/0354cfc51320
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED

Updated

2 months ago
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.