diff options
Diffstat (limited to 'Source/WebKit/mac/WebView/WebHTMLView.mm')
-rw-r--r-- | Source/WebKit/mac/WebView/WebHTMLView.mm | 138 |
1 files changed, 65 insertions, 73 deletions
diff --git a/Source/WebKit/mac/WebView/WebHTMLView.mm b/Source/WebKit/mac/WebView/WebHTMLView.mm index ec5ff51..ff1c400 100644 --- a/Source/WebKit/mac/WebView/WebHTMLView.mm +++ b/Source/WebKit/mac/WebView/WebHTMLView.mm @@ -104,6 +104,7 @@ #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/Range.h> #import <WebCore/RenderWidget.h> +#import <WebCore/RenderView.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebCore/SelectionController.h> #import <WebCore/SharedBuffer.h> @@ -311,7 +312,7 @@ static void setNeedsDisplayInRect(NSView *self, SEL cmd, NSRect invalidRect) NSRect invalidRectInWebFrameViewCoordinates = [enclosingWebFrameView convertRect:invalidRect fromView:self]; IntRect invalidRectInFrameViewCoordinates(invalidRectInWebFrameViewCoordinates); if (![enclosingWebFrameView isFlipped]) - invalidRectInFrameViewCoordinates.setY(frameView->frameRect().size().height() - invalidRectInFrameViewCoordinates.bottom()); + invalidRectInFrameViewCoordinates.setY(frameView->frameRect().size().height() - invalidRectInFrameViewCoordinates.maxY()); frameView->invalidateRect(invalidRectInFrameViewCoordinates); } @@ -347,16 +348,6 @@ const float _WebHTMLViewPrintingMinimumShrinkFactor = 1.25; // behavior matches MacIE and Mozilla, at least) const float _WebHTMLViewPrintingMaximumShrinkFactor = 2; -// This number determines how short the last printed page of a multi-page print session -// can be before we try to shrink the scale in order to reduce the number of pages, and -// thus eliminate the orphan. -#define LastPrintedPageOrphanRatio 0.1f - -// This number determines the amount the scale factor is adjusted to try to eliminate orphans. -// It has no direct mathematical relationship to LastPrintedPageOrphanRatio, due to variable -// numbers of pages, logic to avoid breaking elements, and CSS-supplied hard page breaks. -#define PrintingOrphanShrinkAdjustment 1.1f - #define AUTOSCROLL_INTERVAL 0.1f // Any non-zero value will do, but using something recognizable might help us debug some day. @@ -438,7 +429,7 @@ static CachedResourceClient* promisedDataClient() #endif @interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick. -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent; +- (void)_setPrinting:(BOOL)printing minimumPageLogicalWidth:(float)minPageWidth logicalHeight:(float)minPageHeight maximumPageLogicalWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent; @end @class NSTextInputContext; @@ -482,7 +473,6 @@ struct WebHTMLViewInterpretKeyEventsParameters { BOOL closed; BOOL ignoringMouseDraggedEvents; BOOL printing; - BOOL avoidingPrintOrphan; BOOL paginateScreenContent; BOOL observingMouseMovedNotifications; BOOL observingSuperviewNotifications; @@ -1091,7 +1081,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursive { - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1103,7 +1093,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -1114,7 +1104,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_clearPrintingModeRecursive { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1126,7 +1116,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -1137,7 +1127,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursiveAndAdjustViewSize { - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1149,7 +1139,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -2212,7 +2202,7 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) maximumPageWidth = 0; } - [self _setPrinting:YES minimumPageWidth:minimumPageWidth height:minimumPageHeight maximumPageWidth:maximumPageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:minimumPageWidth logicalHeight:minimumPageHeight maximumPageLogicalWidth:maximumPageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; return YES; } @@ -2222,25 +2212,28 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) if (!frame) return NO; - float minLayoutWidth = 0; - float minLayoutHeight = 0; - float maxLayoutWidth = 0; + Document* document = frame->document(); + bool isHorizontal = !document || !document->renderView() || document->renderView()->style()->isHorizontalWritingMode(); + + float minLayoutLogicalWidth = isHorizontal ? pageWidth : pageHeight; + float minLayoutLogicalHeight = isHorizontal ? pageHeight : pageWidth; + float maxLayoutLogicalWidth = minLayoutLogicalWidth; // If we are a frameset just print with the layout we have onscreen, otherwise relayout // according to the page width. - if (!frame->document() || !frame->document()->isFrameSet()) { - minLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMinimumShrinkFactor : pageWidth; - minLayoutHeight = shrinkToFit ? pageHeight * _WebHTMLViewPrintingMinimumShrinkFactor : pageHeight; - maxLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMaximumShrinkFactor : pageWidth; + if (shrinkToFit && (!frame->document() || !frame->document()->isFrameSet())) { + minLayoutLogicalWidth *= _WebHTMLViewPrintingMinimumShrinkFactor; + minLayoutLogicalHeight *= _WebHTMLViewPrintingMinimumShrinkFactor; + maxLayoutLogicalWidth *= _WebHTMLViewPrintingMaximumShrinkFactor; } - [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:minLayoutLogicalWidth logicalHeight:minLayoutLogicalHeight maximumPageLogicalWidth:maxLayoutLogicalWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; return YES; } - (void)_endPrintMode { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; } - (BOOL)_isInScreenPaginationMode @@ -2254,25 +2247,28 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) if (!frame) return NO; - CGFloat minLayoutWidth = 0; - CGFloat minLayoutHeight = 0; - CGFloat maxLayoutWidth = 0; + Document* document = frame->document(); + bool isHorizontal = !document || !document->renderView() || document->renderView()->style()->isHorizontalWritingMode(); + + float minLayoutLogicalWidth = isHorizontal ? pageSize.width : pageSize.height; + float minLayoutLogicalHeight = isHorizontal ? pageSize.height : pageSize.width; + float maxLayoutLogicalWidth = minLayoutLogicalWidth; - // If we are a frameset just print with the layout we have on the screen. Otherwise do a relayout + // If we are a frameset just print with the layout we have onscreen, otherwise relayout // according to the page width. - if (!frame->document() || !frame->document()->isFrameSet()) { - minLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.width; - minLayoutHeight = shrinkToFit ? pageSize.height * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.height; - maxLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMaximumShrinkFactor : pageSize.width; + if (shrinkToFit && (!frame->document() || !frame->document()->isFrameSet())) { + minLayoutLogicalWidth *= _WebHTMLViewPrintingMinimumShrinkFactor; + minLayoutLogicalHeight *= _WebHTMLViewPrintingMinimumShrinkFactor; + maxLayoutLogicalWidth *= _WebHTMLViewPrintingMaximumShrinkFactor; } - [self _setPrinting:[self _isInPrintMode] minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:YES]; + [self _setPrinting:[self _isInPrintMode] minimumPageLogicalWidth:minLayoutLogicalWidth logicalHeight:minLayoutLogicalHeight maximumPageLogicalWidth:maxLayoutLogicalWidth adjustViewSize:YES paginateScreenContent:YES]; return YES; } - (void)_endScreenPaginationMode { - [self _setPrinting:[self _isInPrintMode] minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:NO]; + [self _setPrinting:[self _isInPrintMode] minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:YES paginateScreenContent:NO]; } - (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit @@ -3128,7 +3124,7 @@ WEBCORE_COMMAND(yankAndSelect) // Do a layout, but set up a new fixed width for the purposes of doing printing layout. // minPageWidth==0 implies a non-printing layout -- (void)layoutToMinimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustingViewSize:(BOOL)adjustViewSize +- (void)layoutToMinimumPageWidth:(float)minPageLogicalWidth height:(float)minPageLogicalHeight maximumPageWidth:(float)maxPageLogicalWidth adjustingViewSize:(BOOL)adjustViewSize { if (![self _needsLayout]) return; @@ -3144,9 +3140,12 @@ WEBCORE_COMMAND(yankAndSelect) return; if (FrameView* coreView = coreFrame->view()) { - if (minPageWidth > 0.0) - coreView->forceLayoutForPagination(FloatSize(minPageWidth, minPageHeight), maxPageWidth / minPageWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize); - else { + if (minPageLogicalWidth > 0.0) { + FloatSize pageSize(minPageLogicalWidth, minPageLogicalHeight); + if (coreFrame->document() && coreFrame->document()->renderView() && !coreFrame->document()->renderView()->style()->isHorizontalWritingMode()) + pageSize = FloatSize(minPageLogicalHeight, minPageLogicalWidth); + coreView->forceLayoutForPagination(pageSize, maxPageLogicalWidth / minPageLogicalWidth, adjustViewSize ? Frame::AdjustViewSize : Frame::DoNotAdjustViewSize); + } else { coreView->forceLayout(!adjustViewSize); if (adjustViewSize) coreView->adjustViewSize(); @@ -3888,7 +3887,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // Does setNeedsDisplay:NO as a side effect when printing is ending. // pageWidth != 0 implies we will relayout to a new width -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent +- (void)_setPrinting:(BOOL)printing minimumPageLogicalWidth:(float)minPageLogicalWidth logicalHeight:(float)minPageLogicalHeight maximumPageLogicalWidth:(float)maxPageLogicalWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent { if (printing == _private->printing && paginateScreenContent == _private->paginateScreenContent) return; @@ -3901,7 +3900,7 @@ static BOOL isInPasswordField(Frame* coreFrame) WebFrame *subframe = [subframes objectAtIndex:i]; WebFrameView *frameView = [subframe frameView]; if ([[subframe _dataSource] _isDocumentHTML]) { - [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize paginateScreenContent:paginateScreenContent]; + [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:adjustViewSize paginateScreenContent:paginateScreenContent]; } } @@ -3909,8 +3908,6 @@ static BOOL isInPasswordField(Frame* coreFrame) _private->pageRects = nil; _private->printing = printing; _private->paginateScreenContent = paginateScreenContent; - if (!printing && !paginateScreenContent) - _private->avoidingPrintOrphan = NO; Frame* coreFrame = core([self _frame]); if (coreFrame) { @@ -3924,7 +3921,7 @@ static BOOL isInPasswordField(Frame* coreFrame) } [self setNeedsLayout:YES]; - [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; + [self layoutToMinimumPageWidth:minPageLogicalWidth height:minPageLogicalHeight maximumPageWidth:maxPageLogicalWidth adjustingViewSize:adjustViewSize]; if (!printing) { // Can't do this when starting printing or nested printing won't work, see 3491427. [self setNeedsDisplay:NO]; @@ -3944,7 +3941,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // If the WebHTMLView itself is what we're printing, then we will never have to do this. BOOL wasInPrintingMode = _private->printing; if (!wasInPrintingMode) - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; *newBottom = [self _adjustedBottomOfPageWithTop:oldTop bottom:oldBottom limit:bottomLimit]; @@ -3955,23 +3952,30 @@ static BOOL isInPasswordField(Frame* coreFrame) [self performSelector:@selector(_delayedEndPrintMode:) withObject:currenPrintOperation afterDelay:0]; else // not sure if this is actually ever invoked, it probably shouldn't be - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; } } - (float)_scaleFactorForPrintOperation:(NSPrintOperation *)printOperation { - float viewWidth = NSWidth([self bounds]); - if (viewWidth < 1) { - LOG_ERROR("%@ has no width when printing", self); + bool useViewWidth = true; + Frame* coreFrame = core([self _frame]); + if (coreFrame) { + Document* document = coreFrame->document(); + if (document && document->renderView()) + useViewWidth = document->renderView()->style()->isHorizontalWritingMode(); + } + + float viewLogicalWidth = useViewWidth ? NSWidth([self bounds]) : NSHeight([self bounds]); + if (viewLogicalWidth < 1) { + LOG_ERROR("%@ has no logical width when printing", self); return 1.0f; } float userScaleFactor = [printOperation _web_pageSetupScaleFactor]; float maxShrinkToFitScaleFactor = 1.0f / _WebHTMLViewPrintingMaximumShrinkFactor; - float shrinkToFitScaleFactor = [printOperation _web_availablePaperWidth] / viewWidth; - float shrinkToAvoidOrphan = _private->avoidingPrintOrphan ? (1.0f / PrintingOrphanShrinkAdjustment) : 1.0f; - return userScaleFactor * max(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor) * shrinkToAvoidOrphan; + float shrinkToFitScaleFactor = (useViewWidth ? [printOperation _web_availablePaperWidth] : [printOperation _web_availablePaperHeight]) / viewLogicalWidth; + return userScaleFactor * max(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor); } // FIXME 3491344: This is a secret AppKit-internal method that we need to override in order @@ -3985,8 +3989,8 @@ static BOOL isInPasswordField(Frame* coreFrame) // This is used for Carbon printing. At some point we might want to make this public API. - (void)setPageWidthForPrinting:(float)pageWidth { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; - [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:NO minimumPageLogicalWidth:0 logicalHeight:0 maximumPageLogicalWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageLogicalWidth:pageWidth logicalHeight:0 maximumPageLogicalWidth:pageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; } - (void)_endPrintModeAndRestoreWindowAutodisplay @@ -4050,9 +4054,10 @@ static BOOL isInPasswordField(Frame* coreFrame) float totalScaleFactor = [self _scaleFactorForPrintOperation:printOperation]; float userScaleFactor = [printOperation _web_pageSetupScaleFactor]; [_private->pageRects release]; + float fullPageWidth = floorf([printOperation _web_availablePaperWidth] / totalScaleFactor); float fullPageHeight = floorf([printOperation _web_availablePaperHeight] / totalScaleFactor); WebFrame *frame = [self _frame]; - NSArray *newPageRects = [frame _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight]; + NSArray *newPageRects = [frame _computePageRectsWithPrintScaleFactor:userScaleFactor pageSize:NSMakeSize(fullPageWidth, fullPageHeight)]; // AppKit gets all messed up if you give it a zero-length page count (see 3576334), so if we // hit that case we'll pass along a degenerate 1 pixel square to print. This will print @@ -4060,19 +4065,6 @@ static BOOL isInPasswordField(Frame* coreFrame) // the behavior of IE and Camino at least. if ([newPageRects count] == 0) newPageRects = [NSArray arrayWithObject:[NSValue valueWithRect:NSMakeRect(0, 0, 1, 1)]]; - else if ([newPageRects count] > 1) { - // If the last page is a short orphan, try adjusting the print height slightly to see if this will squeeze the - // content onto one fewer page. If it does, use the adjusted scale. If not, use the original scale. - float lastPageHeight = NSHeight([[newPageRects lastObject] rectValue]); - if (lastPageHeight/fullPageHeight < LastPrintedPageOrphanRatio) { - NSArray *adjustedPageRects = [frame _computePageRectsWithPrintWidthScaleFactor:userScaleFactor printHeight:fullPageHeight * PrintingOrphanShrinkAdjustment]; - // Use the adjusted rects only if the page count went down - if ([adjustedPageRects count] < [newPageRects count]) { - newPageRects = adjustedPageRects; - _private->avoidingPrintOrphan = YES; - } - } - } _private->pageRects = [newPageRects retain]; @@ -6200,7 +6192,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag wrap:(BOOL)wrapFlag startInSelection:(BOOL)startInSelection { - return [self _findString:string options:(forward ? 0 : WebFindOptionsBackwards) | (caseFlag ? 0 : WebFindOptionsCaseInsensitive) | (startInSelection ? WebFindOptionsStartInSelection : 0)]; + return [self _findString:string options:(forward ? 0 : WebFindOptionsBackwards) | (caseFlag ? 0 : WebFindOptionsCaseInsensitive) | (wrapFlag ? WebFindOptionsWrapAround : 0) | (startInSelection ? WebFindOptionsStartInSelection : 0)]; } @end |