whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.13k stars 2.67k forks source link

should search for draggable attribute follow dom tree or flattened tree? #10185

Open dbaron opened 8 months ago

dbaron commented 8 months ago

What is the issue with the HTML Standard?

Right now it seems that the spec requires that the search for a draggable attribute when a drag is initiated go up the "ancestor chain", which I presume refers to the document tree. However, we got Chromium bug 328263459 reporting that the behavior in Firefox differs (while Chrome and Safari match my interpretation of the current spec), and Firefox at least appears to search the flattened tree ancestors. The reporter of that bug prefers the Firefox behavior (reasonably, I think).

I'm curious if others agree with my analysis of the current spec, and what you think about whether the current spec should change or not.

smaug---- commented 8 months ago

If I read the code correctly, https://searchfox.org/mozilla-central/rev/6b1e306175c2284958fb185bab388021e2890ed0/dom/base/nsContentAreaDragDrop.cpp#324-331 is where Gecko gets flattened tree behavior. And I think Gecko's behavior is quite reasonable.

Looks like the spec uses term "ancestor chain" also in couple of other places, yet its meaning isn't clearly defined. Though I agree I'd assume non-shadow boundary crossing ancestor chain when reading it.

@emilio

emilio commented 8 months ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1734870 and https://bugzilla.mozilla.org/show_bug.cgi?id=1767938 are some relevant changes here. Before the later one our draggable handling was completely busted IIUC. But yeah, I think flattened tree makes sense here...

woody-li commented 1 day ago

+1 to favour Firefox's behavior