Closed Bug 1228927 Opened 9 years ago Closed 9 years ago

[FTE][fling-tutorial][TV][2.5] Button focus fails in online tutorial because of no permission to document.registerElement method

Categories

(Firefox OS Graveyard :: Gaia::First Time Experience, defect, P2)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Fischer, Assigned: Fischer)

References

Details

(Whiteboard: [ft:conndevices])

Attachments

(1 file)

(deleted), text/x-github-pull-request
rexboy
: review+
Details
+++ This bug was initially created as a clone of Bug #1221859 +++
In the simulator, the document.registerElement method is not available so the smart-button's function will not work.
We should handle the focus on our own.
The document.registerElement method is unavailable inside iframe in the simulator.
The bug 1228929 is to separate the offline content from the iframe.
However, the online content has to be loaded inside a iframe so for the online content we have to handle the button focus by our own script.
Assignee: nobody → fliu
Summary: [TV] Unable to focus in the simulator because the document.registerElement method is unavailable → [TV] Button focus fails on fling tutorial's online content because of no permission to document.registerElement method
The reason that the document.registerElement method is unavailable is because the online content iframe has no permission to it under the production mode.
Summary: [TV] Button focus fails on fling tutorial's online content because of no permission to document.registerElement method → [FTE][fling-tutorial][TV][2.5] Button focus fails in online tutorial because of no permission to document.registerElement method
Attached file PR# 7 (deleted) —
@Rex,

This patch does:

- In the production build iframe content has no permission to document.registerElement method so remove the gaia-components/smart-button which needs document.registerElement

- Reimplement the UI styles and behaviours of the gaia-components/smart-button without using document.registerElement

p.s:
If need to see this update from the real site, for convenience, please just change the mozIframe.src in fling-tutorial/js/index.js to 'http://fischer-l.github.io/casting-tutorial/'.
The test github page above has been updated with the latest changes.

Thank you
Attachment #8710829 - Flags: review?(rexboy)
Update the issue description:

In the production build because the app is 'app://' protocol and the iframe is 'http://' protocol, even the app claims the web-component permission but the iframe still cannot get the web-component permission.

As a result, the document.registerElement method is unavailable to  the iframe content and the gaia-components/smart-button which relies on the document.registerElement method wouldn't function.

p.s:
If it was in the engineering build, the iframe would be allowed to get the web-component permission in this case.
Comment on attachment 8710829 [details]
PR# 7

Looks good to me but please add some comments to describe the situation of web components. See my comments on Github.
Attachment #8710829 - Flags: review?(rexboy) → review+
Land to master: https://github.com/mozilla-b2g/casting-tutorial/commit/ec578ad528239952d3db204584df8b6fc43bfe7c
Status: NEW → RESOLVED
Closed: 9 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: