Replace vendored floating-ui in FloatingDOMController with CSS Anchor Positioning
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- css, html, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 394
- Forks
- 107
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de patternfly/patternfly-elements
-
bug
patternfly/patternfly-elements#3158 · 1 asignado ·
-
patternfly/patternfly-elements#3136 · 1 comentario · 1 asignado ·
-
docs
patternfly/patternfly-elements#3131 · 1 asignado ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
patternfly/patternfly-elements#3122 ·
-
[epic] Port v5 elements to v6 Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
patternfly/patternfly-elements#3110 ·
Todos los issues de patternfly/patternfly-elements
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
mksglu/context-mode#1200 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
anthropics/claude-code#96687 ·
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
AOSSIE-Org/DebateAI#582 · 2 comentarios ·