Repository navigation
blitz, taffy, core: clip-path hit testing, inline margins, 3D transforms, floated insets, <select> sizing, and block-in-inline - #209
Open
BernardoPe wants to merge 8 commits into
Conversation
BernardoPe
requested review from
LuisDuarte1,
celso,
jonnyparris and
ruifigueira
as code owners
November 23, 2026 12:24
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
from
November 23, 2026 12:48
7a3cc3a to
c8264c8
Compare
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
3 times, most recently
from
November 23, 2026 14:13
42568cc to
21b59a7
Compare
ruifigueira
reviewed
Nov 24, 2026
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
from
November 24, 2026 20:59
21b59a7 to
5a8dc68
Compare
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
2 times, most recently
from
November 24, 2026 22:50
a9340c2 to
4625491
Compare
ruifigueira
approved these changes
Nov 25, 2026
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
from
November 25, 2026 22:16
4625491 to
e877ec7
Compare
ruifigueira
approved these changes
Nov 25, 2026
ruifigueira
left a comment
Collaborator
There was a problem hiding this comment.
beep-boop-rui-agent-🤖
The blocking findings are fixed. Approving.
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
from
November 26, 2026 12:18
e877ec7 to
cb28526
Compare
ruifigueira
reviewed
Nov 27, 2026
A box that clips its overflow must not widen the document, while still keeping its own hidden content reachable. The simple case already behaves (taffy's scrollable-overflow contribution is clipped for a scroll container), so this test pins it: a 2000px child inside a 375px overflow:hidden panel leaves the document at zero scroll width and the panel with its 1625px of scroll. The panel's scroll width is read through read_scroll_info, so its field is now crate-visible. Rust files are reformatted with the pinned toolchain's edition 2021, which is what the fmt gate checks. Signed-off-by: bpereira <bpereira@cloudflare.com>
Hit testing ignored `clip-path`, so visually clipped regions of an element still intercepted pointer events instead of passing them through to underlying controls. Check basic shapes (`inset`, `circle`, `ellipse`, `polygon`) in local border-box coordinates during hit testing, treating unsupported shapes as covering so an unimplemented clip never makes an element unhittable. https://drafts.fxtf.org/css-masking-1/#the-clip-path Signed-off-by: bpereira <bpereira@cloudflare.com>
Parley lays inline text out without the margins of the boxes it runs through, so `margin-left`/`margin-right` on a non-replaced inline box had no effect: text stayed where it would sit with no margin, and following siblings did not shift. The inline layout now records, per line and node, the inline-start offset that preceding non-replaced inline boxes' horizontal margins add, skipping the inline root and any non-inline box. Paint, fragment geometry, and atomic inline positions all apply that offset so painted text, client rects, and hit testing agree. https://drafts.csswg.org/css2/#inline-box-dimensions Signed-off-by: bpereira <bpereira@cloudflare.com>
A transform list that mentioned any 3d function was dropped, so `rotateX(45deg)`, `rotateY(50deg)` and `matrix3d(...)` left the box untransformed: on Squarespace the navigation overlay's `matrix3d` did not move its bounds, so the Resources button was hit-tested where the overlay's untransformed top edge sat and the menu never switched panels. Outside a 3d rendering context the transform still applies as a painting effect, and without perspective the z = 0 plane projects to exactly the 2d affine part of the matrix. A 20px box with `rotateX(45deg)` projects to 14.142px tall at y = 2.929; a matrix with perspective is still dropped because its projection is projective, not affine. https://drafts.csswg.org/css-transforms-2/#3d-transform-rendering https://drafts.csswg.org/css-transforms-2/#two-dimensional-subset Signed-off-by: bpereira <bpereira@cloudflare.com>
A floated box with `position: relative` was placed in the float context and committed without applying its `left`/`right`/`top`/`bottom` insets, so push/pull float grid columns (e.g. `float: left; position: relative; left: 50%` on jquery.com) stayed in their unshifted order. Apply relative insets to block-context floats after `place_floated_box`, so surrounding floats and content still flow around the unshifted float box per CSS2 §9.4.3. https://drafts.csswg.org/css2/#relative-positioning Signed-off-by: bpereira <bpereira@cloudflare.com>
A block-level box nested inside an inline formatting context (such as
`a::before { content: ""; display: block; height: 20px }` on ohsu.edu) was
measured as a shrink-to-fit inline box of width 0, keeping it on the same line
as following inline text instead of occupying its own line.
Stretch in-flow `DisplayOutside::Block` inline boxes with `width: auto` to the
available line width minus margins so they occupy their own line and push
following inline content onto the next line per CSS2 §9.2.1.1 / §10.3.3.
https://drafts.csswg.org/css2/#anonymous-block-level
Signed-off-by: bpereira <bpereira@cloudflare.com>
…lip-path hit testing Store inline horizontal margin offsets per positioned item index (line_item_offsets: Vec<Vec<f32>>) instead of per NodeId so trailing text after a margin-shifted span shifts cleanly without overlap, wrapped spans apply start margin only on their first fragment and end margin only on their last, percentage margins resolve against content_box_width(), and compute_inline_margin_offsets runs in O(items + distinct nodes) only when committing positions. Populate line_item_offsets inside rebuild_evicted_layout so evicted paragraphs match non-evicted geometry and paint, shift span background and border fragment decorations in blitz-paint, and undo item shifts in text_offset_at_point for caret/selection placement. Evaluate clip-path hit-testing after the bounding-box prune in unscrolled border-box space (applying inverse transform before scroll offset), and use axis-specific radii for ellipse() closest-side/farthest-side. Signed-off-by: bpereira <bpereira@cloudflare.com>
Stretch an auto-width block-level box inside an inline formatting context only when the inline root's own width is definite. A shrink-to-fit container (inline-block, float, abspos) measures its content under a definite available width without a known width of its own, so stretching there reported the available width as the pseudo's max-content contribution and made the container fill the line. Carry horizontal inline margins as zero-height Parley inline-box spacers placed outside the element's style span. Parley now charges them to line breaking, alignment and glyph positions, so wrapped and right-aligned lines stay inside the box and span fragments cover the text they belong to. Remove the post-layout per-item offset machinery from blitz-dom, blitz-paint and the geometry walk. Evict a root whose only inline boxes are margin spacers without a break summary. Parley cannot summarize in-flow boxes, so the root rebuilds on first access instead of keeping its shaped text resident. Add layout and paint tests for the block pseudo shrink-to-fit cases, the 240px wrap and right-align repros, and the two span background cases. Signed-off-by: Bernardo Pereira <bpereira@cloudflare.com>
BernardoPe
force-pushed
the
bpereira/compat-blitz-layout-transforms
branch
from
November 27, 2026 19:55
1682d5b to
906b63d
Compare
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.
Part 4 of 5 in a stacked compatibility series (stacked on #208).
Changes
clip-pathhit testing (blitz-dompatch0100): Exclude points outside basicclip-pathshapes (inset,circle,ellipse,polygon) from hit testing so visually clipped overlays do not intercept clicks on underlying controls (p5js.org, ox.ac.uk, redis.io/docs).blitz-dompatch0101,blitz-paintpatch0036,core/src/layout/geometry.rs): Record per-line, per-node inline-start offsets insideBuilt(preservingTextLayout <= 44bytes) and apply them consistently in paint, fragment geometry, and atomic inline box placement (carbon.now.sh).blitz-dompatch0102): Project 3D transforms without perspective (m14 == m24 == 0, m44 == 1) onto the z = 0 plane via their 2D affine part per CSS Transforms 2, while keeping perspective transforms dropped with a TODO (fixesmatrix3dmenu hit-testing on squarespace.com).taffypatch0013): Applyposition: relativeleft/right/top/bottominsets afterplace_floated_boxso push/pull float grids shift visually while surrounding floats still flow around the unshifted box per CSS2 §9.4.3 (jquery.com).<select>UA inline-block box (blitz-dompatch0103,core/src/dom/inner_text.rs): Giveselectdisplay: inline-block; box-sizing: border-box;indefault.cssso authorwidthandheightapply even when options are hidden or empty (gov.uk, blogger.com, amazon.co.jp, mozilla.com), while keeping<select>out ofinnerText's atomic-inline isolation.blitz-dompatch0104): Stretch in-flowDisplayOutside::Blockboxes withwidth: autoinside inline contexts to the available line width minus margins soa::before { display: block }occupies its own line per CSS2 §9.2.1.1 (ohsu.edu).core/src/layout/tests/clipped_scroll_width.rs).Verification
packages/core/src/layout/tests/clipped_scroll_width.rspackages/core/src/layout/tests/hit_test_clipped.rspackages/core/src/layout/tests/inline_margins.rspackages/core/src/layout/tests/transform_2d_subset.rspackages/core/src/layout/tests/float_relative_insets.rspackages/core/src/layout/tests/select_sizing.rspackages/core/src/layout/tests/block_pseudo_in_inline.rs