Download Latest Version openpublisher5g_amd64-windows.exe (81.1 MB)
Home / 5.19.12
Name Modified Size InfoDownloads / Week
Parent folder
OpenPublisher5-i386-windowsXP.exe 2026-11-10 56.5 MB
openpublisher5_amd64-windows-portable.exe 2026-11-10 183.2 MB
openpublisher5_amd64-windows.exe 2026-11-10 165.2 MB
openpublisher5_amd64-macos.dmg 2026-11-10 233.1 MB
openpublisher5_amd64-linux.run 2026-11-10 193.4 MB
openpublisher5_amd64-linux.rpm 2026-11-10 215.4 MB
openpublisher5_amd64-linux.flatpak 2026-11-10 153.6 MB
openpublisher5_amd64-linux.deb 2026-11-10 156.2 MB
openpublisher5_amd64-linux.AppImage 2026-11-10 166.4 MB
openpublisher5_amd64-freebsd.pkg 2026-11-10 185.5 MB
5.19.12_ Partial Text Font-Size Selection Preservation _ Re-Entrant Input Fix source code.tar.gz 2026-11-09 103.6 MB
5.19.12_ Partial Text Font-Size Selection Preservation _ Re-Entrant Input Fix source code.zip 2026-11-09 104.1 MB
README.md 2026-11-09 14.1 kB
Totals: 13 Items   1.9 GB 0

πŸ“‹ Summary

Version 5.19.12 resolves a regression where selecting a specific chunk of text inside a text box and changing its font size unexpectedly selected all text in the box before applying the new size (while styling actions like Bold and Font Family continued to apply only to the selected chunk).

Multiple compounding issues in the bootstrap and font-size execution paths caused partial selections to collapse or be ignored:

  1. Delayed window.onload bootstrap locking out selectionchange: core/boot.js waited for window.onload before attaching document.addEventListener('selectionchange', ...) (state.lastRange updater), ContextRibbonSystem.init(), and canvas handlers. While slow external resources kept window.onload pending after entering the editor, state.lastRange stayed null, so clicking a font-size input blurred the live selection and fell back to selectAllChildren.
  2. state.lastRange-only dependency & focus-loss race before live selection inspection: Calling editableContent.focus() and sel.removeAllRanges() before snapshotting window.getSelection(), plus asynchronous selectionchange timing when inputs steal focus, caused null, detached (!isConnected), collapsed, or pre-blur selections to trigger sel.selectAllChildren(editableContent).
  3. Re-entrant change firing during Ribbon input focus transitions: Focusing editableContent while a font-size input (#font-size or #ctx-font-size-text) was still focused with uncommitted text blurred the input synchronously, firing a nested onchange -> setTrueFontSize() call that mutated DOM text nodes underneath the outer call and overwrote state.lastRange.
  4. Edge-case & non-box targets: Clearing #font-size (NaN/empty) still ran whole-box selection logic, .page-header/.page-footer regions (state.selectedEl === null) exited early, sibling multi-editable containers picked the wrong [contenteditable="true"] host, multi-tag highlights collapsed selection to the last span, pre-existing 48px spans or <font size="7"> headings could be overwritten, and active-input checks missed context-ribbon inputs.

With these fixes in place, partial text selections remain tightly scoped across slow network loads and all font-size entry points while intentional whole-box sizing (when a box is selected with no active text highlight) continues to work identically.

op-NewBulletproofTextAndFintSizeSelectionEngine


πŸ› οΈ Key Fixes & Enhancements

1. Immediate DOMContentLoaded Bootstrap & Selection Guard (core/boot.js)

  • Non-Blocking Editor Startup (bootOpenPublisher):
  • Replaced window.onload = function() with a one-shot bootOpenPublisher() triggered on DOMContentLoaded (or immediately if document.readyState !== 'loading') with window.addEventListener('load', bootOpenPublisher) kept as a safety fallback.
  • Marks window._opBootSelectionChangeActive = true as soon as core/boot.js attaches selectionchange so editor tracking and contextual ribbon initialization do not stall behind external preloads or remote stylesheets.
  • Active-Input selectionchange Guard:
  • Skips overwriting state.lastRange inside selectionchange and its 150ms UI debounce timer whenever document.activeElement is an INPUT, TEXTAREA, or SELECT.

2. Bulletproof Font-Size Selection Engine (extensions/legacy-fixes.js)

  • Pre-Blur Capture & Pre-Boot selectionchange Fallback (preBlurSnapshot):
  • Added capture-phase pointerdown and mousedown listeners for UI interactions outside #paper as well as ribbon, floating-toolbar, dropdown, spinner, and input controls (#float-toolbar, #float-size-btn, .ribbon-container, .custom-dropdown, .modern-spinner, .spin-btns, input, select) to snapshot valid #paper editable selections (state.lastRange) synchronously before input focus collapses the DOM range, alongside a fallback selectionchange listener active whenever !window._opBootSelectionChangeActive.
  • Live-First Validated Selection, Stale-Box Bypass & Header/Footer Resolution (getEditableHostNode, isValidRangeInEl, isLivePaperEditableRange, findEditableHost):
  • Snapshots the browser's live window.getSelection() range before changing focus or clearing selection ranges and supports [contenteditable="true"], [contenteditable=""], and [contenteditable="plaintext-only"] hosts inside #paper.
  • Supports active #paper editable selections when state.selectedEl is null (such as .page-header / .page-footer) or points to a stale element (savedInPaperEditable && !state.lastRange.collapsed), and resolves the exact editable host containing targetRange.
  • Input Validation, Re-Entrancy & Async Timer Safety:
  • Rejects empty, NaN, or non-positive (<= 0) font-size values up front before touching focus or selection.
  • Added an _inSetTrueFontSize re-entrancy guard and try / finally timer cleanup (clearTimeout(window._fontSizeProgTimer)) so blurring an active ribbon font-size input cannot corrupt state.lastRange.
  • Pure-DOM Scoped Font Sizing (applyPureFontSizeToEditable & Selection Control):
  • Removed document.execCommand("fontSize", false, "7") and sel.selectAllChildren(editableContent) completely from both elements/text/text.js and extensions/legacy-fixes.js.
  • Partial selections are split at exact Text boundaries and wrapped in <span data-opub-size="1" style="font-size: ...">, preserving surrounding text (including split 48px headings and <font size="7"> elements) and restoring selection strictly over the resized text nodes (firstText to lastText) only when focus is not inside an input/select control.
  • Whole-box sizing (wasCollapsed) updates editableContent.style.fontSize and inline child sizing directly in DOM without selecting text box contents.
  • Undo & TextHistory Integrity (_opSyncTextUndoBefore / _opSyncTextUndoAfter & pushHistory(true)):
  • Eliminating document.execCommand("fontSize", false, "7") prevents synthetic input events and native undo steps containing temporary <font size="7"> (48px) markup from corrupting text undo.
  • Synchronizes granular TextHistory (installGranularUndoProtector) and flushes global pushHistory(true) before and after font-size mutations, clearing committed input history on #font-size, #ctx-font-size-text, and #ctx-font-size-wa so Ctrl+Z cleanly steps backward through font-size changes and typing without breaking undo.
  • UI Control Sync:
  • Synchronizes #font-size, #ctx-font-size-text, #ctx-font-size-wa, #float-size, and #float-size-label, and skips sel.addRange inside syncHighlightWithFontSize when focus belongs to a form control.

3. Text Engine, Highlight Sync & Contextual Ribbon Guards (elements/text/text.js, extensions/ui-interactions.js)

  • Multi-Tag Highlight Selection Preservation (syncHighlightWithFontSize):
  • Added f.isConnected guards and collected all updated target elements across multi-span inline highlights, restoring one continuous range spanning first-to-last target without overriding active input focus.
  • Base setTrueFontSize Alignment (applyPureFontSizeToEditable):
  • Updated the base fallback setTrueFontSize in elements/text/text.js to share applyPureFontSizeToEditable, reject empty/NaN/non-positive values, validate connected selections, and flush pushHistory(true).
  • Focused Input Protection (updateFloatToolbarValues):
  • Added 'ctx-font-size-text' and 'ctx-font-size-wa' to the active-input skip list in elements/text/text.js, and prevented the contextual ribbon wrapper in extensions/ui-interactions.js from overwriting ctx-font-size-text / ctx-font-size-wa while actively focused.

4. Keyboard Font-Size Step Calculation (core/keyboard.js)

  • Ctrl+Shift+> and Ctrl+Shift+< Live Range Lookup:
  • Updated font-size shortcut calculation to check valid connected live non-collapsed selections before falling back to state.lastRange or the active editable box base size.

βœ… Browser Verification Coverage

Executed end-to-end automated Playwright verification across 23 total checks (19 checks in verify_v51912.py passing with zero runtime console or page errors, plus 4 test blocks in verify_new_fixes.py passing across Chromium and Firefox with zero page errors):

  • Core Regression Suite (verify_v51912.py, Chromium - 19 checks):
  • Partial text resizing when state.lastRange is null, detached, collapsed, or pointing to another box (1a - 1d).
  • Whole-box font-size updates when box-selected without highlighted text (2).
  • Mouse-drag selection + Contextual Ribbon #ctx-font-size-text, Home Ribbon #font-size, and spinner increment controls (3 - 4).
  • Floating Toolbar #float-size-btn / #float-size-list and #float-size-label sync (5).
  • Ctrl+Shift+> and Ctrl+Shift+< keyboard shortcuts with null state.lastRange (6).
  • Table Cell 2 partial selection isolation (7), Bold + Font Family + Font Size formatting sequences (8), single-tag and multi-tag inline highlight splits (9), and pre-existing 48px heading preservation (10).
  • Real publication templates (resumes_nurse_healthcare.opub, flyers_gardening_club.opub, resumes_dark_mode_developer.opub) (11).
  • Native blur commit after typing into #ctx-font-size-text and #font-size (12) and box-resize followed by partial word override (13).
  • Async-Boot & Edge-Case Suite (verify_new_fixes.py, Chromium & Firefox - 4 test blocks):
  • Stalled window.load (pre-load state with external image route delayed) confirming DOMContentLoaded bootstrap and partial text sizing ([['Alpha', 16], ['TargetWord', 30], ['Omega', 16]]).
  • Stalled DOMContentLoaded (pre-DCL state with defer script delayed) confirming capture-phase pre-blur selection preservation and fallback selectionchange ([['Alpha', 16], ['TargetWord', 32], ['Omega', 16]]).
  • Chromium and Firefox edge-case checks for .page-header partial text resizing with state.selectedEl === null (28px), empty #ctx-font-size-text input safety, legacy <font size="7"> preservation, and stale state.selectedEl partial-selection protection ([['One', 16], ['TargetPart', 26], ['Three', 16]]).
  • Undo & Split-Span Regression Checks (probe_exact_sequence.py & probe_font_after.py, Chromium):
  • Verified consecutive Floating Toolbar sizes (28px -> 36px) followed by two Ctrl+Z undos reverting cleanly (36px -> 28px -> 16px) without <font size="7"> corruption.
  • Verified typed text + spinner increments (17px -> 18px) + two Ctrl+Z undos (18px -> 17px -> 16px), Home #font-size Enter commit + Ctrl+Z (30px -> 16px), split 48px span isolation, highlight splitting, and font-size-to-font-family transitions.

πŸ”„ Version Synchronization (v5.19.12)

Component Target Version Updated Reference
Service Worker v5.19.12 open-publisher-v5-19-12-3 and header comment in sw.js
About Dialog & UI Interactions v5.19.12 Header comment, Knowledge Base icon query strings, and About dialog (β€’ v5.19.12) in extensions/ui-interactions.js
Print & Watermark Engines v5.19.12 Header comment in extensions/print-engine.js; header and init log in extensions/watermark-engine.js
Proofing & Spellcheck v5.19.12 Headers and load log in tools/proofing/dictionary.js and tools/proofing/spellcheck-engine.js
PWA Installer v5.19.12 Service worker registration sw.js?v=5.19.12 in extensions/pwa-install.js
Application Cachebusters v5.19.12 All 98 script, style, and image asset query strings updated to ?v=5.19.12 in index.html, with v=5.19.12-3 on elements/text/text.js, extensions/legacy-fixes.js, and core/boot.js
Dashboard & Template Assets v5.19.12 ui/dashboard.js (4 references) and elements/templates/templates.js (getTemplateAssetUrl)
README Badges v5.19.12 Asset query strings updated to ?v=5.19.12 in README.md

βœ… Checklist Completed

  • [x] Boot editor initialization (bootOpenPublisher) on DOMContentLoaded in core/boot.js so selectionchange tracking and contextual ribbons activate without waiting for window.onload
  • [x] Add capture-phase pre-blur selection snapshot (preBlurSnapshot) and active-input selectionchange guards
  • [x] Replace document.execCommand("fontSize", false, "7") and selectAllChildren with pure-DOM range splitting (applyPureFontSizeToEditable) in elements/text/text.js and extensions/legacy-fixes.js
  • [x] Synchronize TextHistory (_opSyncTextUndoBefore / _opSyncTextUndoAfter) and immediate pushHistory(true) so Ctrl+Z cleanly steps back without <font size="7"> (48px) undo corruption
  • [x] Preserve multi-tag highlight selections, split 48px spans, and legacy <font size="7"> headings
  • [x] Guard contextual font-size inputs (ctx-font-size-text, ctx-font-size-wa) against background toolbar overwrites and Header/Footer/stale-selection edge cases
  • [x] Update Ctrl+Shift+> / < font-size measurement to prefer live connected selections
  • [x] Pass all 19 core Playwright checks (verify_v51912.py), all 4 async-boot / cross-browser checks (verify_new_fixes.py on Chromium and Firefox), and undo / split-span checks (probe_exact_sequence.py and probe_font_after.py) with zero page errors
  • [x] Bump Service Worker cache (open-publisher-v5-19-12-3) and script cachebusters (v=5.19.12-3 on updated text/font-size scripts)
  • [x] Write release notes artifact outside the project directory
  • [x] Commit all v5.19.12 changes locally

πŸš€ Version 5.19.12 - Open Publisher

Source: README.md, updated 2026-11-09