Skip to content

Regression fixes after resurrecting lost tck#5774

Merged
BalusC merged 4 commits into
masterfrom
regression_fixes_after_resurrecting_lost_tck
Jun 7, 2026
Merged

Regression fixes after resurrecting lost tck#5774
BalusC merged 4 commits into
masterfrom
regression_fixes_after_resurrecting_lost_tck

Conversation

@BalusC

@BalusC BalusC commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

jakartaee/faces#2181

Will backport to 4.x once merged.

BalusC and others added 3 commits June 5, 2026 12:28
The CSP rework (jakartaee/faces#1590) added flushPendingBehaviorEventListeners
to PassthroughRenderer.encodeEnd but never queued the behaviors in encodeBegin,
so f:ajax and other client behaviors on passthrough HTML5 elements (article,
aside, nav, section, h1-h6, ...) emitted no event handler at all and never fired.

- PassthroughRenderer.encodeBegin: pass the component's client behaviors through
  so non-default DOM events (e.g. mouseover) are rendered by the behavior-aware
  renderPassThruAttributes overload, and render the default click/action behavior
  via renderOnclickEventListener. The overload's optimization nulls the lone
  default-event behavior, so it must be rendered explicitly, as CommandLinkRenderer
  does; both are queued as CSP-safe listeners that encodeEnd flushes.
- HtmlResponseWriter.getElementName: do not substitute the passthrough localName
  for framework-generated <script>/<style> elements, otherwise the behavior
  listener script was emitted as <article> instead of <script>.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In a namespaced view (UIViewRoot is a NamingContainer, e.g. a portlet)
the form ViewState field is named
<prefix>jakarta.faces.ViewState<sep><counter>. Two namespace-aware
lookups were lost in the faces.js modernization, so faces.ajax.request
threw "Form has no view state element" and no Ajax fired.

- getHiddenStateField (faces/ajax.ts): restore the fallback that scans
  form.elements for a field whose name contains the state field name.
  The exact-name lookup cannot find the field before the prefix is
  known, yet the prefix is derived from that same field's name — only
  the fallback breaks the chicken-and-egg. Dropped in #5728 (TypeScript
  migration).

- getPartialViewState (faces/api.ts): match the always-included
  ViewState and ClientWindow params by substring so the namespaced
  field survives a partial submit instead of being filtered out.
  Bare-name matching dates to #5141 (optional partial submit).

Replace the stale "intentionally not covered by unit tests" note with
Jest coverage for faces.ajax.request in a namespaced view — restoring
the fallback is what makes that path constructible in jsdom.

Caught by the Faces TCK namespaced-params test (Spec790 portlet
namespacing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BalusC BalusC force-pushed the regression_fixes_after_resurrecting_lost_tck branch from 67772fa to f046806 Compare June 6, 2026 15:42
Resource injection (@resource, @Inject) and @PostConstruct on
faces-config-declared artifacts (factories, ActionListener,
NavigationHandler, PhaseListener, ...) went through the
container-provided InjectionProvider, which is not available in all
environments. Delegate instead to CDI's non-contextual InjectionTarget,
the same mechanism FactoryFinderInstance already uses to inject
factories.

Fixes the Faces TCK Spec763 injection test, which asserts injection and
@PostConstruct fire on every injectable faces-config artifact type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BalusC BalusC requested a review from arjantijms June 6, 2026 19:10
@BalusC BalusC marked this pull request as ready for review June 6, 2026 19:10
@BalusC BalusC merged commit 1d5ce00 into master Jun 7, 2026
3 checks passed
@BalusC BalusC deleted the regression_fixes_after_resurrecting_lost_tck branch June 7, 2026 13:01
@BalusC BalusC mentioned this pull request Jun 7, 2026
BalusC added a commit that referenced this pull request Jun 7, 2026
@BalusC BalusC mentioned this pull request Jun 7, 2026
BalusC added a commit that referenced this pull request Jun 7, 2026
pzygielo pushed a commit to pzygielo/mojarra that referenced this pull request Jun 7, 2026
pzygielo pushed a commit to pzygielo/mojarra that referenced this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant