Repository navigation
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.
Fixes #5216.
What
AuthorStylesheetProjectoremits a bridge rule for every source rule that targets an image:….wp-block-image > img{…;border-radius:inherit}. The bridge is right when the image's class moved onto the generated figure, because then the source rule paints the figure and the image follows it. It is wrong when the rule's subject is a bareimg(.avatar img,.card > img). In that case nothing moves to the figure, the source rule still paints the image itself, and the bridge overrides the image's own radius with the figure's0at the same specificity, later in the cascade. The result is round avatars imported as squares.The bridge now omits
border-radius:inheritfor selectors whose subject compound is a bareimg. In a mixed list (.photo, .avatar img), only the moved arms keep the inherit, in a separate rule at the same cascade position.Evidence
I compiled each case with
ArtifactCompilerand measured the computed radius of the renderedimgin Chromium:.photo{border-radius:50%}on<img class="photo">(class moves to the figure)img.round{…}.avatar img{border-radius:50%}@mediarule for.avatar img.avatar img{border-top-left-radius:50%}.photo, .avatar img{…}, both images.card{border-radius:20px;overflow:hidden}around a bare imageAn earlier attempt removed the bridge's
border-radius:inheritoutright. That fixed the third row and broke the first, which is why the first row stays in the test.Test
There is a new table-driven case in
tests/unit/artifact-author-stylesheet-projection.php. It resolves each image'sborder-radiuswithStaticCssCascade, followinginheritto the figure, and covers the moved class, the descendant subject, the later breakpoint rule and the mixed list. On trunk it fails for the descendant subject, the later breakpoint rule and the mixed list; the moved-class row guards against the earlier regression.StaticCssCascadedoes not expand radius shorthands, so the longhand row is covered by the browser check above only.The full
composer testsuite passes (1314 tests).This PR was finished outside Homeboy: Cook could not admit the task, failing in Lab admission before the provider ran. The fix, test and verification were written by Franklin (Claude, an Anthropic model, via the Pi coding agent and Roadie). A human (@chubes4) directed the work.