Repository navigation
Description
Revert Octane's translation-specific DOM accommodation and make disabling external translation of framework-owned content the supported mitigation.
We addressed browser translation by accepting and repairing its DOM mutations inside Octane. We should reverse that decision: applications should prevent those tools from transforming content that Octane owns, particularly when the application already provides localization.
Why
The original reproduction in #1904 shows native translation replacing Text nodes with nested <font> elements before adoption. Subsequent changes accommodate displaced nodes, relocated whitespace, and additional text-run shapes. Supporting each observed rewrite expands the adoption and update contract without establishing a reliable contract with the external mutator.
Scope
- Remove the translation-specific adoption/preservation and text-repair behavior introduced by fix(octane): adopt DOM bindings over browser-translated text leaves #1909.
- Review and remove the translation-only recovery paths from fix(octane): keep updating an only text child after page translation #1915, coordinating compiler output, runtime writers, and presentation writes. Preserve compatibility for already-emitted
setText(null, value, host)calls, or explicitly handle the compatibility transition. - Remove the translation-specific boundary-whitespace exception from fix(octane): tolerate translated boundary whitespace in DOM bindings #1978.
- Reassess open PR fix(runtime): adopt annotated scalar text runs #2063 against this policy; separate any independently justified comment/text-run correctness fixes from translator compatibility.
Preserve unrelated improvements bundled into these PRs, including efficient sibling traversal, strict topology validation, stable member reads, generic error-note infrastructure, and journaling/view-transition guarantees.
Likely areas: dom-bindings.ts, dom-binding-program.ts, runtime/compiler only-child text paths, their tests, and docs/deferred-hydration.md.
Supported mitigation and acceptance
- Document application-owned opt-outs in the initial server-rendered HTML:
<meta name="google" content="notranslate">for Google page translation, andtranslate="no"on the document or relevant owned roots. See Chromium's translation design and the HTML translate attribute. - State the boundary clearly: arbitrary external rewriting of framework-owned DOM is unsupported; these opt-outs apply to tools that honor them. Keep localization under application control.
- Update documentation, error guidance, and translation-specific tests to match that contract. Preserve normal SSR/adoption, scalar/structural updates, disposal/handoff, and invalid-topology coverage.
- Before affected consumers take the revert, verify their opt-outs with native browser translation before adoption and after activation, including hidden/deferred content.
- Report compiler/runtime compatibility checks and bundle/performance deltas for the final removal.
Activity