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

Separate interface for controlling page and presenting page #91

Closed
schien opened this issue May 25, 2015 · 13 comments
Closed

Separate interface for controlling page and presenting page #91

schien opened this issue May 25, 2015 · 13 comments
Assignees
Labels

Comments

@schien
Copy link
Contributor

schien commented May 25, 2015

Currently we mix the API for controlling page and presenting page in NavigatorPresentation and developer will use navigator.presentation as the entry point.

Since we are providing more and more advance feature in this API (see #19), it's cumbersome to provide statement on the usage of each attribute/function.

Therefore I propose to move all presenting page APIs into a different interface, called PresentingContext. The example definition will looks like:

interface PresentingContext : EventTarget {
  Promise<PresentationSession> getSession();
  Sequence<PresentationSession> getSessions();
  attribute EventHandler onsessionavailable;
};

partial interface Navigator {
  readonly attibute PresentingContext presentingContext; // null if not presenting page
};
@anssiko
Copy link
Member

anssiko commented Jun 1, 2015

@schien Thanks for the concrete proposal.

All - @tidoust has a nice explanation in the Conformance classes definition issue why this separation makes very much sense. Please read the issue, and let the group know if you have any concerns with separating the interfaces to reflect the two conformance classes of products as follows (naming subject to change): opening user agent (or controlling user agent to align with #95) and presenting user agent. This issue proposes the first concrete change to implement this separation.

@mfoltzgoogle How would you like to proceed with baking this into the spec? I suggest you coordinate with @schien who volunteered to help.

@markafoltz
Copy link
Contributor

I think I would like to define the conformance classes for the controlling/opening browsing context and the presenting browsing context as in #93 and re-outline the document as best as I can along those lines.

Then it will be easier to introduce the new interfaces proposed by @schien since they will have a logical place in the new document.

@avayvod
Copy link
Contributor

avayvod commented Jun 3, 2015

A naming idea:
navigator.present - for the controller (sender) page
navigator.presentation - for the presentation (receiver) page

So we leave what we have for the presentation where it is and move the sender API to the shorter interface.

@anssiko
Copy link
Member

anssiko commented Jun 16, 2015

It seems no concerns raised with the general direction proposed by @schien. It also appears we've not yet settled on the interface naming. We should first update the Conformance section using the @tidoust's proposal as a starting point and bake in the changes to the normative parts when consensus emerges on naming.

All - please let us know your preference and/or suggestions with respect to naming.

@mfoltzgoogle Feel free to update the Conformance section with a note stating that the rest of the spec have not yet been reworked to match the conformance classes split.

@mounirlamouri
Copy link
Member

@schien what do you think of:

interface Presentation {
  attribute PresentationSession? defaultRequest;
  readonly attribute PresentationReceiver? receiver;
};

interface PresentationReceiver : EventTarget {
  Promise<PresentationSession> getSession();
  Promise<sequence<PresentationSession>> getSessions();
  attribute EventHandler onsessionavailable;
};

I think it has the benefit of splitting the receiver and sender APIs and also provide a good way to find out whether the current browsing context is a receiver (ie. navigator.presentation.receiver is not null).

@schien
Copy link
Contributor Author

schien commented Sep 1, 2015

Overall looks good to me, but I still prefer PresentingContext over PresentationReceiver. It's more consistent to the common idiom we defined in spec.

@mounirlamouri
Copy link
Member

I think PresentingContext has multiple downsides:

  • navigator.presentingContext isn't in the navigator.presentation namespace
  • PresentingContext isn't prefixed with Presentation
  • I think navigator.presentation.receiver is clearer about what it does compared to navigator.presentingContext.

@mounirlamouri
Copy link
Member

@sicking, an opinion?

@sicking
Copy link

sicking commented Sep 2, 2015

I'm fine with any of the proposals here, but I'd probably go with @mounirlamouri's proposal if I had to choose.

@tidoust
Copy link
Member

tidoust commented Sep 2, 2015

I like the idea of sticking to the navigator.presentation namespace.

That's more an editorial point perhaps but since we'll end up with two conformance classes in the spec, it seems good to have separate IDL for each class of products to be able to say "the controlling user agent MUST implement the interface defined in section X.Y." instead of "the controlling user agent MUST implement the defaultRequest attribute of the Presentation interface".

How would you define the resulting Presentation interface in the spec, @mounirlamouri ? An empty interface completed with two partial interfaces, one with defaultRequest and the other with receiver?

@mounirlamouri
Copy link
Member

We can't really have two partial interfaces because we need a Presentation interface which would be null. I will go with one Presentation interface with both objects unless there is an objection.

mounirlamouri added a commit to mounirlamouri/presentation-api that referenced this issue Sep 8, 2015
…s it.

This is moving around some spec definitions to apply on
PresentationReceiver instead of Presentation, the examples have been
changed and navigator.presentation.receiver has been defined.

Fixes w3c#91.
@mounirlamouri mounirlamouri self-assigned this Sep 8, 2015
@anssiko
Copy link
Member

anssiko commented Sep 8, 2015

@mounirlamouri Please submit a PR with your proposal. It is probably easier for the participants to review the changes in context. I suggest you update the conformance section to match in the same PR (you can borrow the language from #93) and cross-reference the conformance classes appropriately.

As long as the spec is clear to implementers (what must be implemented/tested) and authors (albeit there are surely better API docs for web developers than specs) on the division, we should be fine with @mounirlamouri's proposal even if the spec would end up being a bit more verbose that way. The extra editorial cost will pay off.

@mounirlamouri
Copy link
Member

FWIW, the PR is up and was sent between my previous comment and yours. It should show up in GH UI. For those who interact on issues via email, it is issue #186.

mounirlamouri added a commit to mounirlamouri/presentation-api that referenced this issue Sep 12, 2015
…s it.

This is moving around some spec definitions to apply on
PresentationReceiver instead of Presentation, the examples have been
changed and navigator.presentation.receiver has been defined.

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

No branches or pull requests

7 participants