stylus-source 0.41.0 → 0.41.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bc25bf64229cb7a5b88f91652c80fce9221c418
4
- data.tar.gz: b61839581185e9cf961ef398f12a5a58c99840fe
3
+ metadata.gz: 0da3837b5a10b414fbb523315a3b063b991a2128
4
+ data.tar.gz: 4ac5f533a2c295655371b692d30bcec8710dcf17
5
5
  SHA512:
6
- metadata.gz: 3f9ee44003e1e0d285459cc622c6e2f46fbad96d59af16de9df4791089077fc5752b3a46ade4507ffe5d59fb966682c022fe3b2ad6fa5f842c9d935a5a71057b
7
- data.tar.gz: 7381b865c290243fe2495b0a296287557f903e0bbe47559ac8344ca42b27324a9dbe3e2365c8909f0830813b34708738aaedf9d16c6221be512e076d72707a3c
6
+ metadata.gz: f2d6c0f2593ebe2d7fd5bd61381bf2728ae0ad824f44174271a9a0f531c5ed902a36ca42117138de0093aa70e71fcc1f3d6680f4420c743e9b9ab97da4994500
7
+ data.tar.gz: 8339b72b05ecc3531a9a01e37cd2091ffd50929d2a1a691e277397617d61ecc1042b5a6720526ab2d560dba76dab052c5254283fc1261de7cb919880ae821bdb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.41.0
1
+ 0.41.1
@@ -71,6 +71,7 @@ module.exports = function(options) {
71
71
  url = parse(url);
72
72
  var ext = extname(url.pathname)
73
73
  , mime = mimes[ext]
74
+ , hash = url.hash || ''
74
75
  , literal = new nodes.Literal('url("' + url.href + '")')
75
76
  , paths = _paths.concat(this.paths)
76
77
  , buf;
@@ -101,7 +102,7 @@ module.exports = function(options) {
101
102
  if (false !== sizeLimit && buf.length > sizeLimit) return literal;
102
103
 
103
104
  // Encode
104
- return new nodes.Literal('url("data:' + mime + ';base64,' + buf.toString('base64') + '")');
105
+ return new nodes.Literal('url("data:' + mime + ';base64,' + buf.toString('base64') + hash + '")');
105
106
  };
106
107
 
107
108
  fn.raw = true;
@@ -47,6 +47,23 @@ Block.prototype.__defineGetter__('hasProperties', function(){
47
47
  }
48
48
  });
49
49
 
50
+ /**
51
+ * Check if this block has bubbling nodes.
52
+ *
53
+ * @return {Boolean}
54
+ * @api public
55
+ */
56
+
57
+ Block.prototype.__defineGetter__('hasBubbling', function(){
58
+ for (var i = 0, len = this.nodes.length; i < len; ++i) {
59
+ var nodeName = this.nodes[i].nodeName;
60
+ if ('media' == nodeName || 'fontface' == nodeName) {
61
+ return true;
62
+ }
63
+ }
64
+ return false;
65
+ });
66
+
50
67
  /**
51
68
  * Check if this block is empty.
52
69
  *
data/vendor/lib/utils.js CHANGED
@@ -350,7 +350,6 @@ exports.compileSelectors = function(arr, leaveHidden){
350
350
  function compile(arr, i) {
351
351
  if (i) {
352
352
  arr[i].forEach(function(selector){
353
- selector.val = selector.val || selector.toString();
354
353
  if (!leaveHidden && selector.val.match(hiddenSelectorRegexp)) return;
355
354
  if (selector.inherits) {
356
355
  buf.unshift(selector.val);
@@ -362,7 +361,6 @@ exports.compileSelectors = function(arr, leaveHidden){
362
361
  });
363
362
  } else {
364
363
  arr[0].forEach(function(selector){
365
- selector.val = selector.val || selector.toString();
366
364
  if (!leaveHidden && selector.val.match(hiddenSelectorRegexp)) return;
367
365
  var str = interpolateParent(selector, buf);
368
366
  if (~str.indexOf('&')) str = str.replace(/&/g, '').trim();
@@ -679,8 +679,10 @@ Evaluator.prototype.visitIf = function(node){
679
679
  }
680
680
  }
681
681
 
682
- // mixin conditional statements within a selector group
683
- if (ret && !node.postfix && block.node && 'group' == block.node.nodeName) {
682
+ // mixin conditional statements within
683
+ // a selector group, @font-face block or @page block
684
+ if (ret && !node.postfix && block.node
685
+ && ~['group', 'fontface', 'page'].indexOf(block.node.nodeName)) {
684
686
  this.mixin(ret.nodes, block);
685
687
  return nodes.null;
686
688
  }
@@ -810,6 +812,7 @@ Evaluator.prototype.invokeFunction = function(fn, args, content){
810
812
  // Clone the function body
811
813
  // to prevent mutation of subsequent calls
812
814
  var body = fn.block.clone();
815
+ body.scope = fn.block.hasBubbling;
813
816
 
814
817
  // mixin block
815
818
  var mixinBlock = this.stack.currentFrame.block;
@@ -1177,11 +1180,13 @@ Evaluator.prototype.__defineGetter__('currentSelector', function(){
1177
1180
  for (var i = 0, len = this.stack.length; i < len; ++i) {
1178
1181
  block = this.stack[i].block;
1179
1182
  if (block.node && 'group' == block.node.nodeName) {
1183
+ block.node.nodes.forEach(function(selector) {
1184
+ if (!selector.val) selector.val = this.interpolate(selector);
1185
+ }, this);
1180
1186
  stack.push(block.node.nodes);
1181
1187
  }
1182
1188
  }
1183
- if (!stack.length) return '&';
1184
- return utils.compileSelectors(stack).join(',');
1189
+ return stack.length ? utils.compileSelectors(stack).join(',') : '&';
1185
1190
  });
1186
1191
 
1187
1192
  /**
@@ -1223,9 +1228,13 @@ Evaluator.prototype.interpolate = function(node){
1223
1228
  case 'unit':
1224
1229
  return node.val;
1225
1230
  case 'expression':
1231
+ // Prevent cyclic `selector()` calls.
1232
+ var selectorCall = ('call' == node.first.nodeName && 'selector' == node.first.name);
1233
+ if (selectorCall && this._selector) return this._selector;
1226
1234
  self.return++;
1227
1235
  var ret = toString(self.visit(node).first);
1228
1236
  self.return--;
1237
+ if (selectorCall) this._selector = ret;
1229
1238
  return ret;
1230
1239
  }
1231
1240
  }
@@ -29,9 +29,5 @@
29
29
  "url": "https://github.com/substack/node-mkdirp/issues"
30
30
  },
31
31
  "_id": "mkdirp@0.3.5",
32
- "dist": {
33
- "shasum": "3ca8fc91ed924e281236eec99e74505873ac5a45"
34
- },
35
- "_from": "mkdirp@0.3.x",
36
- "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz"
32
+ "_from": "mkdirp@0.3.x"
37
33
  }
@@ -35,5 +35,9 @@
35
35
  "url": "https://github.com/isaacs/node-glob/issues"
36
36
  },
37
37
  "_id": "glob@3.2.3",
38
- "_from": "glob@3.2.3"
38
+ "dist": {
39
+ "shasum": "d8225c774cac17a9d50c83e739b3b9ac0f2216cf"
40
+ },
41
+ "_from": "glob@3.2.3",
42
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.3.tgz"
39
43
  }
@@ -34,9 +34,5 @@
34
34
  "url": "https://github.com/visionmedia/should.js/issues"
35
35
  },
36
36
  "_id": "should@3.1.2",
37
- "dist": {
38
- "shasum": "4bc206253d736c2fb902153477982c2b2e988c02"
39
- },
40
- "_from": "should@*",
41
- "_resolved": "https://registry.npmjs.org/should/-/should-3.1.2.tgz"
37
+ "_from": "should@*"
42
38
  }
data/vendor/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stylus",
3
3
  "description": "Robust, expressive, and feature-rich CSS superset",
4
- "version": "0.41.0",
4
+ "version": "0.41.1",
5
5
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
6
6
  "keywords": [
7
7
  "css",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylus-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.41.0
4
+ version: 0.41.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Holowaychuk