- 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
- 10 PLATFORM blocks resolved across three files: runtime
CPDOMAvailable guards (6 wrapped, 3 early returns, 1 sequential
guard-return preserving the CommonJS result)
- CPApplication: @global CPWindowObjectList 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
- 13 PLATFORM blocks resolved across the six date picker files;
mechanical translation to runtime CPDOMAvailable guards
- the recurring _invokedByUserEvent YES/NO sandwich around
_setDateValue translated as paired single-statement guards
- two stale "Workaround: added if PLATFORM(DOM)" comments updated
to name the runtime guard
- work-in-progress towards complete removal of CPP directives
- ivar block ungated: _DOMImageElement, _DOMTextElement,
_DOMTextShadowElement now declared under both targets
- 5 method-body PLATFORM blocks resolved: setAlignment and
setSelectedRange via early return, layoutSubviews wrapped whole
(420 lines, _flags reset kept ungated), setTextColor wrapped,
textFrame as a compound condition
- work-in-progress towards complete removal of CPP directives
- 4 PLATFORM blocks resolved: DOM element creation in init, display
context setup, sublayer DOM insertion, and the _CALayerUpdateDOM
helper translated to runtime CPDOMAvailable guards (3 wrapped, 1
early return)
- two #define macros (DOM, ADJUST_CONTENTS_ZINDEX) remain; they belong
to the planned macro pass
- work-in-progress towards complete removal of CPP directives
- ivar block ungated: DOM window/element handles, event state, pasteboard
and touch-tracking ivars now declared under both targets (nil when no
DOM is present)
- supportsMultipleInstances and isVisible: PLATFORM/#else pairs
translated to sequential CPDOMAvailable guard-returns preserving the
CommonJS result (NO)
- init, setContentRect, moveWindow and setTitle blocks translated to
runtime guards (wrapped, early return, compound condition)
- work-in-progress towards complete removal of CPP directives
- file-scope input-state variables ungated (11 module-locals, previously
browser-only); method-body translations reference them under runtime
guards only
- 7 method-body PLATFORM blocks resolved: 3 compound conditions, 2
wrapped, 1 early return
- the method-definition gate around _inputElement remains, held for the
structural-design phase with the CPTextField and CPTextView gates
- work-in-progress towards complete removal of CPP directives
- 11 PLATFORM blocks resolved;
- @import "CPCompatibility.j" added for the CPDOMAvailable predicate
- no preprocessor directives remain in this file
- work-in-progress towards complete removal of CPP directives
- CPControl.j and CPSlider.j: one PLATFORM block each, resolved to
runtime CPDOMAvailable guards; no preprocessor directives remain
in either file
- work-in-progress towards complete removal of CPP directives
- CPScreen.j and CPColor.j: one PLATFORM block each, resolved to
runtime CPDOMAvailable guards; no preprocessor directives remain
in either file
- work-in-progress towards complete removal of CPP directives
- CPImageView.j: all 12 PLATFORM blocks resolved; mechanical
translation to runtime CPDOMAvailable guards (wrapped, compound,
early-return); no preprocessor directives remain in this file
- work-in-progress towards complete removal of CPP directives
- CPTextField.j: 14 PLATFORM blocks resolved; mechanical translation
to runtime CPDOMAvailable guards (wrapped, compound, early-return,
one runtime if/else); one site used a nonstandard directive
spelling (#if PLATFORM (DOM), space before the parenthesis),
normalized and resolved with the rest
- The method-definition gate around _inputElement remains, out of
scope for this change
- work-in-progress towards complete removal of CPP directives
- CPWindow.j: 16 of 17 PLATFORM blocks resolved; purely mechanical
translation to runtime CPDOMAvailable guards (wrapped or compound),
one ivar un-gated; one latent no-return bug preserved as-is
- The PLATFORM(BROWSER) import gate remains, out of scope for this change
- work-in-progress towards complete removal of CPP directives
- CPView.j: remaining 17 PLATFORM blocks resolved; purely mechanical
translation to runtime CPDOMAvailable guards, except the choice of
guard form (wrapped, compound, or early-return) per site
- No PLATFORM(DOM) conditionals remain in CPView.j; one #if DEBUG
block remains and is out of scope for this change
- work-in-progress towards complete removal of CPP directives
- Add CPDOMAvailable to CPCompatibility.j: canonical documented DOM capability test, bare global assignment
- CPView.j: 13 of 30 PLATFORM blocks resolved. Method bodies now
guarded at runtime (wrapped, compound, or early-return forms); DOM vars and ivars declared without resort to CPP conditionals
- work-in-progress towards complete removal of CPP directives
CPFontPanel.j used _CPFontPanelPreviewView as an ivar type and instantiated it before its own @implementation, later in the same file, with no forward declaration. Added @class _CPFontPanelPreviewView, alongside the file's existing forward declarations.
This removes all build warnings.
CPParagraphStyle.j defined CPTabStopType's four constants directly, with a comment noting they were "missing" but no @typedef for the type itself.
_CPRTFParser.j uses CPTabStopType as an ivar type and imports CPParagraphStyle.j directly, so the fix belongs in the defining file.
Added the missing @typedef CPTabStopType, same pattern as CPRulerOrientation.
CPRulerView.j declared CPRulerOrientation's constants directly,
with only a comment claiming it was a typedef.
No @typedef directive existed, so the type was unknown wherever used as an ivar or parameter type.
Added the missing @typedef CPRulerOrientation, matching the pattern already used for CPTextAlignment in CPText.j.
CPRulerView.j referenced CPTextTab (isKindOfClass: and alloc/init) without a declaration.
Added @class CPTextTab; to resolve the symbol reference. A forward declaration was utilized rather than importing CPParagraphStyle.j to minimize dependency coupling, despite the absence of a circular import risk.
Resolves build warning.
Replaced the CPTextView.j import with forward declarations for CPTextView and CPTextContainer (the latter previously reached via the removed import).
The previous import graph created a circular dependency (_CPTableTextAttachment.j -> CPTextView.j -> _CPRTFParser.j / _CPRTFProducer.j -> _CPTableTextAttachment.j).
This caused the legacy compiler to emit a class registration warning during clean builds, as the class was unregistered at the time of resolution. Incremental builds masked this warning via cached symbol tables.
Using forward declarations breaks the cycle and ensures warning-free clean and incremental builds.
CPRulerView.j did not import CPScrollView.
A direct import would create a cycle, since CPScrollView.j already imports CPRulerView.j.
Added a forward declaration instead.
CPOutlineView.j used CPTreeNode before AppKit.j imported it. This
triggered build warnings. This commit adds an import.
- Add @import "CPTreeNode.j" to CPOutlineView.j.
While addressing this warning, CPTreeNode was audited and found to have an algorithmic complexity regression and multiple structural inconsistencies in the KVO support code.
The test suite for CPTreeNode was Spartan in the extreme.
All of these have been addressed - see inline notes for details.
CPTreeNode is subject to further audit.
CPStackView.j emited warnings during builds and tests which constituted
either real errors or indeterminate state.
These included four types that did not exist: CPUserInterfaceLayoutOrientation, CPLayoutAttribute,
CPEdgeInsets, and CPMapTable.
The missing types are now present.
- Add local typedefs for CPUserInterfaceLayoutOrientation and
CPLayoutAttribute. Numeric values match the equivalent Cocoa
constants.
- Add CPEdgeInsets as an alias for the existing CGInset struct.
Add CPEdgeInsetsMake and CPEdgeInsetsEqualToEdgeInsets.
- Import Foundation/CPMapTable.j. CPMapTable already exists in
Foundation.
This commit also fixes two logic errors found during review.
- arrangedSubviews did not match the true view order after
insert or remove. Add _rebuildArrangedSubviews and call it
from every method that changes view order.
- Trailing-gravity layout added one extra spacing gap past the
last view. This shifted the returned layout boundary. Spacing
is now added before each view, not after.
This commit adds one new property.
- Add a distribution property with storage and accessors. It
has no effect on layout yet. This makes the property honest:
before this change, the type existed but no property did.
The manual test, ./Tests/Manual/CPStackViewTest, used a Narwhal-era
Jakefile and would not build. This has been updated to reflect
usage under the Node toolchain.
This commit adds CPStackView.j to AppKit.j. The file was never
imported. Only the build script's wildcard file list included
it.
This commit adds a header comment to CPStackView.j. The comment
states that the class is a placeholder. It lists known
limitations. It states that a constraint-solver based
replacement is planned.
Why: CPStackView must compile and pass tests before capp-build
can use this tree as a build reference, and a class with unstated
limits invites misuse.
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
- Create Foundation/_CPFoundationUtilities.j to house global low-level utilities.
- Implement CPIsNumeric as a concrete JavaScript function, preserving the exact legacy logic.
- Import _CPFoundationUtilities.j in the Foundation.j umbrella manifest.
- Replace _IS_NUMERIC macro calls at all call sites with CPIsNumeric().