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

Render WebView Components and Native Components in same layer #17

Open
QingAn opened this issue Jun 7, 2022 · 2 comments
Open

Render WebView Components and Native Components in same layer #17

QingAn opened this issue Jun 7, 2022 · 2 comments

Comments

@QingAn
Copy link
Contributor

QingAn commented Jun 7, 2022

Render WebView Components and Native Components in same layer

Submitter(s)

Qing An, Alibaba

Motivation

Hybrid Native/Webview App and MiniApp often use both WebView Components (text, label, button, image, etc.) and Native Components (such as video).

  1. Add a map: due to that developing a Web-based map component is difficult and not so good performance, developers may choose to use the Native map component. Usually, developers cover the WebView with the Native map component. But very often, the Native map will cover all the Web components rendered by WebView. And it is difficult to display one or several Web components on the Native map.
  2. Integrate a third-party content into WebView: from the business perspective, Native App needs to integrate third-party advertisements into the some App UI pages which are rendered by WebView. Many third-party advertisements are implemented based on Native components. How to integrate Native components with WebView smoothly?
  3. WebView interacts with Native component: developers have implemented a fancy UI page based on WebView, and then the WebView needs to use an extra Native component. How can the Native component interact with WebView smoothly? Like how to let Native component reuse the event handling and message interaction that have been implemented in WebView?

Unlike WebView Components, the Native Components are rendered by Native App instead of WebView. While Native Components can bring more features by complementing WebView Components, Native Components also bring issue for developers due to that Native rendering is independent of WebView rendering.
Therefore, Native Component cannot be controlled by z-index property, and cannot overlap with WebView components, as illustrated below.

Without-same-layer-rendering

But if the Native Components can be rendered in the same layer of WebView Component, AKA in the WebView Layer, developers can easily control the Native Components as well as the overlapping with other WebView Components, as illustrated below.

With-same-layer-rendering

Stakeholders

  • WebView provider: Apple, Google, deciders on how to support the same layer rendering
  • Native App or MiniApp developer: rely on the WebView
  • End user: users of the Native App or MiniApp are indirectly using the pages and functions implemented by WebView.

Analysis

Currently, Native rendering is independent of WebView rendering. Therefore, Native Component cannot be controlled by z-index property, and cannot overlap with WebView components.

Related W3C deliverables and/or work items

N/A

How is the issue solved in the Browser, and what’s more is needed?

N/A

@QingAn
Copy link
Contributor Author

QingAn commented Jun 15, 2022

To further explain this use cases, some scenarios are added. #17 (comment)

  1. Add a map: due to that developing a Web-based map component is difficult and not so good performance, developers may choose to use the Native map component. Usually, developers cover the WebView with the Native map component. But very often, the Native map will cover all the Web components rendered by WebView. And it is difficult to display one or several Web components on the Native map.
  2. Integrate a third-party content into WebView: from the business perspective, Native App needs to integrate third-party advertisements into the some App UI pages which are rendered by WebView. Many third-party advertisements are implemented based on Native components. How to integrate Native components with WebView smoothly?
  3. WebView interacts with Native component: developers have implemented a fancy UI page based on WebView, and then the WebView needs to use an extra Native component. How can the Native component interact with WebView smoothly? Like how to let Native component reuse the event handling and message interaction that have been implemented in WebView?

@QingAn
Copy link
Contributor Author

QingAn commented Jul 7, 2022

As discussed in 2022-07-6 meeting, we agree this is a valid use case. Next would be to collect the current practices and see whether it can inspire us on the solution.

QingAn added a commit that referenced this issue Jul 12, 2022
Merge use case of #17
@QingAn QingAn removed the Agenda+ label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant