Closed Bug 1571313 Opened 6 years ago Closed 6 years ago

Firefox adds extra ::before (containing padding and content) to a <dd> in <dl><div><dt></dt><dd></dd></div></dl>

Categories

(DevTools :: Inspector, defect)

68 Branch
Desktop
All
defect
Not set
normal

Tracking

(firefox68 affected, firefox69 affected, firefox70 affected)

RESOLVED DUPLICATE of bug 782551
Tracking Status
firefox68 --- affected
firefox69 --- affected
firefox70 --- affected

People

(Reporter: vardramat, Unassigned)

Details

Attachments

(2 files)

Attached image bugzilla.PNG

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Create simple code:
<html>
<head>
</head>
<body>
<div>
<dl>
<div></div>
<dt>title</dt>
<dd>description</dd>
</div>
</dl>
</div>
</body>
</html>

Actual results:

FireFox tries to match the default style of <dd> element (40px margin left) by adding an unwanted ::before tag that has some content (possibly a "space") and 40px margin right.
It can be css reset with dd::before{ margin:0; content:""; }

Expected results:

There should be no ::before element created as of https://html.spec.whatwg.org/multipage/grouping-content.html#the-dl-element

Summary: Firefox adds extra ::before (containing padding and content) to a <dd> in <dl><div></dt><dt><dd></dd></div></dl> → Firefox adds extra ::before (containing padding and content) to a <dd> in <dl><div><dt></dt><dd></dd></div></dl>

the code should be:

<html>
<head>
</head>
<body>
<div>
<dl>
<div>
<dt>title</dt>
<dd>description</dd>
</div>
</dl>
</div>
</body>
</html>

I have tested this using:
Windows10 64bit
Ubuntu 18.04 64bit
MacOS 10.13 64bit

I see the unwanted "::before" on all firefox versions and all Os

Load html attached
Control+Shift´+K
check Inspector

Release 68.0.1 Reproducible
Beta 69.0b11 Reproducible
Nightly 70.0a1 Reproducible

Attached file unwanted.html
Status: UNCONFIRMED → NEW
Component: Untriaged → Inspector
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → DevTools
Hardware: Unspecified → Desktop

The priority flag is not set for this bug.
:gl, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(gl)

Changing the needinfo over to rcaliman since he said he was gonna look into this.

Flags: needinfo?(gl) → needinfo?(rcaliman)

Good news, everyone! The bug has been fixed since last week.

It doesn't reproduce anymore with the latest Nightly.

Checking with mozregression indicated that the fix was in this range. Upon closer inspection, it seems the fix is from the patch for Bug 782551 targeting this issue specifically.

Here was the issue, a <dd> which didn't have a <dl> as a direct ancestor would get a ::before pseudo-element:

:not(dl) > dd:before {
  display: inline;
  white-space: pre;
  font-size: 1px;
  line-height: 0;
  content: "\A  ";
  margin-inline-end: 40px;
}
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(rcaliman)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: