Closed Bug 724161 Opened 12 years ago Closed 12 years ago

simplify drag&drop checks for javascript:/data: URIs

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 13
Tracking Status
firefox11 --- fixed
firefox12 --- fixed
firefox-esr10 --- fixed

People

(Reporter: Gavin, Assigned: Gavin)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

The patch for bug 718203 exposes a nicer API for filtering out javascript:/data: link drops, we should make use of that rather than having different string-comparison checks.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
with tests
Attachment #594359 - Attachment is obsolete: true
Attachment #597203 - Flags: review?(dao)
Comment on attachment 597203 [details] [diff] [review]
patch

>+++ b/browser/base/content/test/browser_tabDrop.js

>+      chromeUtils.synthesizeDrop(newTab, newTab, [[{type: "text/plain", data: text}]], "link", window, EventUtils);

I would expect this to load the links in the current tab, but you're expecting new tabs. What's going on here?
(In reply to Dão Gottwald [:dao] from comment #3)
> I would expect this to load the links in the current tab, but you're
> expecting new tabs. What's going on here?

Good catch. The synthesizeDrop code is producing events with screenX/screenY equal to 0, which makes _getDragTargetTab return null.

Fixing synthesizeDrop to pass realistic coordinates seems like it might be annoying. What do you think about just adding a comment explaining the reliance on the bug?
Could the synthetic drop target the left or right side of the tab so that it keeps working in case that bug gets fixed?
(In reply to Dão Gottwald [:dao] from comment #5)
> Could the synthetic drop target the left or right side of the tab so that it
> keeps working in case that bug gets fixed?

There's no way to control the specific coordinates of the drop. I think anyone fixing synthesizeDrop to pass non-bogus coordinates will also have to add support for specifying custom offsets to avoid breaking the world, so it makes more sense to just deal with this test when (if) that happens.
Attachment #597203 - Flags: review?(dao) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/50aae34555bb
Flags: in-testsuite+
Target Milestone: --- → Firefox 13
https://hg.mozilla.org/mozilla-central/rev/50aae34555bb
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment on attachment 597203 [details] [diff] [review]
patch

[Approval Request Comment]
fix for bug 704354. depends on patch for bug 718203.
Attachment #597203 - Flags: approval-mozilla-beta?
Attachment #597203 - Flags: approval-mozilla-aurora?
Comment on attachment 597203 [details] [diff] [review]
patch

[Triage Comment]
Approving for Aurora/Beta in support of bug 704354. Please land today.
Attachment #597203 - Flags: approval-mozilla-beta?
Attachment #597203 - Flags: approval-mozilla-beta+
Attachment #597203 - Flags: approval-mozilla-aurora?
Attachment #597203 - Flags: approval-mozilla-aurora+
Whiteboard: [qa-]
Attachment #597203 - Flags: approval-mozilla-esr10?
Attachment #597203 - Flags: approval-mozilla-esr10? → approval-mozilla-esr10+
See Also: → 1679438
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: