Repository navigation
ui-primitives MenuSurface 的 macOS backing 在真实 Chromium 上从未生效:anchor-name / position-anchor 经 var() 引用不被应用 #10607
Replies: 1 comment
|
The 0×0 is a fallback, not a second bug. Two facts from the source fit your measurement.
The 0×0 then follows. Your A/B is the part I would keep, because it is what isolates the engine: identical DOM, literal name aligns, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
现象
macOS 桌面壳(透明 vibrancy 窗口)上,官方
MenuSurface的 macOS backing(MenuSurface.module.css中:global(html[data-platform='darwin']) .backing)从未实际生效:菜单只有.material45% 半透明层,没有不透明垫底——压在网页内容上透出模糊文字,压在窗口透明区则直接透出被系统糊匀的壁纸,呈均匀亮灰(采样 ≈ (135,135,135)),与设计上 backing 生效应有的不透明深灰(≈ (42,43,46))不符。源码注释承诺的「Chromium needs opaque pixels behind the page content to blur it over native vibrancy」没有兑现。定位
MenuSurface.tsx用 CSS 自定义属性中转每实例锚点名:CSS 侧anchor-name: var(--dsh-menu-anchor)与position-anchor: var(--dsh-menu-anchor),锚名经 inline custom property 注入。实测(Electron 44.0 / 44.7,macOS 15,透明 vibrancy 窗口):CSS.supports对anchor-name、position-anchor、anchor()、anchor-size()全部返回 true,但布局不应用——backing 的getBoundingClientRect()为 0×0 错位;同一窗口里把锚名改为字面量(不经var())则 backing 与 surface 完全对齐。即:Chromium 不应用经var()到达anchor-name/position-anchor的引用。All reactions