Bug 130631 - [iOS][WK2] Micro-optimize view state updates on the UIProcess side
Summary: [iOS][WK2] Micro-optimize view state updates on the UIProcess side
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: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-21 20:20 PDT by Benjamin Poulain
Modified: 2014-03-24 14:04 PDT (History)
1 user (show)

See Also:


Attachments
Patch (7.34 KB, patch)
2014-03-21 20:23 PDT, Benjamin Poulain
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.