Skip to content

Convert empty background-only custom elements like the equivalent div - #3551

Merged
chubes4 merged 3 commits into
trunkfrom
fix/issue-2613-blocks-engine
Oct 27, 2026
Merged

chubes4 merged 3 commits into
trunkfrom
fix/issue-2613-blocks-engine

Conversation

@chubes4

@chubes4 chubes4 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Empty background-only custom elements convert natively without losing tiled textures. Merged current trunk without rewriting PR history, preserving #3555’s repeating-background behavior. The new assertion fails on the pre-#3555 PR head and passes after merging.

What changed

  • Preserved both the custom-element conversion and trunk’s background-group lowering.
  • Added an absolutely positioned x-tile regression requiring zero fallbacks and no image block.
  • Asserted exactly one background group owns tile.png with repeat and auto sizing.
  • Kept non-repeating image coverage and existing guard cases passing.
  • Additive. Existing conversion guards remain unchanged; repeating backgrounds retain their tiling. The full suite passes with a shorter temporary directory required by Chrome’s socket-path limit.

Verification

  • passed on 25d25df. Base trunk@30776ce advanced to 20945b1.
set -e
cd php-transformer
(test -d vendor || composer install --no-progress --no-interaction)
( while sleep 60; do echo "gate heartbeat: composer test still running"; done ) &
hb=$!
trap 'kill $hb 2>/dev/null || true' EXIT
composer test
  • CI: pending
Cook run
  • Gate 1: tree 7ff97bc1370e40914522da171679c7bc24a96a2a, fingerprint bde6c581b51f68ddbb229c4de1d3a769b7f6a6119dacceef78f0e59fe4f4e867

AI assistance

Tool: Homeboy (pi) · Model: gpt-6.1-sol (tier roadie/cook-heavy) · Used for: AI reviewed the linked discussions, merged trunk, added regression coverage, and verified before/after behavior and the full suite.

Relates to #3551

@chubes4

chubes4 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Review: the code is clean and the guards hold, but the converted output does not render like the source. Holding this until #3552 lands.

I imported the reduced page with this branch (SSI dev package with BE 30776cee) using a real 40×40 checker tile.png, then measured with Playwright at 800px:

Painted element Box Tiling
Source x-tile background 800×206 repeat
This PR <img src=tile.png> 40×40 at top-left none

The fallback is gone and the quality gate passes, but the section's tiled texture shrinks to one tile. The div control behaves the same way on released SSI 1.33.156, so the root cause is upstream of this PR: backgroundImageBlockFromElement() ignores background-repeat. Filed as #3552.

Once #3552 keeps repeating layers as backgrounds, rebase this PR and extend the test to assert the repeat survives (not just wp:image + tile.png). The wp:image assertion here locks in the lossy shape.


AI disclosure: review by Claude (Opus) via Roadie/Pi, with an import and Playwright measurement, under Chris Huber's direction.

@chubes4

chubes4 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Updated against trunk (now includes #3555, the fix for #3552).

  • Merged origin/trunk into the branch (440d445e76). The PR diff is back to its own 6 files; Homeboy's rework publish had flattened trunk into one commit (Extra-Chill/homeboy issue filed).
  • New case in tests/unit/background-paint-custom-element.php: an empty <x-tile> with background-repeat:repeat checks for 0 fallbacks, no core/image, and exactly one core/group with backgroundRepeat: repeat and backgroundSize: auto. The original image-path case now uses no-repeat, so it still tests what its name says.
  • composer test (php-transformer) passes locally.
  • Real render: SSI dev package built on 440d445e76, then imported the reduced x-tile page with a real 40×40 checker tile. Quality gate pass, 0 fallbacks. The tile layer is an 800×206 box with background-repeat: repeat and background-size: auto, the same as the div control. This clears the earlier hold.

AI disclosure: Claude (Opus) via Roadie/Pi reviewed, merged trunk, and verified this under Chris Huber's direction; the test was written by a Homeboy cook (gpt-6.1-sol).

@chubes4
chubes4 merged commit e61f894 into trunk Oct 27, 2026
15 checks passed
@chubes4
chubes4 deleted the fix/issue-2613-blocks-engine branch October 27, 2026 03:37
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.

1 participant