Replace vendored floating-ui in FloatingDOMController with CSS Anchor Positioning
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Refatoração
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- css, html, typescript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 395
- Forks
- 107
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de patternfly/patternfly-elements
-
[bug] ssr-shims.js uses deprecated globalThis.litSsrCallConnectedCallbackTalvez já em andamento @zeroedin assumiu há 65 dias. Abertabug
patternfly/patternfly-elements#3158 · 1 responsável ·
-
chore: evaluate removing isolatedDeclarations from tsconfigTalvez livre de novo @bennypowers assumiu há 155 dias e não há nenhum pull request aberto. Aberta
patternfly/patternfly-elements#3136 · 1 comentário · 1 responsável ·
-
chore: update docs scaffolding for v6 elementsTalvez livre de novo @zeroedin assumiu há 155 dias e não há nenhum pull request aberto. Abertadocs
patternfly/patternfly-elements#3131 · 1 responsável ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
patternfly/patternfly-elements#3122 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
patternfly/patternfly-elements#3110 ·
Todas as issues de patternfly/patternfly-elements
Issues semelhantes
-
chore v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
modelcontextprotocol/servers#5115 ·
Mantenedores costumam responder em até 1 dia
-
beginner bug good first issue
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
philaconvalley/website#168 ·
Mantenedores costumam responder em até 1 dia
-
bug frontend good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
oss-slu/lrda_mobile#294 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
hatchet-dev/hatchet#5179 ·
Mantenedores costumam responder em até 1 dia