Bug 137376

Summary: Defer resolution of viewport size
Product: WebKit Reporter: Martin Hock <mhock>
Component: WebCore Misc.Assignee: Martin Hock <mhock>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, esprehn+autocc, kangil.han
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
simplify patch, add description to ChangeLog
benjamin: review-
resolve on configuration update benjamin: review+

Martin Hock
Reported 2014-10-02 18:33:57 PDT
Defer resolution of viewport size.
Attachments
patch (21.18 KB, patch)
2014-10-03 14:33 PDT, Martin Hock
no flags
simplify patch, add description to ChangeLog (5.05 KB, patch)
2014-10-05 15:26 PDT, Martin Hock
benjamin: review-
resolve on configuration update (6.27 KB, patch)
2014-10-06 20:18 PDT, Martin Hock
benjamin: review+
Martin Hock
Comment 1 2014-10-03 14:33:24 PDT
Tim Horton
Comment 2 2014-10-03 15:45:17 PDT
Comment on attachment 239238 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=239238&action=review > Source/WebCore/ChangeLog:7 > + Definitely needs more justification here.
Martin Hock
Comment 3 2014-10-05 15:26:46 PDT
Created attachment 239301 [details] simplify patch, add description to ChangeLog
Benjamin Poulain
Comment 4 2014-10-05 15:47:14 PDT
Comment on attachment 239301 [details] simplify patch, add description to ChangeLog View in context: https://bugs.webkit.org/attachment.cgi?id=239301&action=review I believe this is incomplete. There can be no use of m_configuration.width/height without resolving it to a real value. > Source/WebCore/page/ViewportConfiguration.cpp:293 > +double ViewportConfiguration::configLength(double length) const Avoid abbreviations in WebKit. > Source/WebCore/page/ViewportConfiguration.cpp:298 > + if (length == ViewportArguments::ValueDeviceWidth) > + return activeMinimumLayoutSizeInScrollViewCoordinates().width(); > + if (length == ViewportArguments::ValueDeviceHeight) > + return activeMinimumLayoutSizeInScrollViewCoordinates().height(); This is fragile. I would just have 2 getters that resolve the configuration to a real value, for width and height.
Martin Hock
Comment 5 2014-10-06 20:18:27 PDT
Created attachment 239379 [details] resolve on configuration update
Martin Hock
Comment 6 2014-10-06 20:21:54 PDT
(In reply to comment #4) > (From update of attachment 239301 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=239301&action=review > > I believe this is incomplete. There can be no use of m_configuration.width/height without resolving it to a real value. I've refactored it in my new patch to apply when the configuration is changed. > > Source/WebCore/page/ViewportConfiguration.cpp:293 > > +double ViewportConfiguration::configLength(double length) const > > Avoid abbreviations in WebKit. Renamed. > > Source/WebCore/page/ViewportConfiguration.cpp:298 > > + if (length == ViewportArguments::ValueDeviceWidth) > > + return activeMinimumLayoutSizeInScrollViewCoordinates().width(); > > + if (length == ViewportArguments::ValueDeviceHeight) > > + return activeMinimumLayoutSizeInScrollViewCoordinates().height(); > > This is fragile. > > I would just have 2 getters that resolve the configuration to a real value, for width and height. Based on our discussion and the fact that we can set width or height to be device-width or device-height, this logic seems correct.
Benjamin Poulain
Comment 7 2014-10-07 13:24:06 PDT
Comment on attachment 239379 [details] resolve on configuration update LGTM.
Martin Hock
Comment 8 2014-10-07 13:52:35 PDT
Note You need to log in before you can comment on or make changes to this bug.