Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample page for vertical-scroll. #9

Open
ehsan-karamad opened this issue Oct 16, 2018 · 2 comments
Open

Sample page for vertical-scroll. #9

ehsan-karamad opened this issue Oct 16, 2018 · 2 comments

Comments

@ehsan-karamad
Copy link
Contributor

For vertical-scroll demo, (similar to other policies) a sample html page is loaded inside an <iframe> where the feature itself is enabled/disabled. This is a bit limiting in demonstrating a feature such as vertical-scroll where for proper illustration, the actual <iframe> should be scrollable in its parent. Essentially with the new changes to vertical-scroll policy, when a frame is disabled it will not consume any scroll gestures. With the current demo it leads to the whole page appearing as unscrollable which is in fact only because the <iframe> containing vertical-scroll.html was not scrollable to begin with.

I think setting up for a new feature for demo-ing should involve an optional step to configure the embedding page as well. Perhaps in updatePage we could check if policy requires further tuning (although putting raw code in policy.json which is where all the feature related information coming from might not be a good idea)

@ebidel
Copy link
Contributor

ebidel commented Oct 16, 2018

Yea, the iframe embedding a demo is kinda hacky. I wanted to have every page be standalone and have the server send the correct headers, but it was easier to embed the demos in an iframe and toggle policies via allow :)

@ehsan-karamad
Copy link
Contributor Author

I think even if the server would run and set the header to something like vertical-scroll 'none' we'd still have some issues to properly explain what the feature demos. vertical-scroll is mostly meaningful in dealing with embedded content.

I can see two solutions (there is possibly more of course):

  • Get sample pages apply the change to a nested <iframe>. This is basically adding an <iframe> layer which makes some preparations before loading the actual test <iframe>. Some elements such as feature-allow-banner would have to be moved to the inner most frame. The general details and policy descriptions could (optionally) stay in the middle <iframe>.

  • Add an embedder page initialization step which will be overridden for each policy (only vertical-scroll perhaps).

In all these two cases all we need to do for vertical-scroll is to add some spacer above or below the test frame so that it is quite visible what the feature does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants