Skip to content
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

html api/detect foreign content html5lib #4

Closed
wants to merge 14 commits into from

Conversation

sirreal
Copy link
Owner

@sirreal sirreal commented Feb 2, 2024

  • HTML API: Handle parsing changes in foreign content.
  • Implement via external settings.
  • Support scanning all tokens in the HTML Processor.
  • Update test which needs to now skip over text nodes.
  • WIP: Support elements in foreign content.
  • fixup! WIP: Support elements in foreign content.
  • Fix: store self-closing flag, not end-tag flag.
  • Update labels, collapse next_token() to step().
  • Fix math (not mathml) namespace
  • Fix ANNOTATION-XML tag name
  • html5lib-tests
  • (html5lib-tests) Add namespace getter
  • (html5lib-tests) Write namespace into test output
  • (html5lib-tests) Handle cdata nodes and more comments

Trac ticket:


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

dmsnell and others added 14 commits February 2, 2024 14:32
Squashed commit of the following:

commit 8f746ff
Author: Jon Surrell <[email protected]>
Date:   Fri Feb 2 11:53:22 2024 +0100

    var_export our token type

commit a3686fa
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 20:24:48 2024 +0100

    Fix lint

commit 82db117
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 19:08:23 2024 +0100

    Skip whitespace test

commit a3f9866
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 18:58:47 2024 +0100

    Throw on unhandled token types

commit 742afc9
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 17:53:01 2024 +0100

    Handle CDATA lookalike comment types

commit b137270
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 17:37:56 2024 +0100

    fix some test skipping

commit ba1036d
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 16:46:30 2024 +0100

    Add description to test class

commit 6a4967e
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 16:37:32 2024 +0100

    Expand README and add update instructions

commit c428e28
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 16:26:37 2024 +0100

    Replace $p with $processor

commit e4a4595
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 31 16:24:47 2024 +0100

    Fix void tag indenting

commit f5ad48c
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 19:29:24 2024 +0100

    Remove leading class body space

commit 0dc5dfc
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 16:43:06 2024 +0100

    Update skips

commit 18e3c5b
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 16:12:56 2024 +0100

    Skip all entities for now

commit e070d40
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 16:04:28 2024 +0100

    Better variable name

commit 1652f4a
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 15:04:08 2024 +0100

    Skip entities tests

    Decoding with PHP is buggy

commit d2a182e
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 14:57:35 2024 +0100

    Add much more HTML to tests

commit 79a2867
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 12:58:48 2024 +0100

    Remove comment test skip

commit 9bcc39b
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 12:55:35 2024 +0100

    Remove covers

commit 1bd74b2
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 30 12:55:27 2024 +0100

    Add todo comments

commit 8ebe418
Author: Jon Surrell <[email protected]>
Date:   Mon Jan 29 17:23:41 2024 +0100

    Update covers

commit ae9c1f9
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 23 17:35:41 2024 +0100

    Use DIR_TESTDATA

commit 34351ee
Author: Jon Surrell <[email protected]>
Date:   Sun Jan 21 21:12:25 2024 +0100

    Ignore another P tag test

commit a9c1d86
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 17 16:19:08 2024 +0100

    Add skip for known bug - all tests passing or skipped

commit bf011e4
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 17 16:15:05 2024 +0100

    Rename class and test function

commit 9ae1f51
Author: Jon Surrell <[email protected]>
Date:   Wed Jan 17 16:11:42 2024 +0100

    Fixing more lints

commit ab3a727
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 22:44:52 2024 +0100

    Clean up and refactor test document parsing

commit 7e65fcc
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 22:12:18 2024 +0100

    Add attributes to html5lib tests

commit 9ffa44a
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 15:08:26 2024 +0100

    Fix lint

commit d6c7334
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:37:06 2024 +0100

    Skip head tests

commit 95e52d9
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:31:22 2024 +0100

    Fix some comments

commit 864ed43
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:13:11 2024 +0100

    Fix strlen paren bug

commit a6ece6d
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:09:38 2024 +0100

    Fix lints

commit 9280fd8
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:09:31 2024 +0100

    Mark unsupported markup tests as incomplete, not skipped

commit 071b845
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:06:10 2024 +0100

    Skip incomplete token tests

commit 46102df
Author: Jon Surrell <[email protected]>
Date:   Tue Jan 16 14:01:29 2024 +0100

    Update ignores

commit fc56850
Author: Jon Surrell <[email protected]>
Date:   Mon Jan 15 21:35:50 2024 +0100

    Fix HTML input processing

commit 725cbbc
Author: Jon Surrell <[email protected]>
Date:   Mon Jan 15 19:05:22 2024 +0100

    Use padded line number

    Allows filetering like line0001 so not line1 line10 line11…

commit b35833c
Author: Jon Surrell <[email protected]>
Date:   Mon Jan 15 18:31:27 2024 +0100

    Use line numbers for test IDs

    Line numbers are stable even if we skip tests

commit 146fa7f
Author: Jon Surrell <[email protected]>
Date:   Fri Dec 22 17:38:19 2023 +0100

    Avoid running tests that expect anything in <head>

commit 215648c
Author: Dennis Snell <[email protected]>
Date:   Wed Dec 20 10:49:50 2023 -0600

    Add extra skipped tests

commit 47794b6
Author: Jon Surrell <[email protected]>
Date:   Wed Dec 20 13:22:07 2023 +0100

    Fix expect/actual ordering, add test message

commit 57095fc
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 20:20:26 2023 +0100

    Move test data to test data dir

commit 9d1ab0d
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 18:32:55 2023 +0100

    Add ignores for formatting elements

commit ffa71f1
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 18:25:56 2023 +0100

    Fix lint

commit 46564ce
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 18:16:09 2023 +0100

    Add files crediting html5lib-tests project

commit 860ab54
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 18:06:37 2023 +0100

    Add skipping of certain tests

commit 04d94ab
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 15:30:03 2023 +0100

    Remove space from test identifier, easier copy/paste filtering

commit 210e7ff
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 15:20:47 2023 +0100

    Better tag finding

commit 82a6e95
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 14:07:30 2023 +0100

    Print nicer tests names

commit 44a8369
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 13:59:21 2023 +0100

    Skip doctype and comments in test dom tree

commit 552c68e
Author: Jon Surrell <[email protected]>
Date:   Tue Dec 19 13:58:57 2023 +0100

    1-index test case numbering

commit 89191b8
Author: Dennis Snell <[email protected]>
Date:   Mon Dec 18 16:20:41 2023 -0600

    WPCS Nags

commit f2b7729
Author: Dennis Snell <[email protected]>
Date:   Mon Dec 18 15:57:53 2023 -0600

    Add line number to test case label

commit 8801e55
Author: Dennis Snell <[email protected]>
Date:   Mon Dec 18 15:23:47 2023 -0600

    Avoid WPCS lint nags; skip tests for unsupported input or fragment context.

commit e81776d
Author: Jon Surrell <[email protected]>
Date:   Mon Dec 18 21:38:12 2023 +0100

    Skip unhandled tests

commit 0c69dd8
Author: Jon Surrell <[email protected]>
Date:   Mon Dec 18 21:22:51 2023 +0100

    fix lints

commit 715ea11
Author: Jon Surrell <[email protected]>
Date:   Mon Dec 18 21:18:04 2023 +0100

    Move html5lib tests to new class

commit b109b45
Author: Jon Surrell <[email protected]>
Date:   Mon Dec 18 21:13:49 2023 +0100

    Remove git files from html5lib

commit f7e02c3
Author: Jon Surrell <[email protected]>
Date:   Mon Dec 18 20:26:12 2023 +0100

    Add test cases from html5lib-tests tree-construction
@sirreal sirreal force-pushed the html-api/detect-foreign-content-html5lib branch from c3ed1bc to 58b6fc0 Compare February 2, 2024 13:32
Copy link

github-actions bot commented Feb 2, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: dmsnell, jonsurrell.

GitHub Merge commits

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dmsnell <[email protected]>
Co-authored-by: sirreal <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@sirreal sirreal closed this Jul 4, 2024
@sirreal sirreal deleted the html-api/detect-foreign-content-html5lib branch August 1, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants