As part of the ongoing technical debt cleanup, this commit modernizes
CPPlatformPasteboard.j by removing its reliance on the C-preprocessor
and stripping obsolete Internet Explorer compatibility code.
Key changes:
- Inlined the `SUPPRESS_CAPPUCCINO_CUT_FOR_EVENT` and `SUPPRESS_CAPPUCCINO_PASTE_FOR_EVENT`
macros directly to standard property assignments.
- Removed the IE `srcElement` fallback in `hasEditableTarget`.
- Removed the IE `attachEvent`/`detachEvent` branch in `createDOMElements`,
keeping only the standard `addEventListener` path.
- Replaced `var` with `const` and `let` for proper block scoping and immutability.
- Retained the `#if PLATFORM(DOM)` guards to protect the Node.js CI during
the phased modernization effort.
All changes are annotated with `// MODIFICATION:` comments for clear
review tracking.
The default was to make the first window in the most background layer the key window if nothing else was used.
This does not work well if there is a modal window that should have all the attention.
This solution will first choose the modal window if in modal mode. If not the old variant is used.
This was present in a CPTextView.
A press on caps lock should also result in a flagsChanged event.
An event should have the corresponding flag for caps lock in modifierFlags.
Method _mayRequireDOMPasteboardElementHack:flags had return type of void, despite returning a BOOL value, and also being annotated with a doc comment stating that it should return a BOOL value
Also some methods had return type "boolean", should possibly be BOOL
Missing semi-colon on line 1425.
Removed redundant `var` modifier on already declared variable on line
947.
Added variable declaration to variable used without declaration on line
970.
Removed redundant `var` modifier on already declared variable
`CPDOMEventGetClickCount` removed var on latter declaration as original
declaration has note stating it is to be declared at top so “so
compressor knows about them.”
Without this fix, tapping on the screen while the virtual keyboard of iOS was open, and it had forced scrolling (due to the input being low on the screen), would cause incorrect mouse event locations. So you might tap on a text field below your current field to edit it and something entirely different would get selected.