Open Bug 1611720 Opened 5 years ago Updated 5 years ago

synthesizePlainDragAndDrop gets bogus coordinates

Categories

(Core :: DOM: Events, defect, P5)

defect

Tracking

()

People

(Reporter: emilio, Unassigned)

References

Details

I was trying to add a test for <input type=number> D&D in bug 1611701, and I couldn't make it to pass without suppressing the arrows.

The TLDR is that we end up getting a bogus nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE) from here:

#0  nsLayoutUtils::GetEventCoordinatesRelativeTo(mozilla::WidgetEvent const*, mozilla::gfx::IntPointTyped<mozilla::LayoutDevicePixel> const&, nsIFrame*) (aEvent=0x7ffc02d6af00, aPoint=..., aFrame=0x7ff6968f78d8)
    at /home/emilio/src/moz/gecko/layout/base/nsLayoutUtils.cpp:2194
#1  0x00007ff6b15ded81 in nsLayoutUtils::GetEventCoordinatesRelativeTo(mozilla::WidgetEvent const*, nsIFrame*) (aEvent=0x7ffc02d6af00, aFrame=0x7ff6968f78d8) at /home/emilio/src/moz/gecko/layout/base/nsLayoutUtils.cpp:2183
#2  0x00007ff6b15df449 in nsLayoutUtils::GetContainerAndOffsetAtEvent(mozilla::PresShell*, mozilla::WidgetEvent const*, nsIContent**, int*)
    (aPresShell=0x7ff69694f000, aEvent=0x7ffc02d6af00, aContainer=0x7ffc02d6a460, aOffset=0x7ffc02d6a4cc) at /home/emilio/src/moz/gecko/layout/base/nsLayoutUtils.cpp:2329
#3  0x00007ff6b084f033 in mozilla::dom::UIEvent::GetRangeParentContentAndOffset(int*) (this=<optimized out>, aOffset=0x7ffc02d6a4cc) at /home/emilio/src/moz/gecko/dom/events/UIEvent.cpp:145
#4  0x00007ff6b1408e3c in mozilla::EditorEventListener::DragOverOrDrop(mozilla::dom::DragEvent*) (this=0x7ff6997b1ca0, aDragEvent=0x7ff6969bba60) at /home/emilio/src/moz/gecko/editor/libeditor/EditorEventListener.cpp:750
#5  0x00007ff6b1408cfe in mozilla::EditorEventListener::DragEnter(mozilla::dom::DragEvent*) (this=0x7ff6997b1ca0, aDragEvent=0x7ff6969bba60) at /home/emilio/src/moz/gecko/editor/libeditor/EditorEventListener.cpp:717
#6  0x00007ff6b1408a35 in mozilla::EditorEventListener::HandleEvent(mozilla::dom::Event*) (this=0x7ff6997b1ca0, aEvent=0x7ff6969bba60) at /home/emilio/src/moz/gecko/editor/libeditor/EditorEventListener.cpp:330
#7  0x00007ff6b081f161 in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*)
    (this=0x7ff695c5eac0, aListener=<optimized out>, aDOMEvent=0x7ff6969bba60, aCurrentTarget=0x7ff6b8349100) at /home/emilio/src/moz/gecko/dom/events/EventListenerManager.cpp:1079
#8  0x00007ff6b081f80a in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool)
    (this=<optimized out>, aPresContext=0x7ff696939000, aEvent=<optimized out>, aDOMEvent=<optimized out>, aCurrentTarget=0x7ff6b8349100, aEventStatus=0x7ffc02d6ac28, aItemInShadowTree=<optimized out>)
    at /home/emilio/src/moz/gecko/dom/events/EventListenerManager.cpp:1271
#9  0x00007ff6b083892e in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) (this=0x7ff696729008, aVisitor=..., aCd=...)
    at /home/emilio/src/moz/gecko/dom/events/EventDispatcher.cpp:356
#10 0x00007ff6b0818de6 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&)
    (aChain=nsTArray<mozilla::EventTargetChainItem> & = {...}, aVisitor=..., aCallback=<optimized out>, aCd=...) at /home/emilio/src/moz/gecko/dom/events/EventDispatcher.cpp:558
#11 0x00007ff6b081925d in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&)

because there's no widget. Then we try to get the frame for that point inside the input and since it's the further right bottom we get the down-arrow instead of the actual editable area.

Component: DOM: Editor → DOM: Events

I assume that you don't have any trouble with actual DnD (I mean you do it actually). If not, let me know.

Blocks: 1603074
Priority: -- → P5

Right, this is test-only, regular D&D works.

Severity: normal → S4
You need to log in before you can comment on or make changes to this bug.