RESOLVED FIXED 50982
ViewportArguments.h uses an enum to intialize a bool
https://bugs.webkit.org/show_bug.cgi?id=50982
Summary ViewportArguments.h uses an enum to intialize a bool
Evan Martin
Reported 2010-12-13 15:02:34 PST
r69316 changed userScalable from a float to a bool. However, userScalable is initialized from an enum in the constructor, and the enum value is ValueAuto (-1). This produces a compiler warning and probably isn't doing what we want. third_party/WebKit/WebCore/dom/ViewportArguments.h(78) : warning C4305: 'initializing' : truncation from '' to 'bool'
Attachments
Patch (1.15 KB, patch)
2010-12-23 12:25 PST, Evan Martin
no flags
Evan Martin
Comment 1 2010-12-23 12:25:33 PST
Evan Martin
Comment 2 2010-12-23 12:26:58 PST
I don't really know what I'm doing so please review carefully. But I figure -1 is also true so this should be the same thing(?).
Kenneth Rohde Christiansen
Comment 3 2010-12-23 12:37:22 PST
Well ValueAuto means that it is unset and thus will use the default (which might depend on some of the other values). I guess the most right thing is to make userScalable a float and convert it to true or false in the compute* method. For instance if I set min-scale = 1.0 and max-scale = 1.0, it is basically not scalable, but I guess the iPhone might still consider it scalable, as it affects more than just the scale change. From docs: Setting user-scalable to no also prevents a webpage from scrolling when entering text in an input field.
Evan Martin
Comment 4 2010-12-23 13:16:58 PST
Kenneth, what do you think of the patch I uploaded? It at least doesn't change the current behavior of the code. I'm reluctant to try to change the semantics of userScalable since I don't really understand what it means or how it's used.
Kenneth Rohde Christiansen
Comment 5 2010-12-23 15:09:34 PST
(In reply to comment #4) > Kenneth, what do you think of the patch I uploaded? It at least doesn't change the current behavior of the code. I'm reluctant to try to change the semantics of userScalable since I don't really understand what it means or how it's used. It is fine, as you said it should give the correct behavior. Thanks for doing this.
WebKit Commit Bot
Comment 6 2010-12-23 20:32:04 PST
Comment on attachment 77358 [details] Patch Clearing flags on attachment: 77358 Committed r74610: <http://trac.webkit.org/changeset/74610>
WebKit Commit Bot
Comment 7 2010-12-23 20:32:10 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.