RESOLVED FIXED 103737
CSS Device Adaptation: window.innerWidth returns wrong value if CSS viewport descriptors are applied
https://bugs.webkit.org/show_bug.cgi?id=103737
Summary CSS Device Adaptation: window.innerWidth returns wrong value if CSS viewport ...
Mikhail Pozdnyakov
Reported 2012-11-30 05:52:32 PST
Created attachment 176950 [details] test window.innerWidth should return valid value, when CSS viewport descriptors applied. Test is attached.
Attachments
test (998 bytes, text/html)
2012-11-30 05:52 PST, Mikhail Pozdnyakov
no flags
Test showing it works after scrolling (1.26 KB, text/html)
2012-11-30 06:27 PST, Kenneth Rohde Christiansen
no flags
patch (11.39 KB, patch)
2012-12-02 04:25 PST, Mikhail Pozdnyakov
kenneth: review-
kenneth: commit-queue-
patch v2 (12.26 KB, patch)
2012-12-03 00:13 PST, Mikhail Pozdnyakov
no flags
Kenneth Rohde Christiansen
Comment 1 2012-11-30 06:27:03 PST
Created attachment 176958 [details] Test showing it works after scrolling
Mikhail Pozdnyakov
Comment 2 2012-12-02 04:25:58 PST
Created attachment 177137 [details] patch Might need splitting as it actually solves two problems: 1) initial viewport size detection in webcore 2) appropriate frame view initialization in WK2 WebPage However those fixes are very close so put them the same patch so far.
Kenneth Rohde Christiansen
Comment 3 2012-12-02 06:00:32 PST
Comment on attachment 177137 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=177137&action=review > Source/WebCore/ChangeLog:10 > + descriptrors. Viewport descriptrors from new stylesheet were applied to the visibleContentRect spelling > Source/WebCore/page/FrameView.h:583 > +#if ENABLE(CSS_DEVICE_ADAPTATION) > + // Size of viewport before CSS viewport descriptors are applied. > + IntSize m_initialViewportSize; > +#endif Isn't it better to use the description from the spec? also link to the spec in the changelog > Source/WebKit2/ChangeLog:10 > + descriptrors. Viewport descriptrors from new stylesheet were applied to the visibleContentRect spelling > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1038 > contentFixedSize.scale(1 / m_page->deviceScaleFactor()); > +#if ENABLE(CSS_DEVICE_ADAPTATION) I would add a newline before this
Kenneth Rohde Christiansen
Comment 4 2012-12-02 06:01:50 PST
Comment on attachment 177137 [details] patch I would like some tests that uses a non-1.0 deviceScaleFactor. I think it is possible to change that in tests.
Kenneth Rohde Christiansen
Comment 5 2012-12-02 06:02:28 PST
Another question, doesn't this affect viewport meta as well? That would affect the ifdef's
Mikhail Pozdnyakov
Comment 6 2012-12-02 11:23:24 PST
(In reply to comment #5) > Another question, doesn't this affect viewport meta as well? That would affect the ifdef's I don't think it is possible to set/unset viewport meta properties for the same doc, so not I guess
Mikhail Pozdnyakov
Comment 7 2012-12-03 00:13:02 PST
Created attachment 177197 [details] patch v2 Took Kenneth feedback into consideration.
WebKit Review Bot
Comment 8 2012-12-03 01:23:13 PST
Comment on attachment 177197 [details] patch v2 Clearing flags on attachment: 177197 Committed r136373: <http://trac.webkit.org/changeset/136373>
WebKit Review Bot
Comment 9 2012-12-03 01:23:17 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.