If one observer of a notification centre notification removed another observer, that other observer would still be notified even that it was no longer observing.
Now the code agrees with its comments.
Switch to cookie based user defaults if HTML 5 local storage exists but is disabled, as is the case when Safari is in 'private browsing' mode.
Don't crash if the local storage quota is reached. Instead log a warning and silently fail to store the new user default.
Fixed: if the split view delegate sent non numeric responses when asked to constrain divider positions, subviews would be resized with corrupt size information, which in turn could lead to infinite loops and redraw errors. These bad results are now handled more gracefully.
When multiple calls are nested, only the first willChange… and the last didChange… will notify observers, avoiding duplicate notifications for the same change.
- Test application.
CPControl
---------
- Moved _formatter declaration up next to value, it was in the Target-Action Support section before.
- sendAction:to: should return a BOOL.
- Support for CPFormatter -editingStringForObjectValue.
- If a nil string is passed to -setStringValue in Cocoa, it raises an invalid parameter assertion and does nothing.
- Per Cocoa, if setting a string value fails, it tries again with an empty string.
- Removed a few extra blank lines.
- Changed NULL to nil.
CPTextField
-----------
- The string value is now cached in _stringValue to avoid constant calls to the formatter.
- There were several places where references to _inputElement were not wrapped with #if PLATFORM(DOM).
- When resigning first responder, if there is a formatter and formatting fails, reject the resignation and keep focus. Also, if the delegate responds to control:didFailToFormatString:errorDescription:, invoke it.
- _willBecomeFirstResponderByClick was not being set to NO when resigning. As a result, if you clicked in a field, tabbed to another field, and tabbed back to the original field, it would not select the text because it thought there was a mouse click.
- Don't send _sendStringValue: in keyUp: if the value has not changed. Previously it would do that for non-printing keys like navigation keys.
- insertNewLine: validates the string the same way resigning does.
- insertNewLine: would not send textDidEndEditing: if the field had no action, but it should.
- insertNewLine: should select all text (per Cocoa).
- insertNewLineIgnoringFieldEditor: and insertTabIgnoringFieldEditor: were not replacing the selection, Cocoa docs say they should.
- Per Cocoa, when setting an object value and there is a formatter, the value is first formatted as a string. If that fails, an object value for an empty string is attempted.
CPFormatter
-----------
- Fixed up the docs to match the method signatures.
- Indicated with "Ref" in argument types if the argument is pass by reference.
- isPartialStringValid:newEditingString:errorDescription: has a default implementation in Cocoa that nils the return values and returns YES.
- Fixed the name of isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:
- isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription: has a default implementation in Cocoa that invokes isPartialStringValid:newEditingString:errorDescription:
1. Fix infinite recursion when no superclass and method isn't implemented. Closes#469.
2. Fix infinite recursion when coercing an object without description implemented into a string. Closes#1289.
3. Add -forwardingTargetForSelector: support.
Reviewed by @tolmasky.
- It turns out doxygen would not generate documentation for the first method in a file (or sometimes any methods at all) if there was no ivar block or an empty ivar block. Now a dummy __doxygen__ ivar is inserted in empty blocks to force correct behavior.
- Added a missing @endverbatim to CPExpression.j.
- Tweaked class documentation for CPPredicate.j.
Before this commit we would fail gracefully for single keys. For key paths an application would crash because we would try to get the forwarder property of an undefined object. This commit makes sure we don't attempt any removal and logs a warning (just like Cocoa) about the attempt to remove an unregistered observer.