You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[web] Use ShadowDOM slots to render HtmlElementViews #80524
Add flag to opt-into the new rendering mechanism. DO WE WANT THIS?? NO
Render views into the DOM in an unified way (this code should be identical both for canvaskit and html backends, since we're rendering outside of the ShadowDOM.
Reacted by chunhunghan, Peer, Ludwik Trammer, creativecreatorormaybenot, Soham, Hillel Coren, Pedro Massango, zs-dima, borjandev, Oliver Welther and 4 more
Reacted by creativecreatorormaybenot, chunhunghan, zs-dima, Peer, Nguyễn Giang Vĩ Sơn, VillainLin and Cullen Lee
❓ Question to anybody following: Would it be useful to have a flag to enable/disable the slot-based rendering of Platform Views?
"Disable" would mean to keep the current (buggy) version of the rendering, with the problems described in the design doc, and having to opt-in (at flutter build time) into the fix with something like:
flutter build web --dart-define=FLUTTER_WEB_USE_SLOTS=true
Since the current version is not working well, except for the simplest of cases, the alternative we were thinking of is to just move on with a direct fix (no need to opt-in).
We still don't foresee any major breakage with the new structure, unless your code is using 3rd party JS code to access the contents of your platform views.
What do you think?
Reacted by creativecreatorormaybenot
creativecreatorormaybenot commented on Apr 19, 2021
The upside is that in case it does break existing behavior, you would still have adjustment time / a way to use the old behavior.
On the flip side, I really cannot imagine an actual use case that would break by fixing the bugs. If there really are no side effects, it seems like it should be fine to just move to it.
Both of the workarounds I built over the past months, i.e. one for the HTML renderer and one for CanvasKit, should still continue to work with slots (one inserts an <iframe> element that it speaks to using post message and the other one inserts a <div> element directly in the <body>).
Using the basic example of flutter and adding this html element, every time I click the button to increase the element is repainted.
I use it because I want to embed the website in an electronjs application and be able to use the webview tag which works fine for me, it only has the mentioned error.
@isamuninja I haven't tried your code, but can you try removing the UniqueKey from the key of the video player? Every time that you set state, you're telling the framework that the video player is a different widget, and that's probably causing the repaint:
(I'd also move the registerViewFactory to a place that doesn't depend much of the widget lifecycle, as close to the main as you can, so it doesn't re-run, but this is probably not causing the issue.)
@ayazthemre I think this is already in the Beta channel. AFAIK there's no date for the next stable release. Beta to Stable happens around once a quarter.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
ludwiktrammer commentedon Apr 16, 2021
ditman commentedon Apr 16, 2021
ludwiktrammer commentedon Apr 16, 2021
gib40f commentedon Apr 19, 2021
ditman commentedon Apr 19, 2021
@gib40f the code is still not in master, so you probably fixed something on your end (probably the page layout) :)
ditman commentedon Apr 19, 2021
I've deployed the example app in #71888 with the fix I'm working on, and it looks much more stable! The youtube video is not reloading anymore!
I've also deployed both repro app from #77369, and looks like it's not refreshing the PDF preview:
Last but not least, the repro app in #75195 also seemed to be affected by this issue. I've deployed it with the new engine here:
ditman commentedon Apr 19, 2021
❓ Question to anybody following: Would it be useful to have a flag to enable/disable the slot-based rendering of Platform Views?
"Disable" would mean to keep the current (buggy) version of the rendering, with the problems described in the design doc, and having to opt-in (at flutter build time) into the fix with something like:
flutter build web --dart-define=FLUTTER_WEB_USE_SLOTS=trueSince the current version is not working well, except for the simplest of cases, the alternative we were thinking of is to just move on with a direct fix (no need to opt-in).
We still don't foresee any major breakage with the new structure, unless your code is using 3rd party JS code to access the contents of your platform views.
What do you think?
creativecreatorormaybenot commentedon Apr 19, 2021
The upside is that in case it does break existing behavior, you would still have adjustment time / a way to use the old behavior.
On the flip side, I really cannot imagine an actual use case that would break by fixing the bugs. If there really are no side effects, it seems like it should be fine to just move to it.
Both of the workarounds I built over the past months, i.e. one for the HTML renderer and one for CanvasKit, should still continue to work with slots (one inserts an
<iframe>element that it speaks to using post message and the other one inserts a<div>element directly in the<body>).gib40f commentedon Apr 19, 2021
56 remaining items
Akshaymain commentedon Jun 10, 2021
TahaTesser commentedon Jun 10, 2021
tneotia commentedon Jun 10, 2021
bsp003 commentedon Jun 11, 2021
@ditman Yes, desperately in need of this in stable channel. Please help!
ditman commentedon Jun 23, 2021
Marking this as backwards breaking, here's the Migration Guide:
jeannelim commentedon Jul 12, 2021
Any updates on this fix? Looks like it's still in master channel. We really need this fix.
isamuninja commentedon Jul 17, 2021
Hello @ditman, good job.
Switching to the beta or dev channel solves the problem when resizing the window.
But in my case I have a problem when I try to draw an iframe or webview tag with the Element.html() method, example
Using the basic example of flutter and adding this html element, every time I click the button to increase the element is repainted.
I use it because I want to embed the website in an electronjs application and be able to use the webview tag which works fine for me, it only has the mentioned error.
Do you know any way to fix this?
I attach the complete code used.
Demo DartPad
Screen.Recording.2021-07-17.at.05.57.51.mov
Thank you so much.
ditman commentedon Jul 19, 2021
@isamuninja I haven't tried your code, but can you try removing the
UniqueKeyfrom thekeyof the video player? Every time that you set state, you're telling the framework that the video player is a different widget, and that's probably causing the repaint:to
(I'd also move the
registerViewFactoryto a place that doesn't depend much of the widget lifecycle, as close to themainas you can, so it doesn't re-run, but this is probably not causing the issue.)isamuninja commentedon Jul 19, 2021
thank you very much @ditman, removing the key I no longer have the problem.
ayazemre commentedon Jul 31, 2021
Is there any date for this to release on stable version?
ditman commentedon Aug 3, 2021
@ayazthemre I think this is already in the Beta channel. AFAIK there's no date for the next stable release. Beta to Stable happens around once a quarter.
github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.