Closed Bug 1116966 Opened 9 years ago Closed 8 years ago

SVGElement.prototype.focus is missing

Categories

(Core :: SVG, enhancement)

34 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mail, Unassigned)

References

Details

Attachments

(1 file)

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
Closed: 9 years ago
Component: Untriaged → SVG
Product: Firefox → Core
Resolution: --- → INVALID
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
The focus method is available on SVG elements in version 51.0a1 (2016-09-11) (64-bit) [possibly earlier]
Status: NEW → RESOLVED
Closed: 9 years ago8 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.

Attachment

General

Creator:
Created:
Updated:
Size: