From ec40268e554796462a71396d0ae752f6d613be03 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Mon, 22 Aug 2011 11:21:55 -0500 Subject: [PATCH 1/5] Working viewport test. Tested on iOS (iPhone and iPad). The viewport is correctly clipped to the screen/browser size and resizing works correctly. This uses the CSS3 Flexible Box Layout model. --- include/mobile.css | 29 ++++++++++++++ tests/viewport.html | 93 +++++++++++++++++++++++++++++++++------------ 2 files changed, 97 insertions(+), 25 deletions(-) create mode 100644 include/mobile.css diff --git a/include/mobile.css b/include/mobile.css new file mode 100644 index 00000000..8ff7a54e --- /dev/null +++ b/include/mobile.css @@ -0,0 +1,29 @@ +.fullscreen { + display: block; + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 100%; + z-index: 9999; + margin: 0; + padding: 0; +} + +.flex-layout { + display: box; + display: -webkit-box; + display: -moz-box; + display: -ms-box; + box-orient: vertical; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-box-orient: vertical; +} +.flex-box { + box-flex: 1; + -webkit-box-flex: 1; + -moz-box-flex: 1; + -ms-box-flex: 1; +} + diff --git a/tests/viewport.html b/tests/viewport.html index 948d1864..b9225f47 100644 --- a/tests/viewport.html +++ b/tests/viewport.html @@ -1,21 +1,37 @@ - Viewport Test + Viewport Test + + + + -

+
- Canvas: - -
- - Canvas not supported. - +
+ Canvas: + +
+
+
+ + Canvas not supported. + +
+
+
+
+ Results:
+ +
+ +
-
- Results:
-