Bug 132537 - [iOS WK2] Turn off position:fixed behavior when the keyboard is up
Summary: [iOS WK2] Turn off position:fixed behavior when the keyboard is up
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-03 17:28 PDT by Simon Fraser (smfr)
Modified: 2014-07-21 16:45 PDT (History)
11 users (show)

See Also:


Attachments
Patch (22.01 KB, patch)
2014-05-03 17:34 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (22.07 KB, patch)
2014-05-03 17:35 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff
Patch (11.18 KB, patch)
2014-07-21 13:34 PDT, Simon Fraser (smfr)
benjamin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2014-05-03 17:28:39 PDT
[iOS WK2] Turn off position:fixed behavior when the keyboard is up
Comment 1 Simon Fraser (smfr) 2014-05-03 17:34:22 PDT
Created attachment 230773 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-05-03 17:35:56 PDT
Created attachment 230774 [details]
Patch
Comment 3 Benjamin Poulain 2014-05-03 18:35:19 PDT
Comment on attachment 230774 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=230774&action=review

Cool!

If you have time, it would be really nice to not freeze the layout in some cases. If you can fix the caret issue, I would be happy to come with the heuristic and fix the animation.

> Source/WebKit2/UIProcess/ios/WKContentView.mm:316
> +        _lastFixedPositionRect = fixedPositionRectFromExposedRect(unobscuredRect, [self bounds].size, zoomScale);

We should rename fixedPositionRectFromExposedRect() to fixedPositionRectFromUnobscuredRect() at some point.

[self bounds].size -> self.bounds.size.

> Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:2105
> +- (BOOL)_hasAssistedNode
> +{
> +    return _assistedNodeInformation.elementType != WKTypeNone;
> +}

Shouldn't you use "isEditable" and/or "isAssistingNode" instead?
Comment 4 Simon Fraser (smfr) 2014-05-04 10:44:24 PDT
There's a problem when moving from one form field in a postion:fixed to the next, so I'll refine this patch.
Comment 5 Jon Lee 2014-05-07 10:50:02 PDT
<rdar://problem/16665614>
Comment 6 Simon Fraser (smfr) 2014-05-30 11:35:48 PDT
Comment on attachment 230774 [details]
Patch

Need to do something better than this.
Comment 7 Simon Fraser (smfr) 2014-07-21 13:34:01 PDT
Created attachment 235244 [details]
Patch
Comment 8 Benjamin Poulain 2014-07-21 14:05:26 PDT
Comment on attachment 235244 [details]
Patch

Looks reasonable.

Can you please force an updateVisibleContentRect from [WKContentView _startAssistingNode:] in if the focus succeed and the AssistedNodeInformation has insideFixedPosition? (if not you could remove insideFixedPosition entirely).
Comment 9 Simon Fraser (smfr) 2014-07-21 16:45:15 PDT
https://trac.webkit.org/r171320