Bug 130631

Summary: [iOS][WK2] Micro-optimize view state updates on the UIProcess side
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

Description Benjamin Poulain 2014-03-21 20:20:38 PDT
[iOS][WK2] Micro-optimize view state updates on the UIProcess side
Comment 1 Benjamin Poulain 2014-03-21 20:23:14 PDT
Created attachment 227528 [details]
Patch
Comment 2 Darin Adler 2014-03-22 08:03:01 PDT
Comment on attachment 227528 [details]
Patch

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

> Source/WebKit2/UIProcess/ios/WKContentView.mm:240
> +    return (FloatRect)FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(unobscuredRect), roundedLayoutSize(FloatSize(documentSize)), scale, false, StickToViewportBounds);

What is the (FloatRect) here for? Doesn’t this compile without it?

Also, why FloatSize(documentSize)? Doesn’t this compile without the explicit FloatSize()?
Comment 3 Benjamin Poulain 2014-03-24 12:43:32 PDT
Thanks for the review!

(In reply to comment #2) 
> What is the (FloatRect) here for? Doesn’t this compile without it?

No idea, I'll try.

> Also, why FloatSize(documentSize)? Doesn’t this compile without the explicit FloatSize()?

The conversions between native types and WebCore types are explicit when they have side effects.
Comment 4 Benjamin Poulain 2014-03-24 13:51:40 PDT
Committed r166188: <http://trac.webkit.org/changeset/166188>
Comment 5 Anders Carlsson 2014-03-24 14:04:12 PDT
(In reply to comment #2)
> (From update of attachment 227528 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=227528&action=review
> 
> > Source/WebKit2/UIProcess/ios/WKContentView.mm:240
> > +    return (FloatRect)FrameView::rectForViewportConstrainedObjects(enclosingLayoutRect(unobscuredRect), roundedLayoutSize(FloatSize(documentSize)), scale, false, StickToViewportBounds);
> 

Can we put this code somewhere else instead of on FrameView? It's very awkward to have UI process code call member functions on FrameView.