Ranges are passed as a pair of uint64_t numbers over IPC, and we pass NSNotFound as is. This is unfortunate in many ways: 1. Code that is otherwise cross-platform becomes Objective-C only because of NSNotFound. 2. We sometimes get NSNotFound confused with WTF::notFound, which has a different numeric value. All cross-platform code like TextIterator::getLocationAndLengthFromRange uses notFound, but we never convert it to NSNotFound when returning over API boundary. 3. Argument lists get longer than they need to be.
Created attachment 226991 [details] proposed patch
Attachment 226991 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/EditingRange.h:64: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Total errors found: 1 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 226991 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=226991&action=review > Source/WebKit2/Shared/EditingRange.h:67 > + if (location != NSNotFound) > + return NSMakeRange(location, length); > + else > + return NSMakeRange(NSNotFound, 0); if (location == notFound) return NSMakeRange(NSNotFound, 0); return NSMakeRange(location, length);
Committed <http://trac.webkit.org/r165823>.