generated from oddbird/polyfill-template
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Enable manual polyfill #256
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 all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c2a3f25
allow polyfilling a single style element
marchbox 8eeb7a8
remove unnecessary import
marchbox fe5389c
make polyfill options more flexible and allow a list of target elements
marchbox a58268f
simplify element list type
marchbox c0ceb70
add demo for imperative polyfill
marchbox dc5e6d4
remove unnecessary variable
marchbox 96f825a
remove unnecessary variable
marchbox 24df34b
remove unnecessary promise
marchbox 0cfd3a4
fix edge
marchbox 3b63415
add tests for fetch
marchbox 52bc1a6
add e2e tests
marchbox 7be5e54
add comment to clarify backward compatibility concern
marchbox c97ae3e
fix linting issues
marchbox bbadbae
use array filter for better readability
marchbox 4f75075
centralize elements option type check
marchbox 73259da
rename imperative to manual
marchbox d00ab88
load css dynamically for manual polyfill demo in supported browsers
marchbox 912c553
add test coverage for polyfilling multiple sets of elements
marchbox 798561f
support automatic inline style polyfill with manual polyfill
marchbox e921c41
fix linting issues
marchbox e5befac
attempt to deflake test
marchbox 167b030
change includeInlineStyles option to excludeInlineStyles
marchbox ef0b87d
update based on feedback
marchbox 202d17b
fix linting issues
marchbox 00e1a44
support global options
marchbox 9919720
fix linting issues
marchbox 1628931
simplify code for better readability
marchbox 63c1bcb
Merge branch 'oddbird:main' into add-to-polyfill
marchbox b4915fa
fix unit tests
marchbox 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
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,5 @@ | ||
#my-target-manual-link-el { | ||
position: absolute; | ||
bottom: anchor(--my-anchor-manual top); | ||
left: anchor(--my-anchor-manual right); | ||
} |
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 |
---|---|---|
@@ -1,8 +1,26 @@ | ||
export {}; | ||
|
||
declare global { | ||
interface AnchorPositioningPolyfillOptions { | ||
// Whether to use `requestAnimationFrame()` when updating target elements’ | ||
// positions | ||
useAnimationFrame?: boolean; | ||
|
||
// An array of explicitly targeted elements to polyfill | ||
elements?: HTMLElement[]; | ||
|
||
// Whether to exclude elements with eligible inline styles. When not defined | ||
// or set to `false`, the polyfill will be applied to all elements that have | ||
// eligible inline styles, regardless of whether the `elements` option is | ||
// defined. When set to `true`, elements with eligible inline styles listed | ||
// in the `elements` option will still be polyfilled, but no other elements | ||
// in the document will be implicitly polyfilled. | ||
excludeInlineStyles?: boolean; | ||
} | ||
|
||
interface Window { | ||
UPDATE_ANCHOR_ON_ANIMATION_FRAME?: boolean; | ||
ANCHOR_POSITIONING_POLYFILL_OPTIONS?: AnchorPositioningPolyfillOptions; | ||
CHECK_LAYOUT_DELAY?: boolean; | ||
} | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.