Open Bug 1540066 Opened 5 years ago Updated 9 months ago

Drag and drop before opening pseudo element (::marker/::before) fails if that is an element's only content.

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: Kwan, Unassigned)

References

(Blocks 1 open bug)

Details

Julian Descottes [:jdescottes] wrote in D25106 review for bug 1539265

This code will throw if you attempt to drop a node in a parent that only has a ::marker and or a ::before (and no other children at all)
Eg:

<div>
 <---- try to drop an element here
 ::marker
</div>

But the previous implementation was already breaking similarly when dropping inside of parents that only had one ::before.
Not blocking the review on it, I think we should another bug to address it.

Type: enhancement → defect

I tested on this page data:text/html,<ul><li><span>test</span></li></ul>
I grabbed the <span> and tried to drop it before the ::marker. It doesn't work, it goes back to where it was, which is fine I guess. I do not see an exception in the browser console either.
Should we close this bug?

Flags: needinfo?(jdescottes)

The error is logged if ::marker is the only child of the element. In your example, the marker has a sibling.

STRs:

  • open data:text/html,<ul><li></li></ul><span>test</span>
  • drag span before ::marker in the markup view

ER: no error
AR: error logged TypeError: this.getContainer(...).elt.nextSibling is null

Flags: needinfo?(jdescottes)
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.