-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[web] Fall-back to a DOM node if Shadow DOM is unavailable. #26647
Merged
fluttergithubbot
merged 10 commits into
flutter:master
from
ditman:fallback-to-dom-rendering
Jun 14, 2021
Merged
[web] Fall-back to a DOM node if Shadow DOM is unavailable. #26647
fluttergithubbot
merged 10 commits into
flutter:master
from
ditman:fallback-to-dom-rendering
Jun 14, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
yjbanov
reviewed
Jun 9, 2021
ditman
changed the title
[wip] [web] Fall-back to a DOM node if Shadow DOM is unavailable.
[web] Fall-back to a DOM node if Shadow DOM is unavailable.
Jun 10, 2021
yjbanov
reviewed
Jun 10, 2021
yjbanov
reviewed
Jun 11, 2021
Now the ShadowDomHostNode is able to attach its own stylesheet. This required two changes: 1. The HostNode (and its parent) are attached to the DOM beforehand (updated host_node_test.dart slightly) 2. The once-private to DomRenderer _applyCssRulesToSheet method has been made public, and renamed to applyGlobalCssRulesToSheet, so it can also be called from host_node.dart. This commit also addresses some more PR comments: * Use feature detection instead of exception handling to decide whether ShadowDOM is available or not, when creating the HostNode instance of a Flutter app. * Update ShadowRoot references to HostNode (also in test code).
ditman
commented
Jun 12, 2021
yjbanov
approved these changes
Jun 14, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditman
added
the
waiting for tree to go green
This PR is approved and tested, but waiting for the tree to be green to land.
label
Jun 14, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 14, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 15, 2021
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 15, 2021
9 tasks
naudzghebre
pushed a commit
to naudzghebre/engine
that referenced
this pull request
Sep 2, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cla: yes
platform-web
Code specifically for the web engine
waiting for tree to go green
This PR is approved and tested, but waiting for the tree to be green to land.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If your browser doesn't have Shadow DOM, the flutter web app crashes upon startup of the DOM Renderer.
However, the Shadow DOM is only really needed to render Platform Views. If your web app doesn't use Platform Views, there's nothing preventing us from rendering a beautiful app into the regular DOM.
This PR adds a
HostNode
interface that clients can code against to perform the required DOM operations of the Shadow DOM/Regular DOM, and two implementationsShadowDomHostNode
andElementHostNode
, that allow flutter apps to render regardless of ShadowDOM being available or not.Testing
HostNode
classesPre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.