fix(php-transformer): preserve inherited border-box resets - #1658
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserves the common
html{box-sizing:border-box} *,*::before,*::after{box-sizing:inherit}reset when projecting CSS into native WordPress blocks, and retains linked SVG-only logos as materialized image blocks.Border-Box Root
php-transformer/src/HtmlToBlocks/Style/AuthorStyleRuleProjector.php:authorStylesUseUniversalBorderBoxReset()*{box-sizing:border-box}, then injectedbox-sizing:content-boxon generated Groups despite an inherited root reset.Linked SVG-Only Logo Root
HtmlCompilation::isLinkedSvgLogoAnchor()previously required the wrapper anchor itself to carry a logo/brand token. An unlabelled link around a descendant.logocontaining only inline SVG returnednullbefore its child could be converted, omitting the header artwork.LogoPatternalso rejected SVG-only logo content because its text content was empty.core/imageresolve against its sized figure rather than its shrink-to-fit link wrapper.#525); this closes the remaining wrapper-signal case rather than duplicating it.Public Reproducer
php-transformer/tests/unit/artifact-author-stylesheet-projection.phpcovers a root + universal inherited border-box reset with a width-and-padding Group.php-transformer/tests/unit/author-selector-semantics.phpcovers an unlabelled link wrapping a descendant.brand-logowith awidth="100%" height="100%"inline SVG.Verification
php tests/contract/run.phpphp tests/unit/author-selector-semantics.phpphp tests/unit/artifact-author-stylesheet-projection.phpphp tests/unit/engine-support-css-specificity.phpphp -l src/HtmlToBlocks/HtmlCompilation.phpphp -l src/HtmlToBlocks/Patterns/LogoPattern.phpphp -l src/HtmlToBlocks/Support/SvgMaterializer.phpstatic-site-importer importcandidate browser proof at 1440x900 and 390x844: header SVG now materializes and loads200at227.7x30; footer SVG asset also loads200at227.7x30. Candidate document widths are exactly1440and390, confirming no horizontal overflow after the inherited border-box fix. The footer is atx=-114on mobile in both source and candidate, so that clipping is source-authored, not a transformation regression.AI assistance: openai/gpt-5.6-terra via OpenCode was used to diagnose browser DOM/CSS behavior and implement the fix.