-
Notifications
You must be signed in to change notification settings - Fork 156
Added a flag to selectively use shadow dom #1101
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
be2df0d
added a flag to selectively enable shadow dom
cometkim 37dcca4
rename attr to data-shadow-dom
cometkim e07da38
reset hello-world example changesets
cometkim 53ef0af
Merge branch 'main' into shadow-root
cometkim 25bd340
Merge branch 'main' into shadow-root
cometkim 679ee6d
accepted suggestion
cometkim badfbe8
fix demo path
cometkim 44d5f58
fix demo..
cometkim fae5551
add a very simple test case
cometkim bbe2a14
Merge branch 'main' into shadow-root
cometkim a505de7
Merge branch 'main' into shadow-root
cometkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,4 +34,4 @@ | |
| }, false); | ||
| </script> --> | ||
| </body> | ||
| </html> | ||
| </html> | ||
This file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <title>Shadow Root</title> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <link href="/demo.css" rel="stylesheet"> | ||
| <script src="/dist/main.mjs" type="module"></script> | ||
| <script src="/dist/main.js" nomodule defer></script> | ||
| <!-- This comment block is intended to make it easier to test both the script module and nomodule path --> | ||
| <!-- Comment either block to enable module/nomodule or disable it. --> | ||
| <!-- <script src="/dist/main.js" defer></script> --> | ||
| </head> | ||
| <body> | ||
| <div>Host Element</div> | ||
| <div src="shadow-dom.js" id="upgrade-me" data-shadow-dom> | ||
| <div id="root"> | ||
| <div>Guest Element</div> | ||
| <button>Insert style tag</button> | ||
| </div> | ||
| </div> | ||
| <script type="module"> | ||
| import {upgradeElement} from '/dist/main.mjs'; | ||
| upgradeElement(document.getElementById('upgrade-me'), '/dist/worker/worker.mjs'); | ||
| </script> | ||
| <!-- This comment block is intended to make it easier to test both the script module and nomodule path --> | ||
| <!-- Comment either block to enable module/nomodule or disable it. --> | ||
| <!-- <script async=false defer> | ||
| document.addEventListener('DOMContentLoaded', function() { | ||
| MainThread.upgradeElement(document.getElementById('upgrade-me'), './dist/worker/worker.js'); | ||
| }, false); | ||
| </script> --> | ||
| </body> | ||
| </html> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| const btn = document.getElementsByTagName('button')[0]; | ||
|
|
||
| btn.addEventListener('click', async () => { | ||
| const style = document.createElement('style'); | ||
| style.textContent = `* { color: red !important }`; | ||
| document.body.appendChild(style); | ||
| }); |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.