Closed Bug 487895 Opened 13 years ago Closed 13 years ago

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

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(3 files)

Attached file 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.
Attached file reference
Note that the span child with display:none is needed to force the ContentInserted codepath.
Blocks: 487449
Blocks: 480979
Actually, putting borders on the outermost inline makes the breakage in 1.9.1 pretty clear; I'll add that to the reftest.
Attached patch FixSplinter Review
Attachment #372400 - Flags: superreview?(roc)
Attachment #372400 - Flags: review?(roc)
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+
Pushed http://hg.mozilla.org/mozilla-central/rev/0354cfc51320
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
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.