diff --git a/php-transformer/docs/contracts/box-tree.md b/php-transformer/docs/contracts/box-tree.md index 28ced6c59..7391bcf11 100644 --- a/php-transformer/docs/contracts/box-tree.md +++ b/php-transformer/docs/contracts/box-tree.md @@ -12,7 +12,7 @@ Write one `box-tree/.json` artifact file for each captured route. Set SHA-256 of its final UTF-8 bytes (including node attributes). Declare large sidecars in the artifact `reports` list to use capture-report byte budgets. The reader also applies a hard 32 MiB decoded sidecar limit, 100,000 nodes, -2–8 viewports, viewport dimensions of 1–32,768 CSS pixels, geometry bounded +1–8 viewports, viewport dimensions of 1–32,768 CSS pixels, geometry bounded by 100,000,000 CSS pixels, and 4,096 bytes per used style string. Every element, including `html`, `head` and non-rendering elements, must carry @@ -23,7 +23,7 @@ all observations. Do not regenerate IDs after resizing; a genuinely different DOM needs its own document/hash. Include zero-sized boxes for non-rendering elements. No IDs are synthesized by the transformer. -The sidecar has `viewports` keyed by name (required: `desktop`, `mobile`), each +The sidecar has `viewports` keyed by the names served by that document, each with integer `width` and `height`, and `nodes` keyed by node ID. Each node has: - `children`: immediate element child IDs in DOM order (no text/comment IDs); @@ -35,6 +35,11 @@ Use computed/used values, not authored declarations; explicit strings such as `none`, `normal`, `auto` and `0px` are significant. Physical longhands cover padding, margin, border and overflow; the schema lists flex/grid container and item properties, paint/compositing properties, and sizing min/max values. +Background and mask evidence uses `background-color`, `background-image`, +`mask-image`, and `mask-mode`, not the `background` or `mask` shorthands; there +are no shorthand aliases. A desktop document served separately from +`html-mobile/…` needs only its desktop observation. Every declared viewport +still requires an observation on every node. Producers must update in lockstep. ## Transformer behavior @@ -64,7 +69,7 @@ is not a claim that a live capture pipeline has been implemented here. `source_reports.box_tree[route].classification` contains `counts` keyed by `load-bearing` and `neutral`, and `nodes` keyed by source ID with `disposition` -and the deciding `criterion`. Criteria are `paints`, `multi-child-layout`, +and the deciding `criterion`. Criteria are `paints`, `clips`, `multi-child-layout`, `containing-block`, `semantics/id/anchor`, `interaction/state`, `motion`, and `own-sizing`; neutral nodes have `equal-child-geometry`. Precedence follows that order. Neutrality requires one element child, no direct non-whitespace text, and @@ -72,6 +77,12 @@ matching x/y/width/height at **every** viewport (0.01 CSS pixel tolerance). Containing-block ownership is resolved separately at each viewport, including transformed ancestors of fixed descendants. These are reports, not collapse instructions; converted blocks and author styles are unchanged. +Transparent background colors (including zero-alpha rgba and color() values) +and image-free masks do not paint. Identity transforms do not paint, but still +establish containing blocks. Overflow is `clips` only when a descendant extends +past the observed box on a clipped axis. IDs alone do not preserve wrappers: +fragment hrefs, ARIA ID references, and label `for` references do. Captured +interaction targets are preserved through their node's `interaction_states`. The v1 evidence shape additionally accepts optional used-style strings `animation-name`, `transition-property`, and `transition-duration`. Producers @@ -82,10 +93,11 @@ the node independently of its resting appearance. These names indicate captured states; they do not supply state geometry or authorize restyling. Older sidecars remain readable; omitted motion/state fields cannot prove absence of behavior. -`projection` estimates the surviving **source box** tree below body after neutral -chains collapse: maximum `depth`, surviving non-leaf `groups`, source `leaves`, -and `groups_per_leaf` (groups divided by leaves). Body, head and document metadata -are excluded. It is not an emitted-block measurement: pattern expansion and +`projection` estimates block-producing boxes below body after neutral chains +collapse (`basis: estimated-block-producing-boxes`): maximum `depth`, surviving +non-leaf `groups`, estimated block `leaves`, and `groups_per_leaf`. Inline content, +non-rendering metadata and navigation internals are excluded; a nav counts once. +Body and head are excluded. Actual converted block depth belongs to slice 3. It is not an emitted-block measurement: pattern expansion and non-rendering source leaves can differ from WordPress blocks. Missing/rejected evidence has empty classifications and a null projection, never an optimistic zero-depth estimate. Live whole-site/sdnunca measurement is deferred until the diff --git a/php-transformer/resources/box-tree.schema.json b/php-transformer/resources/box-tree.schema.json index 40894ad94..8b2236c8e 100644 --- a/php-transformer/resources/box-tree.schema.json +++ b/php-transformer/resources/box-tree.schema.json @@ -23,10 +23,7 @@ }, "viewports": { "type": "object", - "required": [ - "desktop", - "mobile" - ], + "minProperties": 1, "maxProperties": 8, "propertyNames": { "type": "string", @@ -83,12 +80,8 @@ }, "viewports": { "type": "object", - "minProperties": 2, + "minProperties": 1, "maxProperties": 8, - "required": [ - "desktop", - "mobile" - ], "propertyNames": { "type": "string", "pattern": "^[A-Za-z0-9._:-]{1,80}$" @@ -171,7 +164,8 @@ "grid-row-end", "justify-items", "justify-self", - "background", + "background-color", + "background-image", "border-top", "border-right", "border-bottom", @@ -179,7 +173,8 @@ "border-radius", "outline", "box-shadow", - "mask", + "mask-image", + "mask-mode", "filter", "opacity", "mix-blend-mode", @@ -377,7 +372,8 @@ "minLength": 1, "maxLength": 4096 }, - "background": { + "background-image": { "type": "string", "minLength": 1, "maxLength": 4096 }, + "background-color": { "type": "string", "minLength": 1, "maxLength": 4096 @@ -417,7 +413,8 @@ "minLength": 1, "maxLength": 4096 }, - "mask": { + "mask-mode": { "type": "string", "minLength": 1, "maxLength": 4096 }, + "mask-image": { "type": "string", "minLength": 1, "maxLength": 4096 diff --git a/php-transformer/src/ArtifactCompiler/BoxTreeClassifier.php b/php-transformer/src/ArtifactCompiler/BoxTreeClassifier.php index aee57b476..830a1695d 100644 --- a/php-transformer/src/ArtifactCompiler/BoxTreeClassifier.php +++ b/php-transformer/src/ArtifactCompiler/BoxTreeClassifier.php @@ -21,6 +21,14 @@ public static function report(string $html, array $tree): array $elements[$id] = $element; $parents[$id] = $element->parentNode instanceof DOMElement ? $element->parentNode->getAttribute(BoxTree::NODE_ATTRIBUTE) : null; } + $references = array(); + foreach ($elements as $element) { + $href = $element->getAttribute('href'); + if (str_starts_with($href, '#')) $references[rawurldecode(substr($href, 1))] = true; + foreach (array('aria-controls', 'aria-labelledby', 'aria-describedby', 'aria-owns', 'for') as $attribute) { + foreach (preg_split('/\s+/', trim($element->getAttribute($attribute)), -1, PREG_SPLIT_NO_EMPTY) as $target) $references[$target] = true; + } + } $containing = array(); foreach ($tree['viewports'] ?? array() as $viewport => $_) { $absolute = $fixed = array(); @@ -40,40 +48,46 @@ public static function report(string $html, array $tree): array $counts = array('load-bearing' => 0, 'neutral' => 0); foreach ($elements as $id => $element) { $node = $tree['nodes'][$id]; - $criterion = self::criterion($element, $node, $tree, isset($containing[$id])); + $criterion = self::criterion($element, $node, $tree, isset($containing[$id]), isset($references[$element->getAttribute('id')])); $disposition = 'equal-child-geometry' === $criterion ? 'neutral' : 'load-bearing'; $nodes[$id] = array('disposition' => $disposition, 'criterion' => $criterion); ++$counts[$disposition]; } - // Source-box projection, not a forecast of pattern expansion in emitted blocks. - $depths = $inBody = array(); + // Estimate block-producing boxes; inline content and navigation internals + // do not each become blocks. Actual emitted depth is measured in slice 3. + $depths = $inBody = $inNavigation = array(); $depth = $groups = $leaves = 0; foreach ($elements as $id => $element) { $inBody[$id] = 'body' === strtolower($element->tagName) || ($inBody[$parents[$id]] ?? false); if (!$inBody[$id] || 'body' === strtolower($element->tagName)) continue; - $kept = 'load-bearing' === $nodes[$id]['disposition']; + $tag = strtolower($element->tagName); + $insideNavigation = $inNavigation[$parents[$id]] ?? false; + $inNavigation[$id] = 'nav' === $tag || $insideNavigation; + $produces = !$insideNavigation && !in_array($tag, array('span', 'a', 'strong', 'em', 'b', 'i', 'br', 'script', 'style', 'link', 'meta'), true); + $kept = $produces && 'load-bearing' === $nodes[$id]['disposition']; $depths[$id] = ($depths[$parents[$id]] ?? 0) + ($kept ? 1 : 0); $depth = max($depth, $depths[$id]); - if (!$tree['nodes'][$id]['children']) ++$leaves; + if ($produces && (!$tree['nodes'][$id]['children'] || 'nav' === $tag || in_array($tag, array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'), true))) ++$leaves; elseif ($kept) ++$groups; } return array('counts' => $counts, 'nodes' => $nodes, 'projection' => $tree ? array( - 'basis' => 'body-source-boxes', 'depth' => $depth, 'groups' => $groups, + 'basis' => 'estimated-block-producing-boxes', 'depth' => $depth, 'groups' => $groups, 'leaves' => $leaves, 'groups_per_leaf' => $leaves ? $groups / $leaves : 0.0, ) : null); } - private static function criterion(DOMElement $element, array $node, array $tree, bool $containing): string + private static function criterion(DOMElement $element, array $node, array $tree, bool $containing, bool $referenced): string { foreach ($node['viewports'] as $observation) { $s = $observation['used_styles']; if (self::paints($s)) return 'paints'; } + if (self::clips($node, $tree)) return 'clips'; foreach ($node['viewports'] as $observation) { if (count($node['children']) > 1 && in_array($observation['used_styles']['display'], array('flex', 'inline-flex', 'grid', 'inline-grid'), true)) return 'multi-child-layout'; } if ($containing) return 'containing-block'; - if (!in_array(strtolower($element->tagName), array('div', 'span'), true) || $element->hasAttribute('id') || $element->hasAttribute('role') || $element->hasAttribute('name')) return 'semantics/id/anchor'; + if (!in_array(strtolower($element->tagName), array('div', 'span'), true) || $referenced || $element->hasAttribute('role') || $element->hasAttribute('name')) return 'semantics/id/anchor'; foreach ($element->attributes as $attribute) { if (str_starts_with($attribute->name, 'on') || str_starts_with($attribute->name, 'aria-') || in_array($attribute->name, array('tabindex', 'contenteditable', 'draggable', 'hidden', 'inert'), true)) return 'interaction/state'; } @@ -96,20 +110,61 @@ private static function criterion(DOMElement $element, array $node, array $tree, return 'equal-child-geometry'; } + /** Geometry is checked independently on each clipped axis at every captured viewport. */ + private static function clips(array $node, array $tree): bool + { + foreach ($node['viewports'] as $viewport => $observation) { + $styles = $observation['used_styles']; + $clipping = array('hidden', 'clip', 'auto', 'scroll'); + if (!in_array($styles['overflow-x'], $clipping, true) && !in_array($styles['overflow-y'], $clipping, true)) continue; + $box = $observation['border_box']; + $pending = $node['children']; + while ($pending) { + $descendant = $tree['nodes'][array_pop($pending)]; + $child = $descendant['viewports'][$viewport]['border_box']; + foreach (array('x' => 'width', 'y' => 'height') as $axis => $size) { + $overflow = $observation['used_styles']['overflow-' . $axis]; + if (in_array($overflow, $clipping, true) + && ($child[$axis] < $box[$axis] - 0.01 || $child[$axis] + $child[$size] > $box[$axis] + $box[$size] + 0.01)) return true; + } + foreach ($descendant['children'] as $id) $pending[] = $id; + } + } + return false; + } + + private static function identityTransform(string $transform): bool + { + if ('none' === $transform) return true; + if (!preg_match('/^(matrix|matrix3d)\(([^)]+)\)$/', trim($transform), $match)) return false; + $values = array_map('trim', explode(',', $match[2])); + $identity = 'matrix' === $match[1] ? array(1, 0, 0, 1, 0, 0) : array(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + if (count($values) !== count($identity)) return false; + foreach ($values as $i => $value) { + if (!is_numeric($value) || (float) $value !== (float) $identity[$i]) return false; + } + return true; + } + + private static function transparent(string $color): bool + { + $color = strtolower(trim($color)); + if ('transparent' === $color) return true; + if (preg_match('/\/\s*([\d.e+-]+)%?\s*\)$/', $color, $match)) return (float) $match[1] === 0.0; + return 1 === preg_match('/^rgba\([^,]+,[^,]+,[^,]+,\s*0(?:\.0*)?%?\s*\)$/', $color); + } + private static function paints(array $s): bool { - foreach (array('box-shadow', 'filter', 'transform') as $property) { + if (!self::identityTransform($s['transform'])) return true; + foreach (array('box-shadow', 'filter') as $property) { if ('none' !== $s[$property]) return true; } if ((float) $s['opacity'] !== 1.0 || !in_array($s['mix-blend-mode'], array('normal', 'none'), true)) return true; - foreach (array('overflow-x', 'overflow-y') as $property) { - if (in_array($s[$property], array('hidden', 'clip', 'scroll', 'auto'), true)) return true; - } - // CSSOM shorthands include color and defaults even when nothing paints. - $background = preg_replace('/rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)|transparent/', '', $s['background']); - $background = preg_replace('/\b(?:none|repeat|scroll|auto|padding-box|border-box)\b|0%|\//', '', $background); - if ('' !== trim($background)) return true; - if (!preg_match('/^none(?:\s|$)/', $s['mask'])) return true; + if (!self::transparent($s['background-color'])) return true; + foreach (array('background-image', 'mask-image') as $property) { + if (!preg_match('/^none(?:\s*,\s*none)*$/i', trim($s[$property]))) return true; + } foreach (array('border-top', 'border-right', 'border-bottom', 'border-left', 'outline') as $property) { if (!preg_match('/\b(?:none|hidden)\b|(?:^|\s)0(?:px)?(?:\s|$)/', $s[$property]) && !str_contains($s[$property], 'transparent') && !preg_match('/rgba\([^)]*,\s*0\s*\)/', $s[$property])) return true; } diff --git a/php-transformer/src/ArtifactCompiler/BoxTreeReport.php b/php-transformer/src/ArtifactCompiler/BoxTreeReport.php index e6389c8b0..495a04159 100644 --- a/php-transformer/src/ArtifactCompiler/BoxTreeReport.php +++ b/php-transformer/src/ArtifactCompiler/BoxTreeReport.php @@ -46,7 +46,7 @@ private static function validate(mixed $tree, array $sources): ?string if (!is_string($path) || !isset($sources[$path]) || hash('sha256', $sources[$path]) !== ($tree['source_hash'] ?? null)) return 'box_tree_identity_stale'; $viewports = $tree['viewports'] ?? null; $nodes = $tree['nodes'] ?? null; - if (!is_array($viewports) || !isset($viewports['desktop'], $viewports['mobile']) || count($viewports) > BoxTree::MAX_VIEWPORTS || !is_array($nodes) || !$nodes || count($nodes) > BoxTree::MAX_NODES) return 'box_tree_bounds_invalid'; + if (!is_array($viewports) || !$viewports || count($viewports) > BoxTree::MAX_VIEWPORTS || !is_array($nodes) || !$nodes || count($nodes) > BoxTree::MAX_NODES) return 'box_tree_bounds_invalid'; foreach ($viewports as $name => $viewport) { if (!BoxTree::validId($name) || !is_array($viewport)) return 'box_tree_viewport_invalid'; foreach (array('width', 'height') as $dimension) { diff --git a/php-transformer/src/Contract/BoxTree.php b/php-transformer/src/Contract/BoxTree.php index 729a52529..0ec933475 100644 --- a/php-transformer/src/Contract/BoxTree.php +++ b/php-transformer/src/Contract/BoxTree.php @@ -22,8 +22,8 @@ final class BoxTree 'flex-grow', 'flex-shrink', 'flex-basis', 'align-self', 'order', 'grid-template-columns', 'grid-template-rows', 'grid-auto-columns', 'grid-auto-rows', 'grid-auto-flow', 'grid-column-start', 'grid-column-end', 'grid-row-start', 'grid-row-end', 'justify-items', 'justify-self', - 'background', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-radius', - 'outline', 'box-shadow', 'mask', 'filter', 'opacity', 'mix-blend-mode', 'transform', 'z-index', + 'background-color', 'background-image', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-radius', + 'outline', 'box-shadow', 'mask-image', 'mask-mode', 'filter', 'opacity', 'mix-blend-mode', 'transform', 'z-index', 'width', 'height', 'min-width', 'max-width', 'min-height', 'max-height', ); diff --git a/php-transformer/tests/contract/box-tree-classification.php b/php-transformer/tests/contract/box-tree-classification.php index c9077a80d..345664aab 100644 --- a/php-transformer/tests/contract/box-tree-classification.php +++ b/php-transformer/tests/contract/box-tree-classification.php @@ -18,17 +18,21 @@ for ($i = 1; $i <= 11; ++$i) $open .= '
'; $html = str_replace('', $open . '' . str_repeat('
', 11), $html); } + if (isset($case['reference'])) $html = str_replace('src="image.png"', 'src="image.png" ' . $case['reference'], $html); $tree = $base; + if (!empty($case['desktop_only'])) unset($tree['viewports']['mobile']); $tree['source_hash'] = hash('sha256', $html); $tree['nodes'] = array(); foreach (HtmlSerialization::parseDocument($html)->getElementsByTagName('*') as $element) { $id = $element->getAttribute('data-blocks-engine-node-id'); $node = $base['nodes']['n1']; + if (!empty($case['desktop_only'])) unset($node['viewports']['mobile']); $node['children'] = array(); foreach ($element->childNodes as $child) { if ($child instanceof DOMElement) $node['children'][] = $child->getAttribute('data-blocks-engine-node-id'); } foreach ($node['viewports'] as $viewport => &$observation) { + if ('image' === $id) $observation['border_box'] = array_replace($observation['border_box'], $case['child_box'] ?? array()); $observation['used_styles']['mix-blend-mode'] = 'normal'; $observation['used_styles'] = array_replace($observation['used_styles'], 'wrapper' === $id ? ($case['styles'] ?? array()) : ('image' === $id ? ($case['child_styles'] ?? array()) : array())); if ('wrapper' === $id && 'mobile' === $viewport && isset($case['mobile_width'])) $observation['border_box']['width'] = $case['mobile_width']; @@ -41,6 +45,7 @@ $compiler = new ArtifactCompiler(); $result = $compiler->compile($artifact)->toArray(); $report = $result['source_reports']['box_tree']['index.html']['classification']; + if ('equal-child-geometry' === $case['criterion']) $assert($report['counts']['neutral'] > 0, 'Capture-shaped fixture retains neutral boxes'); $assert($case['criterion'] === $report['nodes']['wrapper']['criterion'], $case['name'] . ' has the named criterion'); if (!empty($case['chain'])) $assert(1 === $report['projection']['depth'] && 0 === $report['projection']['groups'], 'Twelve neutral image wrappers project to one leaf'); $assert(array_sum($report['counts']) === count($tree['nodes']), 'Every source node is counted'); diff --git a/php-transformer/tests/contract/box-tree.php b/php-transformer/tests/contract/box-tree.php index 37a940368..ef5d201a1 100644 --- a/php-transformer/tests/contract/box-tree.php +++ b/php-transformer/tests/contract/box-tree.php @@ -31,7 +31,7 @@ $cases = array( 'box_tree_schema_invalid' => static function (array &$t): void { $t['schema'] = 'old'; }, 'box_tree_identity_stale' => static function (array &$t): void { $t['source_hash'] = str_repeat('0', 64); }, - 'box_tree_bounds_invalid' => static function (array &$t): void { unset($t['viewports']['mobile']); }, + 'box_tree_bounds_invalid' => static function (array &$t): void { $t['viewports'] = array(); }, 'box_tree_geometry_invalid' => static function (array &$t): void { $t['nodes']['n6']['viewports']['mobile']['border_box']['width'] = -1; }, 'box_tree_styles_invalid' => static function (array &$t): void { unset($t['nodes']['n6']['viewports']['desktop']['used_styles']['display']); }, 'box_tree_viewport_invalid' => static function (array &$t): void { unset($t['nodes']['n6']['viewports']['mobile']); }, diff --git a/php-transformer/tests/fixtures/box-tree/classification-cases.json b/php-transformer/tests/fixtures/box-tree/classification-cases.json index bdc41d889..def30a2eb 100644 --- a/php-transformer/tests/fixtures/box-tree/classification-cases.json +++ b/php-transformer/tests/fixtures/box-tree/classification-cases.json @@ -1,15 +1,34 @@ [ {"name":"neutral", "criterion":"equal-child-geometry"}, {"name":"twelve-wrapper-image-chain", "chain":true, "criterion":"equal-child-geometry"}, - {"name":"background", "styles":{"background":"rgb(255, 0, 0)"}, "criterion":"paints"}, + {"name":"background", "styles":{"background-color":"rgb(255, 0, 0)"}, "criterion":"paints"}, {"name":"border", "styles":{"border-top":"1px solid rgb(0, 0, 0)"}, "criterion":"paints"}, {"name":"layout", "styles":{"display":"flex","column-gap":"10px"}, "second_child":true, "criterion":"multi-child-layout"}, {"name":"containing", "styles":{"position":"relative"}, "child_styles":{"position":"absolute"}, "criterion":"containing-block"}, {"name":"mobile-size", "mobile_width":101, "criterion":"own-sizing"}, - {"name":"anchor", "attributes":"id=\"target\"", "criterion":"semantics/id/anchor"}, + {"name":"unreferenced-id", "attributes":"id=\"comp-target\"", "criterion":"equal-child-geometry"}, + {"name":"anchor", "attributes":"id=\"target\"", "reference":"href=\"#target\"", "criterion":"semantics/id/anchor"}, + {"name":"aria-labelledby", "attributes":"id=\"target\"", "reference":"aria-labelledby=\"other target\"", "criterion":"semantics/id/anchor"}, + {"name":"aria-describedby", "attributes":"id=\"target\"", "reference":"aria-describedby=\"target\"", "criterion":"semantics/id/anchor"}, + {"name":"aria-owns", "attributes":"id=\"target\"", "reference":"aria-owns=\"target other\"", "criterion":"semantics/id/anchor"}, + {"name":"identity-3d", "styles":{"transform":"matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)"}, "criterion":"equal-child-geometry"}, + {"name":"translated", "styles":{"transform":"matrix(1, 0, 0, 1, 1, 0)"}, "criterion":"paints"}, + {"name":"alpha-background", "styles":{"background-color":"color(srgb 1 1 1 / 0.5)"}, "criterion":"paints"}, + {"name":"aria-reference", "attributes":"id=\"target\"", "reference":"aria-controls=\"other target\"", "criterion":"semantics/id/anchor"}, + {"name":"label-reference", "attributes":"id=\"target\"", "reference":"for=\"target\"", "criterion":"semantics/id/anchor"}, + {"name":"identity", "styles":{"transform":"matrix(1, 0, 0, 1, 0, 0)"}, "criterion":"equal-child-geometry"}, + {"name":"identity-containing", "styles":{"transform":"matrix(1, 0, 0, 1, 0, 0)"}, "child_styles":{"position":"fixed"}, "criterion":"containing-block"}, + {"name":"overflow-no-clip", "styles":{"overflow-x":"hidden","overflow-y":"clip"}, "criterion":"equal-child-geometry"}, + {"name":"overflow-clips", "styles":{"overflow-y":"clip"}, "child_box":{"y":1}, "criterion":"clips"}, + {"name":"overflow-other-axis", "styles":{"overflow-x":"hidden"}, "child_box":{"y":1}, "criterion":"own-sizing"}, + {"name":"transparent-white", "styles":{"background-color":"rgba(255, 255, 255, 0)"}, "criterion":"equal-child-geometry"}, + {"name":"transparent-srgb", "styles":{"background-color":"color(srgb 1 1 1 / 0)"}, "criterion":"equal-child-geometry"}, + {"name":"image-background", "styles":{"background-image":"url(image.png)"}, "criterion":"paints"}, + {"name":"mask-image", "styles":{"mask-image":"url(mask.png)"}, "criterion":"paints"}, + {"name":"desktop-only", "desktop_only":true, "criterion":"equal-child-geometry"}, {"name":"interaction", "states":["hover","focus"], "criterion":"interaction/state"}, {"name":"handler", "attributes":"onclick=\"return false\"", "criterion":"interaction/state"}, {"name":"stylesheet-animation", "styles":{"animation-name":"pulse"}, "criterion":"motion"}, {"name":"stylesheet-transition", "styles":{"transition-property":"color","transition-duration":"0.2s"}, "criterion":"motion"}, - {"name":"transparent-defaults", "styles":{"background":"rgba(0, 0, 0, 0) none repeat scroll 0% 0% / auto padding-box border-box","border-top":"0px none rgb(0, 0, 0)"}, "criterion":"equal-child-geometry"} + {"name":"transparent-defaults", "styles":{"background-color":"rgba(0, 0, 0, 0)","background-image":"none","mask-image":"none","mask-mode":"match-source","border-top":"0px none rgb(0, 0, 0)"}, "criterion":"equal-child-geometry"} ] diff --git a/php-transformer/tests/fixtures/box-tree/index.json b/php-transformer/tests/fixtures/box-tree/index.json index f2c210461..9189f1446 100644 --- a/php-transformer/tests/fixtures/box-tree/index.json +++ b/php-transformer/tests/fixtures/box-tree/index.json @@ -63,7 +63,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -71,7 +72,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -129,7 +131,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -137,7 +140,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -202,7 +206,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -210,7 +215,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -268,7 +274,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -276,7 +283,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -339,7 +347,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -347,7 +356,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -405,7 +415,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -413,7 +424,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -478,7 +490,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -486,7 +499,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -544,7 +558,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -552,7 +567,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -618,7 +634,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -626,7 +643,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -684,7 +702,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -692,7 +711,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -755,7 +775,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -763,7 +784,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -821,7 +843,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -829,7 +852,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -892,7 +916,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -900,7 +925,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none", @@ -958,7 +984,8 @@ "grid-row-end": "none", "justify-items": "none", "justify-self": "none", - "background": "none", + "background-color": "rgba(0, 0, 0, 0)", + "background-image": "none", "border-top": "none", "border-right": "none", "border-bottom": "none", @@ -966,7 +993,8 @@ "border-radius": "none", "outline": "none", "box-shadow": "none", - "mask": "none", + "mask-image": "none", + "mask-mode": "match-source", "filter": "none", "opacity": "1", "mix-blend-mode": "none",