-
Notifications
You must be signed in to change notification settings - Fork 384
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
1094: Transform CSS selectors according to sanitizer HTML element to AMP component conversions #1175
Merged
Merged
1094: Transform CSS selectors according to sanitizer HTML element to AMP component conversions #1175
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e530045
Initial take on CSS selector conversions according to AMP.
miina f2395ee
Add @todo note.
miina 958fd48
Add @todo note.
miina 488ebd2
Merge remote-tracking branch 'origin/develop' into add/1094-convert_c…
miina 077a094
Add additional mappings.
miina ed1cc03
Merge branch 'develop' of https://github.com/Automattic/amp-wp into a…
westonruter 6091533
Merge remote-tracking branch 'origin/develop' into add/1094-convert_c…
miina 7a218aa
Add get_selector_conversion_mapping method to all sanitizers and util…
westonruter fcc0b44
Merge branch 'add/1094-convert_css_selectors' of github.com:Automatti…
miina d815891
Refactor code.
miina 12c9ff8
Use tree-shaking in test_amp_selector_conversion
westonruter 91e3eef
Include selector mappings in dynamic_element_selectors to preserve se…
westonruter 04f6b85
Preserve original pb_feed class on translated amp-playbuzz elements
westonruter 19db2c1
Allow tree shaking on selectors with dynamic elements when non-dynami…
westonruter 1b8405a
Stop replacing CSS selectors which are addressing AMP components dire…
miina 592aca7
Merge branch 'add/1094-convert_css_selectors' of github.com:Automatti…
miina a564410
Fix tests.
miina 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 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.
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.
@westonruter Started adding the logic within this method since it seemed to be related with tree shaking in terms of adding/not adding the selector if it's not found after replacing. That's still WIP (e.g. currently works only in case
! $should_tree_shake
and is missing most of the mappings) but let me know if there are any concerns with this approach.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.
Hmm, maybe one potential issue could be that the size of the style could exceed the limit if doing the replacement here.
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.
Moving the logic to
process_css_declaration_block
to avoid issues with style size changing after the size check.