diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebKit/mac/WebView/WebHTMLRepresentation.mm | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebKit/mac/WebView/WebHTMLRepresentation.mm')
-rw-r--r-- | WebKit/mac/WebView/WebHTMLRepresentation.mm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm index 39489e8..41ce9f9 100644 --- a/WebKit/mac/WebView/WebHTMLRepresentation.mm +++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm @@ -39,6 +39,7 @@ #import "WebKitStatisticsPrivate.h" #import "WebNSAttributedStringExtras.h" #import "WebNSObjectExtras.h" +#import "WebTypesInternal.h" #import "WebView.h" #import <Foundation/NSURLResponse.h> #import <WebCore/Document.h> @@ -337,7 +338,27 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element) - (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element { - return core([_private->dataSource webFrame])->searchForLabelsBeforeElement(labels, core(element)); + return [self searchForLabels:labels beforeElement:element resultDistance:0 resultIsInCellAbove:0]; +} + +- (NSString *)searchForLabels:(NSArray *)labels beforeElement:(DOMElement *)element resultDistance:(NSUInteger*)outDistance resultIsInCellAbove:(BOOL*)outIsInCellAbove +{ + size_t distance; + bool isInCellAbove; + + NSString *result = core([_private->dataSource webFrame])->searchForLabelsBeforeElement(labels, core(element), &distance, &isInCellAbove); + + if (outDistance) { + if (distance == notFound) + *outDistance = NSNotFound; + else + *outDistance = distance; + } + + if (outIsInCellAbove) + *outIsInCellAbove = isInCellAbove; + + return result; } - (NSString *)matchLabels:(NSArray *)labels againstElement:(DOMElement *)element |