+# pass a node (not an element) for a tag
+# returns if this is the sort of tag that cares about leading/trailing whitespace
+# FIXME this probably doesn't work all the time
+is_whitespace_significant = (n) ->
+ if n.name is 'textarea'
+ return true
+ if n.name is 'pre'
+ return true
+ if n.el.currentStyle?
+ return n.el.currentStyle['white-space'].substr(0, 3) is 'pre'
+ else
+ return window.getComputedStyle(n.el, null).getPropertyValue('white-space').substr(0, 3) is 'pre'
+
+# Pass return value from dom event handlers to this.
+# If they return false, this will addinionally stop propagation and default.
+event_return = (e, bool) ->
+ if bool is false
+ if e.stopPropagation?
+ e.stopPropagation()
+ if e.preventDefault?
+ e.preventDefault()
+ return bool