Commit d78c189f authored by justincohen's avatar justincohen Committed by Commit Bot

[ios] Remove hitTest UIKit workaround.

leftView bug appears fixed in iOS 9 and 10.

BUG=546295
TEST=make sure tapping near (usually 50px to the right) the omnibox leftView (page info) doesn't incorrectly fire it.

Review-Url: https://codereview.chromium.org/2917703003
Cr-Commit-Position: refs/heads/master@{#476290}
parent 76c23fae
...@@ -790,26 +790,7 @@ NSString* const kOmniboxFadeAnimationKey = @"OmniboxFadeAnimation"; ...@@ -790,26 +790,7 @@ NSString* const kOmniboxFadeAnimationKey = @"OmniboxFadeAnimation";
// will also activate the text field. // will also activate the text field.
if (point.y < 0) if (point.y < 0)
point.y = 0; point.y = 0;
UIView* view = [super hitTest:point withEvent:event]; return [super hitTest:point withEvent:event];
// For some reason when the |leftView| has interaction enabled, hitTest
// returns the leftView even when |point| is 50 pixels to the right. Tapping
// the hint text will fire the leftView, causing b/6281652. Fails especially
// on iPad and iPhone devices in landscape mode.
// TODO(crbug.com/546295): Check to see if this UIKit bug is fixed, and remove
// this workaround.
UIView* leftView = [self leftView];
if (leftView) {
if (leftView == view && !CGRectContainsPoint([leftView frame], point)) {
return self;
} else if ([self leftViewMode] == UITextFieldViewModeAlways) {
CGRect targetFrame = CGRectInset([leftView frame], -5, -5);
if (CGRectContainsPoint(targetFrame, point)) {
return leftView;
}
}
}
return view;
} }
- (BOOL)isTextFieldLTR { - (BOOL)isTextFieldLTR {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment