Closed Bug 1484544 Opened 7 years ago Closed 7 years ago

Input element unusable on top level video document

Categories

(Toolkit :: Video/Audio Controls, defect)

62 Branch
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla63
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox61 --- unaffected
firefox62 --- verified
firefox63 --- verified

People

(Reporter: hanu6, Assigned: timdream)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 Build ID: 20100101 Steps to reproduce: In its own tab, open a video (I used a webm in Firefox developer edition 62.0b17 64bit). Append an input element with javascript. let inp = document.createElement('input') inp.type='text' document.body.append(inp) Actual results: The input element is unusable and does not take text. Expected results: Input should work as normal.
Hi hanu6, Thanks for reporting the issue. Can you attach a full test case of the issue?
Component: Untriaged → Layout: Form Controls
Flags: needinfo?(hanu6)
Product: Firefox → Core
Works fine here on Nightly FWIW. What's the use-case for this?
(In reply to Grover Wimberly IV [:Grover-QA] from comment #1) > Thanks for reporting the issue. Can you attach a full test case of the issue? Sounds like a testcase isn't possible here. The steps in comment 0 are sufficient to test, if you've got a video to load. Here's a sample video that works: http://media.tinyvid.tv/lhbt7kl3n3pf.ogg (In reply to Emilio Cobos Álvarez (:emilio) from comment #2) > Works fine here on Nightly FWIW. What's the use-case for this? I can reproduce the issue in Nightly on Linux. I'm curious about the use case, too, though... This is an internal bit of Firefox UI, which isn't expecting to have its DOM messed with. Looking in DevTools, I see that our top-level video document has an event handler on the root element, which redirects all focus to the video controls. The code for that is here (and was added in bug 1483408 it seems): https://searchfox.org/mozilla-central/rev/3fa761ade83ed0b8ab463acb057c2cf0b104689e/toolkit/content/TopLevelVideoDocument.js#13-26 That chunk clearly is going to mean that other elements in the web page won't be able to receive focus -- which shouldn't normally be a problem, because this is a bit of Firefox internal UI that shouldn't have any extra elements, beyond those that the user adds themselves via manual DOM surgery like that described in comment 0. :)
Some clearer STR, just so we're all using the same steps: 1. Visit http://media.tinyvid.tv/lhbt7kl3n3pf.ogg 2. Ctrl+Shift+K / Cmd+Shift+K to open console (or "Tools|Web Developer|Web Console) 3. Paste the following line into the console and hit enter: document.body.append(document.createElement('input')) 4. Try to click to focus the textfield that you'll now see on the page.
Use case is add-ons. I have an addon that creates an input element so you can mess around with settings specific to the video. For reference: https://github.com/losnappas/Custom-Loop/issues/4 STR is exactly like comment #4.
Flags: needinfo?(hanu6)
Flags: needinfo?(timdream)
Interesting case! So the Web spec does allow the implementation to put any script in the media document (see bug 1474832), but I do agree this can be improved. Perhaps we could install a mutation observer there and remove the focus event listener as soon as it detects any DOM changes. This bug needs to be fixed soon if we don't want this to reach release.
Mentor: timdream
Component: Layout: Form Controls → Video/Audio Controls
Flags: needinfo?(timdream)
Product: Core → Toolkit
Status: UNCONFIRMED → NEW
Ever confirmed: true
I'll just push a patch for this then.
Assignee: nobody → timdream
Mentor: timdream
Status: NEW → ASSIGNED
Comment on attachment 9003640 [details] Bug 1484544 - Allow focusable element to function on top level video element r=Gijs :Gijs (he/him) has approved the revision.
Attachment #9003640 - Flags: review+
Pushed by tchien@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a28cf3253e23 Allow focusable element to function on top level video element r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Comment on attachment 9003640 [details] Bug 1484544 - Allow focusable element to function on top level video element r=Gijs Approval Request Comment [Feature/Bug causing the regression]: bug 1483408 [User impact if declined]: Add-ons would not be able to insert DOM element on to top level media document that needs focus [Is this code covered by automated tests?]: No [Has the fix been verified in Nightly?]: Not yet. [Needs manual test from QE? If yes, steps to reproduce]: See comment 4. [List of other uplifts needed for the feature/fix]: None. [Is the change risky?]: No. [Why is the change risky/not risky?]: Patch only affect top level media document. [String changes made/needed]:
Attachment #9003640 - Flags: approval-mozilla-beta?
Comment on attachment 9003640 [details] Bug 1484544 - Allow focusable element to function on top level video element r=Gijs 62 is on release now, switching the request accordingly.
Attachment #9003640 - Flags: approval-mozilla-beta? → approval-mozilla-release?
I managed to reproduce the initial issue on 62.0b20 build1 (20180823143155), using the STR provided in comment 4. I can confirm that 63.0a1 (2018-08-26) is verified fixed across platforms (Windows 10 x64, Ubuntu 16.04 x64, macOS 10.13.6). There is still a problem - Devedition 63.0b1 build1 (20180824192747) is still affected.
Flags: needinfo?(timdream)
That's expected given the timing of when this hit m-c. 63.0b2 should be OK.
Flags: needinfo?(timdream)
Comment on attachment 9003640 [details] Bug 1484544 - Allow focusable element to function on top level video element r=Gijs Fixes a regression from bug 1483408. Approved for 62 RC1.
Attachment #9003640 - Flags: approval-mozilla-release? → approval-mozilla-release+
The fix was successfully implemented on Devedition 63.0b2 build1 (20180830123124) and on 62.0 build2 (20180830143136) across platforms (macOS 10.13.6, Ubuntu 16.04 x64, Windows 10 x64). Setting the flags accordingly.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: