Skip to content

Commit 2d1dd47

Browse files
committed
Status update - method visibility
1 parent 4d32d0f commit 2d1dd47

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

STATUS.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ if ( '<body>' !== $context || 'UTF-8' !== $encoding ) {
7373
3. Returns a fragment processor in the proper context
7474

7575
**How to enable table support:**
76-
1. `WP_HTML_Template` already uses an anonymous class extending `WP_HTML_Processor` to access private members
77-
2. The same pattern can expose `create_fragment_at_current_node()`
78-
3. Create full parser: `<!DOCTYPE html><table><tbody>`, navigate to `<tbody>`, call exposed method
79-
4. Fragment processor will be in IN_TABLE_BODY mode where `<tr>` and placeholders are valid
76+
1. Use `Closure::bind` to access `create_fragment_at_current_node()` without modifying `WP_HTML_Processor`
77+
2. Create full parser: `<!DOCTYPE html><table><tbody>`, navigate to `<tbody>`, call the private method via bound closure
78+
3. Fragment processor will be in IN_TABLE_BODY mode where `<tr>` and placeholders are valid
8079

8180
**Limitations that would remain:**
8281
- Cannot put arbitrary content (like `<div>`) inside table cells via placeholders (would trigger foster parenting)
@@ -96,6 +95,8 @@ Normalization runs twice: once in `compile()` for text detection, once in `rende
9695
**6. ~~Duplicate Attributes Bug with false/null Removal~~ FIXED**
9796
~~When using `false` or `null` to remove an attribute, only the first occurrence is removed. If the HTML contains duplicate attributes (e.g., `<input disabled="</%d>" disabled>`), the first `disabled` will be removed but the second will remain in the output.~~ Fixed by emitting removal edits for duplicate attributes during `compile()`. All duplicate attributes are now stripped as part of template compilation.
9897

98+
**Implementation note:** The fix currently accesses `$attributes` and `$duplicate_attributes` on `WP_HTML_Tag_Processor` via `protected` visibility. This should be refactored to use `Closure::bind` instead, allowing the Tag Processor changes to be reverted.
99+
99100
---
100101

101102
### Gaps in Test Coverage (From Test-Gaps.md + My Observations)
@@ -157,3 +158,9 @@ The ticket's philosophy is "prefer trust and safety over features"—valid, but
157158
| i18n integration || Not addressed |
158159
| RAWTEXT/RCDATA replacement || Placeholders don't work inside |
159160

161+
---
162+
163+
### Pending Work
164+
165+
1. **Revert Tag Processor visibility changes**`class-wp-html-tag-processor.php` has `$attributes` and `$duplicate_attributes` changed from `private` to `protected`. Revert these and use `Closure::bind` in `WP_HTML_Template` instead.
166+

0 commit comments

Comments
 (0)