Replace vendored floating-ui in FloatingDOMController with CSS Anchor Positioning
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- css, html, typescript
調査の方向性
Start with FloatingDOMController and its vendored floating-ui code, focusing on the affected uses of the global window and the iframe failure described in RedHat-UX/red-hat-design-system#2969. Review the proposed @supports-gated CSS anchor positioning and browser timeline, then verify the iframe fix and the native positioning path against the existing behavior before removing the JavaScript path after October 2026.
索引モデルが issue の本文から書いたものです。
説明
Summary
CSS Anchor Positioning reached Baseline in January 2026 (Chrome 125+, Safari 26+, Firefox 147+). The ~1400 lines of vendored floating-ui code in FloatingDOMController can be replaced with native popover attribute + CSS anchor positioning.
Current problems with the vendored code
The vendored floating-ui has diverged from upstream. Several functions use the bare global window where upstream uses getWindow(node) (i.e. node.ownerDocument.defaultView). This causes infinite recursion and stack overflow when components using FloatingDOMController are rendered inside same-origin iframes (see RedHat-UX/red-hat-design-system#2969).
What CSS Anchor Positioning replaces
| Vendored floating-ui code | CSS replacement |
|---|---|
calculatePosition, computeCoordsFromPlacement, all rect/offset math (~600 lines) |
anchor-name, position-anchor, anchor() function |
| Flip middleware, fallback placements loop | position-try-fallbacks, @position-try |
| Shift middleware, overflow detection | position-area + viewport-aware clamping |
autoUpdate with ResizeObserver/IntersectionObserver/scroll listeners |
Not needed -- browser recalculates natively |
getOffsetParent, getContainingBlock, isContainingBlock |
Not needed -- popover promotes to top layer, escaping containing blocks |
| Arrow positioning | anchor() function on the arrow pseudo-element |
| RTL handling | CSS logical properties (already baseline) |
Timeline
| Milestone | Date |
|---|---|
| Firefox 147 ships anchor positioning | Jan 2026 |
| Firefox ESR 153 (includes anchor positioning) launches | Jul 2026 |
| Firefox ESR 140 (no anchor positioning) EOL | Oct 2026 |
October 2026 is the earliest clean cutover for projects supporting Firefox ESR.
Polyfill considerations
The @oddbird/css-anchor-positioning polyfill (~8KB gzipped) exists but has limitations that make it unsuitable for component libraries:
- Cannot work with constructed stylesheets (how Lit delivers CSS)
- Only processes styles present at call time
- Cross-shadow-root anchoring unsupported
- Global side effects even in "ponyfill" mode
Migration approach
- Fix the iframe
windowbug now (one-line fix per affected function) - Keep JS positioning as the engine through ESR 140's lifetime
- Write CSS anchor positioning alongside, gated by
@supports (anchor-name: --a) - Drop JS positioning path after Oct 2026
References
- 主要言語
- TypeScript
- スター
- 394
- フォーク
- 107
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
patternfly/patternfly-elements のほかの issue
-
bug
patternfly/patternfly-elements#3158 · 担当者 1 名 ·
-
patternfly/patternfly-elements#3136 · コメント 1 件 · 担当者 1 名 ·
-
docs
patternfly/patternfly-elements#3131 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
patternfly/patternfly-elements#3122 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
patternfly/patternfly-elements#3110 ·
patternfly/patternfly-elements の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
TanStack/tanstack.com#1293 ·