From ba5e663ccb1173ecf51854f565b555ea2c84c537 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 14 Aug 2019 11:19:39 -0700 Subject: [PATCH] Include amp-script among dynamic_element_selectors in tree shaking --- includes/sanitizers/class-amp-style-sanitizer.php | 1 + tests/php/test-amp-style-sanitizer.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/includes/sanitizers/class-amp-style-sanitizer.php b/includes/sanitizers/class-amp-style-sanitizer.php index 5887b9297b0..988c49424c4 100644 --- a/includes/sanitizers/class-amp-style-sanitizer.php +++ b/includes/sanitizers/class-amp-style-sanitizer.php @@ -103,6 +103,7 @@ class AMP_Style_Sanitizer extends AMP_Base_Sanitizer { 'amp-live-list', '[submit-error]', '[submit-success]', + 'amp-script', ], 'should_locate_sources' => false, 'parsed_cache_variant' => null, diff --git a/tests/php/test-amp-style-sanitizer.php b/tests/php/test-amp-style-sanitizer.php index 2cfe5e83271..cc73e6df098 100644 --- a/tests/php/test-amp-style-sanitizer.php +++ b/tests/php/test-amp-style-sanitizer.php @@ -339,10 +339,12 @@ public function get_link_and_style_test_data() { '', '', '', + '', '', '
', '', ' ', + 'The current server time is .', '', ] ), @@ -351,6 +353,7 @@ public function get_link_and_style_test_data() { 'amp-live-list li .highlighted{background:yellow}', '', 'body amp-list .portland{color:blue}', + 'amp-script .loaded{color:brown}', ], [], ],