Open Bug 1327345 Opened 7 years ago Updated 2 years ago

Browser navigates to another page when I drag and drop a link on a free space on https://www.avito.ru/ (if page prevents 'dragover' event)

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P3)

defect

Tracking

()

REOPENED

People

(Reporter: arni2033, Unassigned)

Details

>>>   My Info:   Win7_64, Nightly 49, 32bit, ID 20160526082509
STR_1:  (original; see STR_2)
1. Log in on https://www.avito.ru/
2. Click the big blue button "������ ����������" at the top-right
3. Drag any link (<a> element) and drop it on the free place on the page

AR:  Browser navigates to that link I just dropped
ER:  Browser shouldn't navigate to the url (see STR_3), just like IE, just like GoogleChrome.



STR_2:  (testcase)
1. Open http://example.org and execute "ondragover=function(e){e.preventDefault()}" in web console
2. Drag the link ("More information...") and drop it on the free place on the page

AR:  Browser navigates to that link I just dropped
ER:  Browser shouldn't navigate to the url (see STR_3), just like IE, just like GoogleChrome.



STR_3:  (reference of good behavior)
1. Open http://example.org
2. Drag the link ("More information...") and drop it on the free place on the page

AR:  Browser doesn't navigate to the url, just as expected (because I can accidentally drag a link)



Notes:
1) STR_1 Step 2 can be replaced with "Navigate to https://www.avito.ru/additem". It's the same
2) STR_2 Step 1 is rather complex, but it allows you to make sure that IE11 has good behavior
   Instead of performing that step as is, you can open url [1] in Firefox.

> [1] data:text/html,<body onload="ondragover=function(e){e.preventDefault()};"><a href="http://example.org">Link</a>
No longer blocks: 1277113
Component: Untriaged → Event Handling
Product: Firefox → Core
According to MDN description[1], AR sounds the expected behaviour. Close as Invalid for that. Feel free to reopen it if I got something wrong.

Quote:
"In a web page, you should call the preventDefault() method of the event if you have accepted the drop so that the default browser handling does not handle the dropped data as well. For example, when a link is dragged to a web page, Firefox will open the link. By cancelling the event, this behavior will be prevented."

[1] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
> According to MDN description[1], AR sounds the expected behaviour. Close as
> Invalid for that. Feel free to reopen it if I got something wrong.
> 
> Quote:
> "In a web page, you should call the preventDefault() method of the event if
> you have accepted the drop so that the default browser handling does not
> handle the dropped data as well. For example, when a link is dragged to a
> web page, Firefox will open the link. By cancelling the event, this behavior
> will be prevented."
> 
> [1] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations

So
> STR_2:  (testcase)
> 1. Open http://example.org and execute "ondragover=function(e){e.preventDefault()}" in web console
> 2. Drag the link ("More information...") and drop it on the free place on the page
> 
> AR:  Browser navigates to that link I just dropped
> ER:  Browser shouldn't navigate to the url (see STR_3), just like IE, just like GoogleChrome.

Does not look the correct to me. Web pages calls e.preventDefault() to cancel the dragover event, so the default Firefox behavior (opening the link) should be prevented.

Reopening on behalf of the reporter because reporter's account is disabled.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
(In reply to Masatoshi Kimura [:emk] from comment #2)
> (In reply to Hsin-Yi Tsai [:hsinyi] from comment #1)
> > According to MDN description[1], AR sounds the expected behaviour. Close as
> > Invalid for that. Feel free to reopen it if I got something wrong.
> > 
> > Quote:
> > "In a web page, you should call the preventDefault() method of the event if
> > you have accepted the drop so that the default browser handling does not
> > handle the dropped data as well. For example, when a link is dragged to a
> > web page, Firefox will open the link. By cancelling the event, this behavior
> > will be prevented."
> > 
> > [1] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations
> 
> So
> > STR_2:  (testcase)
> > 1. Open http://example.org and execute "ondragover=function(e){e.preventDefault()}" in web console
> > 2. Drag the link ("More information...") and drop it on the free place on the page
> > 
> > AR:  Browser navigates to that link I just dropped
> > ER:  Browser shouldn't navigate to the url (see STR_3), just like IE, just like GoogleChrome.
> 
> Does not look the correct to me. Web pages calls e.preventDefault() to
> cancel the dragover event, so the default Firefox behavior (opening the
> link) should be prevented.
> 
> Reopening on behalf of the reporter because reporter's account is disabled.

:emk, you are right. I read the MDN again and I understand I misunderstood the explanation.
Priority: -- → P3
Component: Event Handling → User events and focus handling
Component: DOM: UI Events & Focus Handling → DOM: Copy & Paste and Drag & Drop
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.