Closed Bug 1544874 Opened 5 years ago Closed 5 years ago

::marker with non-normal content not displayed if ::before or ::after is a list item

Categories

(Core :: Layout, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: Oriol, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: testcase)

Attachments

(3 files)

Attached file marker-content.htm
.before > li::before {
  content: 'before';
  display: list-item;
  list-style-position: inside;
}
.content > li::marker {
  content: '1)';
}
<ol class="content"><li></li></ol>
<ol class="before"><li></li></ol>
<ol class="before content"><li></li></ol>

When ::marker wasn't implemented, this was displayed as

1.
1. 2. before
1. 2. before

Now it's displayed as

1)
1. 2. before
   2. before

In the 3rd case, the marker of the element is not displayed! It should be

1)
1. 2. before
1) 2. before

This seems to happen when the ::marker has a non-normal content, and the element has a ::before or ::after pseudo-element which is a list item.

The content is there, it's just mispositioned. Mats, thoughts?

Flags: needinfo?(mats)
Attached file Testcase #2

The bug occurs when we have a block child in the list item.

In that case, we position the marker box here:
https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/layout/generic/nsBlockFrame.cpp#1287
with reflowOutput.BlockStartAscent() == 1073741823 (ASK_FOR_BASELINE)
because we never assigned it.
In the legacy code path we explicitly set it here:
https://searchfox.org/mozilla-central/rev/1b2636e8517aa48422ed516affe4d28cb7fa220a/layout/generic/nsBulletFrame.cpp#966
(so it's 15px once we get there, and so is position.mBaseline, so we set BStart = 0 there)

Flags: needinfo?(mats)
Assignee: nobody → mats
Keywords: testcase
OS: Unspecified → All
Hardware: Unspecified → All
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d37377e818b4
Add missing baseline alignment for non-legacy ::marker boxes when aligning to a "block line".  r=emilio
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16499 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: