CPTypesetter lacked handling for CPJustifiedTextAlignment, causing justified paragraphs to fall back to left alignment. Additionally, centred and right-aligned text improperly spanned the full container width by ignoring paragraph indents, and trailing spaces on wrapped lines incorrectly shifted line positioning.
* AppKit/CPTextView/CPTypesetter.j:
- Implement CPJustifiedTextAlignment layout by distributing spare width evenly across line spaces.
- Preserve left alignment for paragraph final lines and segments preceding a tab, matching Cocoa behavior.
- Constrain centred, right-aligned, and justified lines between head and tail indents.
- Exclude trailing spaces from visible line width to allow proper hanging alignment.
* AppKit/CPTextView/CPLayoutManager.j:
- Update _CPLineFragment to record extra space widths and render spans with matching CSS word-spacing.
- Ensure fragment equality checks account for word-spacing variations.
* Tests/Manual/TextEditor/WORKLIST.md:
- Mark justified and centred text layout tests as completed.
Centred and justified paragraphs now conform to standard Cocoa layout behavior.
- 8 PLATFORM blocks resolved across four files: runtime CPDOMAvailable
guards (3 wrapped, 2 early returns, 3 if/else preserving existing
CommonJS branches)
- CPMenu: @global _CPDOMEventStop declared; its definition resides in
the DOM-only CPPlatformWindow+DOM category
- zero preprocessor directives remain in these files
- work-in-progress towards complete removal of CPP directives
Cappuccino previously supported three platform contexts behind the
PLATFORM() preprocessor macro: Browser, CommonJS/Node, and a NativeHost
target. NativeHost is no longer supported; this removes it and
consolidates on Browser (for the app) and CommonJS/Node (still needed
by the toolchain itself, for theme compilation and testing).
PLATFORM(DOM) conditionals throughout AppKit governed both distinctions
at once - Browser vs NativeHost, and separately, DOM-dependent code vs
the CommonJS/Node build. Each conditional was reviewed individually:
NativeHost-only branches were removed, while branches needed for
CommonJS/Node were kept intact rather than collapsed to Browser-only.
Also included, found in the course of this work:
- Fixed two pre-existing duplicate instance-variable declarations
(_ephemeralSubviews in CPView, _scrollingTimer in CPTextView)
- Added a missing @import for CPTextContainer.j in CPTextView.j so
it resolves when compiled outside the full framework bundle
- Merged two Platform/DOM/*.j files into their parents to resolve a
build-tool basename collision, preserving the CommonJS fallback path