Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
68a6b4a
HTML API: Add support for SVG and MathML (Foreign content)
dmsnell Jul 30, 2024
85df3a3
Update test runner
dmsnell Jul 30, 2024
47f60fe
Lower-case tag names for foreign content in test runner.
dmsnell Jul 30, 2024
c216604
Use the namespace-adjusted tag name in tests.
dmsnell Jul 30, 2024
758d5b5
Merge branch 'trunk' into html-api/detect-foreign-content
dmsnell Jul 31, 2024
83db8f0
Various updates and changes. Currently experiencing infinite loops.
dmsnell Jul 31, 2024
0cdf0da
Prevent infinite loop.
dmsnell Jul 31, 2024
f9ac6d7
Check namespace against actual token, not Tag Processor state.
dmsnell Aug 1, 2024
c753249
Provide method for getting adjusted attribute names, and update testi…
dmsnell Aug 1, 2024
5bb9eb1
HTML5Lib: Prevent printing empty text nodes in tree
sirreal Aug 1, 2024
974c45a
phpcs fix
sirreal Aug 1, 2024
56ba291
Closing BR can occur outside of the HTML namespace.
dmsnell Aug 1, 2024
047825b
Fix an issue with mathml integration point check
sirreal Aug 5, 2024
28816c7
Change parsing namespace in push/pop handlers
sirreal Aug 5, 2024
3eb0654
Check for namespace in expects_closer atomic elements
sirreal Aug 5, 2024
5a64823
Use insert_foreign_element to insert foreign elements
sirreal Aug 5, 2024
31801d6
Do not report foreign content self-closing tags as closers
sirreal Aug 6, 2024
f66ba57
Fix typo in femorphology tag name
sirreal Aug 6, 2024
efbf5ef
Merge branch 'trunk' into html-api/detect-foreign-content
sirreal Aug 7, 2024
32c25d5
Fix svg:TEMPLATE handling in html5lib tests
sirreal Aug 7, 2024
9e0b884
Fix HTML5lib-test handling of self-closing tags
sirreal Aug 7, 2024
71cd1b2
Only transform attributes outside of html namespace
sirreal Aug 6, 2024
2a3f6cb
Use get_namespace() over parsing_namespace
sirreal Aug 6, 2024
0f94dcb
Use get_adjusted_current_node when getting namespace
sirreal Aug 6, 2024
e90fbc3
Fix adjusted_current_node to check _element_ nodes
sirreal Aug 6, 2024
00f9b68
More passing FC tests
sirreal Aug 6, 2024
58be2d8
Do not need to worry about those elements after all
sirreal Aug 7, 2024
9a83dc7
Move namespace handling into insert_foriegn_element
sirreal Aug 7, 2024
e004603
Handle namespace mucking inside "insert_foreign_element"
sirreal Aug 7, 2024
641e678
Revert "Handle namespace mucking inside "insert_foreign_element""
sirreal Aug 7, 2024
c944b1b
Revert "Move namespace handling into insert_foriegn_element"
sirreal Aug 7, 2024
0056d2f
Revert irrelevant change
sirreal Aug 7, 2024
781df79
Reapply "Move namespace handling into insert_foriegn_element"
sirreal Aug 7, 2024
64e3e5d
Reapply "Handle namespace mucking inside "insert_foreign_element""
sirreal Aug 7, 2024
4e6407e
Only insert foreign elements when handling foreign content
sirreal Aug 7, 2024
ce86164
Do not change the namespace to the integration node type
sirreal Aug 7, 2024
6afdbe6
Update comments, reorder `try`, support SCRIPT tags.
dmsnell Aug 8, 2024
a1e48e3
Revert change to BR closing tag behavior.
dmsnell Aug 8, 2024
8f01a18
Rename "namespaced" tag/attribute name getters to "get_qualified_...()"
dmsnell Aug 8, 2024
2016cc4
WPCS
dmsnell Aug 8, 2024
657df3b
New TODO ear-marking a logic review.
dmsnell Aug 8, 2024
57e8670
Move the foreign content other end tag label into condition
sirreal Aug 8, 2024
38aab38
Merge remote-tracking branch 'upstream/trunk' into html-api/detect-fo…
dmsnell Aug 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reapply "Handle namespace mucking inside "insert_foreign_element""
This reverts commit 641e678.
  • Loading branch information
sirreal committed Aug 7, 2024
commit 64e3e5d739f15ab193627497b86db2d9357affe0
12 changes: 5 additions & 7 deletions src/wp-includes/html-api/class-wp-html-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4110,7 +4110,6 @@ private function step_in_foreign_content(): bool {
$op = '+FONT with attributes';
}

$adjusted_current_node = $this->get_adjusted_current_node();
switch ( $op ) {
case '#text':
/*
Expand Down Expand Up @@ -5445,13 +5444,12 @@ private function insert_html_element( WP_HTML_Token $token ): void {
*
* @see https://html.spec.whatwg.org/#insert-a-foreign-element
*
* @param WP_HTML_Token &$token Insert this token. The token will be
* modified to update its namespace and
* insertion point correctly.
* @param bool $only_add_to_element_stack Whether to skip the "insert an element at the adjusted
* insertion location" algorithm when adding this element.
* @param WP_HTML_Token $token Insert this token. The token's namespace and
* insertion point will be updated correctly.
* @param bool $only_add_to_element_stack Whether to skip the "insert an element at the adjusted
* insertion location" algorithm when adding this element.
*/
private function insert_foreign_element( WP_HTML_Token &$token, bool $only_add_to_element_stack ): void {
private function insert_foreign_element( WP_HTML_Token $token, bool $only_add_to_element_stack ): void {
$adjusted_current_node = $this->get_adjusted_current_node();

$namespace = $adjusted_current_node ? $adjusted_current_node->namespace : $this->get_namespace();
Expand Down