Commit Graph
338 Commits
Author SHA1 Message Date
David Richardson eda11e38ba Merge main: Tests/Manual revival, functional fixes
Merges 71 commits from main. Headline content: the Tests/Manual
integration test suite revived and reorganized after long disuse
(renames, new applications, updated cibs), restoring a large
integration validation surface. Functional fixes include replacing
unload-based termination with pagehide (back/forward cache
compatibility) and hardening CPTextField's input-element handling.

Conflict resolutions (local versions retained):

- AppKit/CPTextField.j: main's input-element logic carried, with this
  branch's preprocessor-removal sweep re-applied on top. Main's
  conditionals are re-expressed as runtime CPDOMAvailable guards; the
  _inputElement method-definition gate is retained.

- AppKit/Platform/CPPlatform.j: the DOM platform implementation stays
  inlined under the PLATFORM(DOM) gate. The split layout breaks the
  legacy build: the include fragment is compiled standalone by the
  source walk and cannot resolve its superclass. Main's pagehide
  termination fix is ported into the inlined section; the restored
  AppKit/Platform/DOM/CPPlatform.j fragment is deleted.

Verified: legacy build green through Foundation, AppKit and Tools;
Tests/Manual suite passing.
2026-10-01 14:44:51 -06:00
daboe01 bf76c7d2c7 Merge pull request #3241 from daboe01/setBoundsSize-fix
Fixed: scale accumulation in scaleUnitSquareToSize: when setting bounds size
2026-08-27 22:37:45 +02:00
daboe01 301e940236 formatting 2026-08-26 20:56:38 +02:00
David Richardson 45fd97d980 AppKit: complete CPView PLATFORM conditional removal (part 2)
- 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
2026-08-21 15:18:12 -06:00
David Richardson 557e4d7bd2 AppKit: replace PLATFORM(DOM) conditionals with runtime checks (CPView, part 1)
- 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
2026-08-21 15:05:07 -06:00
David Richardson e5c34e3dd7 Remove NativeHost platform target; require CommonJS/Node for tooling
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
2026-08-12 13:25:52 -06:00
David Richardson 1a9a42ff54 Replace #pragma mark with // MARK:
Replace objc directive with native Javascript version // MARK: to facilitate elimination of preproccsing pass.
2026-07-21 15:15:53 -06:00
daboe01 cff2fd8ed9 optimized version 2026-06-20 17:51:11 +02:00
daboe01 e6e676c91e more safety checks 2026-06-20 15:00:21 +02:00
daboe01 5fd2f49266 safety checks 2026-06-20 14:55:27 +02:00
daboe01 10fb3e6d31 Fixed: scale accumulation in scaleUnitSquareToSize: when setting bounds size 2026-06-20 14:35:15 +02:00
daboe01 c7f3dd5b0f Fixed: [CPView addSubview:] was ignoring bounds origin for DOM positioning 2025-12-07 11:21:11 +01:00
Martin Carlberg b92459ba38 Merge pull request #3121 from daboe01/new-CPView-is-missing-rotateByAngle-method
Fixed: CPView was missing rotateByAngle: method
2025-09-12 12:56:13 +02:00
daboe01 51e9737114 improved: documentation 2025-09-11 18:26:53 +02:00
daboe01 a9aa15d63f fixed CALayer class name 2025-06-26 17:52:11 +02:00
daboe01 e6d2d840e9 fixed: CALayer autocreate 2025-06-26 17:51:26 +02:00
daboe01 4963127c31 formatting 2025-06-26 17:49:36 +02:00
daboe01 0835f18721 new: manual test 2025-06-26 10:01:37 +02:00
daboe01 8231cbc55c fixed: wrong core animation symbol names 2025-06-26 08:01:45 +02:00
daboe01 7d1df21b0e removed unused variable 2025-06-22 22:57:59 +02:00
daboe01 bbb87b4970 removed: wrong code 2025-06-22 22:56:35 +02:00
daboe01 14d9bb795d fixed: wrong code 2025-06-22 22:55:41 +02:00
daboe01 2eb1d1bfb9 fixed: CPView was missing rotateByAngle: method 2025-06-22 22:51:26 +02:00
daboe01 e0a8fa3fde formatting 2025-06-22 21:34:19 +02:00
daboe01 64f4b0fc13 fixed: accidental removal of commented out code 2025-06-22 21:32:48 +02:00
daboe01 c28a05e968 fixed logic 2025-06-22 21:28:37 +02:00
daboe01 170d6ac2e7 fixed wrong logic 2025-06-22 21:19:03 +02:00
daboe01 64cc36a1ac new logic 2025-06-22 21:06:47 +02:00
daboe01 af61bcb93f fixed: wrong logic 2025-06-22 20:45:55 +02:00
daboe01 1f24e89c1b fixed wrong logic 2025-06-22 20:35:11 +02:00
daboe01 b12aee53d3 fixed: subview's window setting mus happen BEFORE _setSuperview 2025-06-22 19:47:19 +02:00
daboe01 f642330306 new: support for releasedWhenClosed in CPWindow 2023-12-23 19:08:38 +01:00
Michael Bach 6c6f69d4e5 CPView.j, fix typo: _ephereralSubviews → _ephemeralSubviews
This typo occurs only once, line #3462 references the correct spelling.
2022-11-01 18:04:21 +01:00
Martin Carlberg 3e83bd2363 Revert "Fixed: Before this PR, nib2cib failed if a color well or a scrollable text view was added in a CPBox (#2994)"
This reverts commit 6544aff88e.
2022-03-21 16:25:24 +01:00
Didier Korthoudt 48e786e8b5 Fixed: This PR adapts views and custom views decoding to fix "not ready view" bugs (#2917) 2022-03-21 15:50:44 +01:00
David Siaw 73eeda3c09 Fixed: strange lines that appear in Google Chrome (#2863) 2022-03-21 15:14:14 +01:00
Didier Korthoudt 6544aff88e Fixed: Before this PR, nib2cib failed if a color well or a scrollable text view was added in a CPBox (#2994) 2022-03-21 13:29:31 +01:00
Didier Korthoudt 37756a5853 Fixed: nib2cib: checks if there's a defined superview in resizeWithOldSuperviewSize (#2995) 2021-11-23 13:47:54 +01:00
Didier Korthoudt 87719f1161 Fixed: Adds the missing isCSSBased method for CPView (#2945) 2020-10-12 08:51:49 +02:00
Didier Korthoudt 5724868c5a Fixed: restorePreviousCSSState method for CPColor must be a class method for internal reasons (#2912) 2020-10-02 10:58:20 +02:00
Martin Carlberg 7397e681f4 Fixed: Removed old unused line from a bad manual merge 2020-05-04 13:42:37 +02:00
Didier Korthoudt e7d5afe90e New: Added dynamic attributes set for CSS based themes (#2701) 2020-04-06 13:10:34 +02:00
Didier Korthoudt a4ef18ddab FIXED: Before this PR, only CPControl could use nib2cib-adjustment-frame. (#2831) 2020-03-11 10:17:14 +01:00
Martin Carlberg 7dc77ed609 Fixed: Make sure we handle undefined when testing for nil values (#2862) 2020-01-31 13:43:58 +01:00
Martin Carlberg 109003ae12 Fixed: Performance improvement on visibleRect when updating tracking areas (#2881)
Calculations of the visible rect can be a heavy operation as it depends of the superviews
visible rect. They have to be transformed and intersected together to create the result.
This calculation is a recursive operation that travels up the view hierarchy all the way
to the top.

Updating the tracking areas is also a recursive operation. But it travels down the view hierarchy
instead. It will calculate the new tracking area using the visible rect for the current view. For
each view it updates it will get the visible rect that has to travel all the way up the view
hierarchy to calculate it by transform and intersect them together. This results in that the visible
rect will be calculated for each view multible times. This makes it a very slow operation, specially
for deeper view hierarchies.

This fix will send along the visible rect for the superview when traveling down the
view hierarchy. This means that the visible rect does not need to travel up the view hierarchy
to be calculated. It will just need transform and intersect the provided rect for its superview
with the one from itself.
2020-01-06 12:48:40 +01:00
Martin Carlberg 36f1abdbe6 Fixed: CPAppearance has much better performance now when views needs layout. (#2880)
This makes updating views much faster when they need layout. This will make resizing browser window and changing split views sizes much smoother.

The effectiveAppearance is inherited from the superview. The superviews appearance is passed along as it is recomputed down the view hierarchy.
Also the current appearance is saved on each view to make it possible to only change the theme states when the appearance is changed.
2020-01-06 12:35:38 +01:00
Martin Carlberg 50519776e0 Fixed: Update Tracking areas only once when doing setFrame: (#2879)
This speed improvement is very notable when resizing a browser window of altering the size of split views.
The fix uses a variable on the window to control when to update the tracking areas.
If the view is not connected to a window the tracking areas will not be updated as they will
be when added to a window.
2020-01-06 12:32:35 +01:00
Didier Korthoudt ad9d8a7200 FIXED: When attaching an externally owned tracking area to a view, view tracking areas were not correctly handled (#2681)
This PR also removes the -removeAllTrackingAreas method.
2018-05-28 20:44:31 +02:00
Didier Korthoudt 20be4a40ea NEW: Add CSS theming support (#2613) 2018-04-27 09:27:01 +02:00
daniel f479d415d8 Formatting: add missing semi-colon in CPView.j 2018-04-04 15:13:03 -07:00