Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only use column-gap if not forceColumns. Test for floatIgnoresColumns.

  • Loading branch information...
commit 7a77d2d2ee63d4858e305e6b6652125eaaf896fb 1 parent 40e4a3a
@joseph joseph authored
Showing with 10 additions and 9 deletions.
  1. +7 −6 src/compat/env.js
  2. +3 −3 src/dimensions/columns.js
View
13 src/compat/env.js
@@ -280,10 +280,14 @@ Monocle.Env = function () {
// Webkit-based browsers put floated elements in the wrong spot when
// columns are used -- they appear way down where they would be if there
// were no columns. Presumably the float positions are calculated before
- // the columns. A bug has been lodged.
+ // the columns. A bug has been lodged, and it's fixed in recent WebKits.
//
- // FIXME: Detection not yet implemented.
- ["floatsIgnoreColumns", testNotYetImplemented(false)],
+ ["floatsIgnoreColumns", function () {
+ if (!Monocle.Browser.is.WebKit) { return result(false); }
+ match = navigator.userAgent.match(/AppleWebKit\/([\d\.]+)/);
+ if (!match) { return result(false); }
+ return result(match[1] < "534.30");
+ }],
// The latest engines all agree that if a body is translated leftwards,
// its scrollWidth is shortened. But some older WebKits (notably iOS4)
@@ -316,8 +320,6 @@ Monocle.Env = function () {
// In iOS, the frame is clipped by overflow:hidden, so this doesn't seem to
// be a problem.
//
- // TODO: Is there a way to detect this?
- //
["relativeIframeExpands", function () {
result(navigator.userAgent.indexOf("Android 2") >= 0);
}],
@@ -338,7 +340,6 @@ Monocle.Env = function () {
// min-width is set, it's more difficult to recognise 1 page components,
// so we generally don't want to force it unless we have to.
//
- // FIXME: This is not detecting correctly for iOS3.
["forceColumns", function () {
loadTestFrame(function (fr) {
var bd = fr.contentDocument.body;
View
6 src/dimensions/columns.js
@@ -9,6 +9,9 @@ Monocle.Dimensions.Columns = function (pageDiv) {
width: 0
}
+ // Logically, forceColumn browsers can't have a gap, because that would
+ // make the minWidth > 200%. But how much greater? Not worth the effort.
+ k.GAP = Monocle.Browser.env.forceColumns ? 0 : 20;
function update(callback) {
setColumnWidth();
@@ -197,7 +200,6 @@ Monocle.Dimensions.Columns.STYLE = {
"height": "100%",
"width": "100%",
"position": "absolute"
- /*"-webkit-transform-style": "preserve-3d"*/
},
"column-force": {
"min-width": "200%",
@@ -205,6 +207,4 @@ Monocle.Dimensions.Columns.STYLE = {
}
}
-Monocle.Dimensions.Columns.GAP = 20;
-
Monocle.pieceLoaded("dimensions/columns");
Please sign in to comment.
Something went wrong with that request. Please try again.