Skip to content

1.0.4: pages that froze (#5), and the quirk form (#4) - #6

Merged
QuantIntellect merged 1 commit into
mainfrom
fix/1.0.4
Nov 27, 2026
Merged

QuantIntellect merged 1 commit into
mainfrom
fix/1.0.4

Conversation

@QuantIntellect

Copy link
Copy Markdown
Owner

Fixes #5 and #4.

#5: pages could stop responding

The extension could end up answering its own changes:

  • Inline !important colors were transformed again on every pass. Transforms don't settle (a border color drifts: #f0f0f0 → #292929 → #a0a0a0 → #5f5f5f → #a0a0a0…). With nothing else to adjust on the element, each pass was an unmarked style write that the observer answered in microtasks, so the page never painted again. One style="border-color: #f0f0f0 !important" was enough. Now the original value is kept, transformed once, and restored when the mode turns off (unless the page changed it in the meantime).
  • Text over a large background photo was re-queued on every frame. The photo is never classified, and the "classified, look again" step ran anyway. On the reported Oracle careers page this rewrote data-adm-base 60 times a second under Oracle JET components, which re-render when attributes under them change. Idle script time on that page went from ~650 ms per 12 s to ~1 ms.
  • Adjustments are written only when their value changes, and attribute records whose value didn't change are ignored.
  • Loop guard for anything not covered above: per-task limits on observer rounds and per-element handling (defer to the next task, drop after three hot tasks in a row). Elements re-queued on every frame are parked and looked at a second later. The popup's statistics line says "loops stopped" when it kicks in.

I couldn't get past the email step of the reported apply flow (that would mean submitting data to a real employer). So the exact path behind the reporter's freeze isn't confirmed, but all of the above were present on the pages I could reach.

#4: quirk form rejected valid selectors

After one invalid selector, the custom validity message stayed set on the field and blocked the form, so every later selector looked invalid until a reload. It's now cleared on input, and the message names the selector that's wrong. The placeholders no longer read like part of the value.

Tests

  • test/fixtures/loops.html: an inline !important border and background, text over a photo, a component that re-applies its children's classes, and one that re-renders fresh children on any attribute change under it. Nine e2e checks: the page still answers, no attribute is rewritten while idle, the border is stable, the ping-pong ends, and colors are restored on turning off. The original code freezes on this page.
  • Three e2e checks for the quirk form.
  • Results: 104/104 fixture checks, 115/115 with --sites (0 contrast failures), 21/21 unit tests.

🤖 Generated with Claude Code

#5: the extension could end up answering its own changes and freeze a page.
- Inline !important colors were transformed again on every pass. Transforms
  don't settle (a border color drifts), and with nothing else to adjust on the
  element, each pass was an unmarked style write the observer answered in
  microtasks. Keep the original, transform once, restore on shutdown.
- Text over a large background photo was re-queued on every frame: the photo
  is never classified, and the "classified, look again" step ran anyway. On
  the Oracle careers page this rewrote data-adm-base 60 times a second under
  Oracle JET components that re-render on attribute changes.
- Write adjustments only when their value changes; ignore attribute records
  whose value didn't change.
- Loop guard: per-task limits on observer rounds and per-element handling
  (defer, then drop after three hot tasks in a row); elements re-queued on
  every frame are parked and looked at a second later. Shown in the popup's
  statistics as "loops stopped".

#4: after one invalid selector, the custom validity message stayed set and
blocked the form, so every later selector was rejected until a reload. Clear
it on input, and name the selector that's wrong.

Tests: test/fixtures/loops.html with five loop cases, nine e2e checks, and
three for the quirk form. 104/104 fixture checks, 115/115 with real sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuantIntellect
QuantIntellect merged commit b768f9e into main Nov 27, 2026
1 check passed
@QuantIntellect
QuantIntellect deleted the fix/1.0.4 branch November 27, 2026 07:52
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.

[Bug] Adaptive Dark Mode makes a website crash

1 participant