SVGElement.prototype.focus is missing

RESOLVED FIXED

Status

()

--
enhancement
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: mail, Unassigned)

Tracking

34 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:34.0) Gecko/20100101 Firefox/34.0
Build ID: 20141125180439

Steps to reproduce:

I tried to call focus() on an SVGElement. After realizing that focus() and blur() are not available, I tried calling HTMLElement.prototoype.focus with an SVGElement as context, only to end up with a TypeError. In Firefox SVG elements cannot be focused by script.

Live test case: http://medialize.github.io/ally.js/tests/browser-bugs/gecko-svg-focus-missing.html


Actual results:

TypeError: element.focus is not a function

after faking support by SVGElement.prototype.focus = HTMLElement.prototype.focus I got

TypeError: 'focus' called on an object that does not implement interface HTMLElement

Also reproducible in Firefox Nightly 37.0a1 (2014-12-20).


Expected results:

SVGElement.prototype.focus should have been there in the first place. Blink and WebKit expose the function at Element.prototype.focus, thus SVGElement inherits it automatically. Trident is also missing SVGElement.prototype.focus but allows abusing HTMLElement.prototype.focus on instances of SVGElement.
You would need to get this added to the SVG specification first before we'd consider implementing it: http://lists.w3.org/Archives/Public/www-svg/

Once it's added to the specification, feel free to reopen this bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Component: Untriaged → SVG
Product: Firefox → Core
Resolution: --- → INVALID
(Reporter)

Comment 2

4 years ago
It is part of the SVG2 draft SVGElement interface: https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement
OK
Severity: normal → enhancement
Status: RESOLVED → UNCONFIRMED
OS: Mac OS X → All
Hardware: x86 → All
Resolution: INVALID → ---
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment hidden (offtopic)
(Reporter)

Comment 5

3 years ago
The focus method is available on SVG elements in version 51.0a1 (2016-09-11) (64-bit) [possibly earlier]
Status: NEW → RESOLVED
Last Resolved: 4 years ago3 years ago
Resolution: --- → INVALID
Blocks: 778654
Resolution: INVALID → FIXED
You need to log in before you can comment on or make changes to this bug.