Closed Bug 1183687 Opened 10 years ago Closed 10 years ago

[gaia-switch] 'type' getter called on an object that does not implement interface HTMLInputElement.

Categories

(Firefox OS Graveyard :: Gaia::Components, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yzen, Unassigned)

Details

Attachments

(1 file)

I'm experimenting with various types of automation testing available for a11y, to be possibly used for our gaia-components. One issue I found was related to the inheritance from the HTMLElements, in case of gaia-switch, from HTMLInputElement (it drives some of the tests). It seems like there's an issue accessing its type getter, and it might be a bug. HTMLInputElement.type runs without error but HTMLInputElement.prototype.type throws: 'type' getter called on an object that does not implement interface HTMLInputElement. which is what happens if we call gaiaSwitchObject.type If this is not a bug, feel free to close the bug.
Wilson, have you seen the above issue with any of our components? Also it looks like if we were to registerElement with extends instead of prototype it seems to work as expected.
Flags: needinfo?(wilsonpage)
register with option {extends: } was not work with gecko's custom element implementation. gaia-component's `extends` attribute is actually the prototype. Is HTMLInputElement.type is called inside of component?
(In reply to Fred Lin [:gasolin] from comment #2) > register with option {extends: } was not work with gecko's custom element > implementation. yeah > > gaia-component's `extends` attribute is actually the prototype. > > > Is HTMLInputElement.type is called inside of component? Not inside the component, but by the automated testing tools (e.g. external).
It seems like the simplest fix for this is to remove this line [1]. IIRC Fred added this. Fred is there any issue if we remove this? [1] https://github.com/gaia-components/gaia-switch/blob/master/gaia-switch.js#L22
Flags: needinfo?(wilsonpage) → needinfo?(gasolin)
I added this for general accessibility concern (but it seems not work well :( ), its fine to remove this if it does not help the accessibility.
Flags: needinfo?(gasolin)
(In reply to Fred Lin [:gasolin] from comment #5) > I added this for general accessibility concern (but it seems not work well > :( ), its fine to remove this if it does not help the accessibility. OK let's strip this for the time being if it fixes this? Yzen?
Flags: needinfo?(yzenevich)
Yes in this case it should probably be removed, especially since we do not specify the type.
Flags: needinfo?(yzenevich)
Attached file Github pull request.
Attachment #8640726 - Flags: review?(wilsonpage)
Comment on attachment 8640726 [details] [review] Github pull request. LANDED
Attachment #8640726 - Flags: review?(wilsonpage) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: