From 6352f248f7bd1932793839f1ba02cbbdb5d1d05d Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 18 Dec 2023 20:33:00 +0000 Subject: [PATCH 01/22] Build/Test Tools: Add more context to artifact names. This adds a bit more context to the E2E workflow artifact names in order to avoid duplicates being uploaded. With the update to v4 of `actions/upload-artifact` in [57197], artifacts are now uploaded on a per job basis. Multiple jobs cannot upload the same artifact. Props johnbillion. See #59805. git-svn-id: https://develop.svn.wordpress.org/trunk@57203 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/end-to-end-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index 78903282315ef..25f37b5d4b046 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -131,7 +131,7 @@ jobs: uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 if: always() with: - name: failures-artifacts + name: failures-artifacts${{ matrix.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }} path: artifacts if-no-files-found: ignore From c78e3fbce4c8af24b8feff47e6f40f9f7873a7db Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 19 Dec 2023 13:10:35 +0000 Subject: [PATCH 02/22] Docs: Document the `$shortcode_tags` global in `wp_just_in_time_script_localization()`. Follow-up to [41395], [41844]. Props upadalavipul. See #60021. git-svn-id: https://develop.svn.wordpress.org/trunk@57204 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/script-loader.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index df2041f8651b4..8886cb587b170 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -1881,6 +1881,8 @@ function wp_prototype_before_jquery( $js_array ) { * These localizations require information that may not be loaded even by init. * * @since 2.5.0 + * + * @global array $shortcode_tags */ function wp_just_in_time_script_localization() { From 6184f269e596f21b14d6c244ef3e2d9016648707 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 18 Dec 2023 20:26:12 +0100 Subject: [PATCH 03/22] Add test cases from html5lib-tests tree-construction --- .../html-api/html5lib-tests/.gitattributes | 2 + .../.github/workflows/downstream.yml | 76 + .../html5lib-tests/.github/workflows/lint.yml | 25 + .../tree-construction/adoption01.dat | 354 +++ .../tree-construction/adoption02.dat | 39 + .../tree-construction/blocks.dat | 695 +++++ .../tree-construction/comments01.dat | 217 ++ .../tree-construction/doctype01.dat | 474 +++ .../tree-construction/domjs-unsafe.dat | Bin 0 -> 10356 bytes .../tree-construction/entities01.dat | 943 ++++++ .../tree-construction/entities02.dat | 309 ++ .../tree-construction/foreign-fragment.dat | 645 ++++ .../tree-construction/html5test-com.dat | 301 ++ .../tree-construction/inbody01.dat | 54 + .../tree-construction/isindex.dat | 49 + .../tree-construction/main-element.dat | 46 + .../html5lib-tests/tree-construction/math.dat | 104 + .../tree-construction/menuitem-element.dat | 240 ++ .../namespace-sensitivity.dat | 22 + .../tree-construction/noscript01.dat | 237 ++ ...pending-spec-changes-plain-text-unsafe.dat | Bin 0 -> 927 bytes .../pending-spec-changes.dat | 46 + .../tree-construction/plain-text-unsafe.dat | Bin 0 -> 9486 bytes .../tree-construction/quirks01.dat | 53 + .../html5lib-tests/tree-construction/ruby.dat | 302 ++ .../tree-construction/scriptdata01.dat | 372 +++ .../tree-construction/search-element.dat | 46 + .../html5lib-tests/tree-construction/svg.dat | 104 + .../tree-construction/tables01.dat | 322 ++ .../tree-construction/template.dat | 1673 +++++++++++ .../tree-construction/tests1.dat | 1956 +++++++++++++ .../tree-construction/tests10.dat | 849 ++++++ .../tree-construction/tests11.dat | 523 ++++ .../tree-construction/tests12.dat | 62 + .../tree-construction/tests14.dat | 75 + .../tree-construction/tests15.dat | 216 ++ .../tree-construction/tests16.dat | 2602 +++++++++++++++++ .../tree-construction/tests17.dat | 179 ++ .../tree-construction/tests18.dat | 558 ++++ .../tree-construction/tests19.dat | 1398 +++++++++ .../tree-construction/tests2.dat | 831 ++++++ .../tree-construction/tests20.dat | 842 ++++++ .../tree-construction/tests21.dat | 306 ++ .../tree-construction/tests22.dat | 190 ++ .../tree-construction/tests23.dat | 168 ++ .../tree-construction/tests24.dat | 79 + .../tree-construction/tests25.dat | 288 ++ .../tree-construction/tests26.dat | 453 +++ .../tree-construction/tests3.dat | 305 ++ .../tree-construction/tests4.dat | 74 + .../tree-construction/tests5.dat | 210 ++ .../tree-construction/tests6.dat | 663 +++++ .../tree-construction/tests7.dat | 453 +++ .../tree-construction/tests8.dat | 165 ++ .../tree-construction/tests9.dat | 472 +++ .../tree-construction/tests_innerHTML_1.dat | 843 ++++++ .../tree-construction/tricky01.dat | 336 +++ .../tree-construction/webkit01.dat | 785 +++++ .../tree-construction/webkit02.dat | 554 ++++ .../html-api/wpHtmlProcessorBreadcrumbs.php | 113 + 60 files changed, 24298 insertions(+) create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/.gitattributes create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/downstream.yml create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/lint.yml create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/adoption01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/adoption02.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/blocks.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/comments01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/doctype01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/domjs-unsafe.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/entities01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/entities02.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/foreign-fragment.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/html5test-com.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/inbody01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/isindex.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/main-element.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/math.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/menuitem-element.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/namespace-sensitivity.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/noscript01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/pending-spec-changes-plain-text-unsafe.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/pending-spec-changes.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/plain-text-unsafe.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/quirks01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/ruby.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/scriptdata01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/search-element.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/svg.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tables01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/template.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests1.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests10.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests11.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests12.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests14.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests15.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests16.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests17.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests18.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests19.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests2.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests20.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests21.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests22.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests23.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests24.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests25.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests26.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests3.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests4.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests5.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests6.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests7.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests8.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests9.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tests_innerHTML_1.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/tricky01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/webkit01.dat create mode 100644 tests/phpunit/tests/html-api/html5lib-tests/tree-construction/webkit02.dat diff --git a/tests/phpunit/tests/html-api/html5lib-tests/.gitattributes b/tests/phpunit/tests/html-api/html5lib-tests/.gitattributes new file mode 100644 index 0000000000000..897831b2e58d8 --- /dev/null +++ b/tests/phpunit/tests/html-api/html5lib-tests/.gitattributes @@ -0,0 +1,2 @@ +*.dat -text diff +*.test -text diff diff --git a/tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/downstream.yml b/tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/downstream.yml new file mode 100644 index 0000000000000..59f121f0d487e --- /dev/null +++ b/tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/downstream.yml @@ -0,0 +1,76 @@ +name: downstream + +concurrency: + group: "${{github.workflow}}-${{github.ref}}" + cancel-in-progress: true + +on: + workflow_dispatch: + push: + branches: + - master + pull_request: + types: [opened, synchronize] + branches: + - '*' + +jobs: + skeleton: + runs-on: ubuntu-latest + steps: + - run: echo hello world + + parse5: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + repository: inikulin/parse5 + submodules: recursive + - run: rm -rf test/data/html5lib-tests/ + - uses: actions/checkout@v2 + with: + path: test/data/html5lib-tests/ + - uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: npm + - run: npm ci + - run: npm run build --if-present + - run: npm run unit-tests + + html5gum: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + repository: untitaker/html5gum + - run: rm -rf tests/html5lib-tests/ + - uses: actions/checkout@v2 + with: + path: tests/html5lib-tests/ + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: cargo test + + nokogiri: + runs-on: ubuntu-latest + container: + image: ghcr.io/sparklemotion/nokogiri-test:mri-3.2 + steps: + - uses: actions/checkout@v3 + with: + repository: sparklemotion/nokogiri + path: nokogiri + - uses: actions/checkout@v3 + with: + path: nokogiri/test/html5lib-tests + - working-directory: nokogiri + name: "Run the Nokogiri test suite" + run: | + bundle install + bundle exec rake compile -- --enable-system-libraries + bundle exec rake test diff --git a/tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/lint.yml b/tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/lint.yml new file mode 100644 index 0000000000000..99f67c50e3178 --- /dev/null +++ b/tests/phpunit/tests/html-api/html5lib-tests/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: lint + +concurrency: + group: "${{github.workflow}}-${{github.ref}}" + cancel-in-progress: true + +on: + workflow_dispatch: + push: + branches: + - master + pull_request: + types: [opened, synchronize] + branches: + - '*' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - run: ./lint diff --git a/tests/phpunit/tests/html-api/html5lib-tests/tree-construction/adoption01.dat b/tests/phpunit/tests/html-api/html5lib-tests/tree-construction/adoption01.dat new file mode 100644 index 0000000000000..38f98efded0ae --- /dev/null +++ b/tests/phpunit/tests/html-api/html5lib-tests/tree-construction/adoption01.dat @@ -0,0 +1,354 @@ +#data +

+#errors +(1,3): expected-doctype-but-got-start-tag +(1,10): adoption-agency-1.3 +#document +| +| +| +| +|

+| + +#data +1

23

+#errors +(1,3): expected-doctype-but-got-start-tag +(1,12): adoption-agency-1.3 +#document +| +| +| +| +| "1" +|

+| +| "2" +| "3" + +#data +1 +#errors +(1,3): expected-doctype-but-got-start-tag +(1,17): adoption-agency-1.3 +#document +| +| +| +| +| "1" +|