Is :-moz-drag-over totally useless?

Discuss application theming and theme development.
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Post Posted December 24th, 2012, 1:13 pm

Having written javascript to perform various style changes to elements being hovered over, and struggled with the nightmare that is dragenter and dragleave events, I thought :-moz-drag-over would be a breath of fresh air. Just apply my styles to appropriate elements with the -moz-drag-over pseudo-class selector, what could be simpler?

It doesn't work. Of course, it does work, but it only applies the style to the exact selected element that would be the target of a dragenter or dragleave event. As anyone who has ever done this will tell you, that means that an element is not considered to be being dragged over when its children are being dragged over. Hence an element is not selected by :-moz-drag-over when its children would be selected by it. Even anonymous content! So drag over a toolbarbutton and your styles may show up for a moment before you drag over the icon or label and they disappear. What use is that?


User avatar
Posts: 3195
Joined: December 9th, 2005, 5:51 am

Post Posted December 25th, 2012, 5:14 am

I've never tried to use it, but it looks like dbaron agrees with you:

dbaron wrote:I also think :-moz-drag-over should probably be hierarchical just like :active and :hover. (This involves changing nsEventStateManager::GetContentState and nsEventStateManager::SetContentState.)

Also, an MXR search shows it being used exactly zero times in working Mozilla code (other than tests and the definition of the thing itself). From a quick look, it seems just like you said -- not really doing anything worthwhile.
Theme Development is Radical Participation.
NNL Beta Builds for Current and Up-coming Firefox
Dear User: Your Help is Needed

Posts: 3664
Joined: September 15th, 2010, 9:03 am

Post Posted December 26th, 2012, 5:18 am

Thanks. I actually spotted that bug while researching this, but ignored it because it was so old and the title was clearly no longer correct. D'ohh!

Return to Theme Development

Who is online

Users browsing this forum: No registered users and 1 guest