   ':visible-x':
     singular: true
     deferred: true
-    Combinator: (node = scope, engine, operation, continuation, scope) ->
+    Pseudo: (node = scope, offset, engine, operation, continuation, scope) ->
+      property = engine.scope.nodeType == 1 && 'computed-width' || 'width'
       ex = engine.data.watch(node,         'computed-x',     operation, continuation, scope)
       ew = engine.data.watch(node,         'computed-width', operation, continuation, scope)
-      sx = engine.data.watch(engine.scope, 'scroll-left',    operation, continuation, scope)
-      sw = engine.data.watch(engine.scope, "#{engine.scope.nodeType == 1 && 'computed-' || ''}height", operation, continuation, scope)
+      sx = engine.data.watch(engine.scope, 'scroll-left',    operation, continuation, scope) - (offset || 0)
+      sw = engine.data.watch(engine.scope, property,         operation, continuation, scope) + (offset || 0)
 
       if (ex <= sx && ex + ew > sx + sw)  || # mid
          (ex > sx && ex < sx + sw)        || # left
-         (ex + ew > sx && ex < sx + sw)      # right
+         (ex + ew > sx && ex + ew < sx + sw) # right
         return node
 
 


  getIndexPrefix: (operation, parent)->
    return parent && ' ' || ''
    
Selector.Virtual = Selector.extend
  signature: [
    [context: ['Selector']]

  ':visible':
    singular: true
    deferred: true
    Pseudo: (node, offset, engine, operation, continuation, scope) ->
      return Selector[':visible-y']::Pseudo.apply(@, arguments) && 
             Selector[':visible-x']::Pseudo.apply(@, arguments)
    
  ':visible-y': 
    singular: true
    deferred: true
    Pseudo: (node = scope, offset, engine, operation, continuation, scope) ->
      property = engine.scope.nodeType == 1 && 'computed-height' || 'height'
      ey = engine.data.watch(node,         'computed-y',      operation, continuation, scope)
      eh = engine.data.watch(node,         'computed-height', operation, continuation, scope)
      sy = engine.data.watch(engine.scope, 'scroll-top',      operation, continuation, scope) - (offset || 0)
      sh = engine.data.watch(engine.scope, property,          operation, continuation, scope) + (offset || 0) * 2

      if (ey <= sy && ey + eh > sy + sh)  || # mid
         (ey > sy && ey < sy + sh)        || # top
         (ey + eh > sy && ey + eh < sy + sh) # bottom
