Skip to content

Skip empty DocumentFragment append visual work #562

Closed

Description

@wieslawsoltes

Parent: #243. CSS/performance epic: #235.

Proven hot path

Pinned unchanged Code OSS sanitizes selected Chat fragments and then unconditionally appends them. Sanitization can remove all nonportable links/images, leaving an empty DocumentFragment; WebScene still recascaded/marked dirty/published for that no-op. Batched panel and color-picker fragment append sites have the same shape.

Scope

After existing receiver/type/cycle handling, return the original DocumentFragment when its child list is empty, before recascade, dirty publication or lifecycle work. This matches the DOM insertion algorithm's zero-node early return. Preserve every real fragment detach/adopt/insert, focus/selection, mutation, custom-element, selector, identity and publication behavior.

Acceptance

  • Focused source and regression authored.
  • git diff --check passes.
  • 4,096 connected and 4,096 detached empty-fragment appends preserve return/fragment/row/focus/selection/lifecycle/style/node-count state with zero recascade/layout/publications.
  • 256-row nonempty control and detach/reattach produce exact callbacks and one bounded layout/publication; cleanup reclaims memory.
  • Code OSS A/B/ABBA, browser/package, pixel, physical-performance and memory gates run later.

No build, test, benchmark or formatter was executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions