Merge branch 'master' into 3157-kschaaf-domif-textnode

This commit is contained in:
Steven Orvell 2015-12-07 12:58:13 -08:00
commit 1074951c26
17 changed files with 55 additions and 38 deletions

View File

@ -171,7 +171,7 @@ Polymer.CssParse = (function() {
_rx: {
comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,
port: /@import[^;]*;/gim,
customProp: /(?:^[^;\-\s}]+)?--[^;{]*?:[^{};]*?(?:[;\n]|$)/gim,
customProp: /(?:^|[\s;])--[^;{]*?:[^{};]*?(?:[;\n]|$)/gim,
mixinProp: /(?:^|[\s;])?--[^;{]*?:[^{;]*?{[^}]*?}(?:[;\n]|$)?/gim,
mixinApply: /@apply[\s]*\([^)]*?\)[\s]*(?:[;\n]|$)?/gim,
varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,

View File

@ -130,8 +130,8 @@ TODO(sjmiles): this module should produce either syntactic metadata
this._notes = this._template._content._notes;
} else {
this._notes = Polymer.Annotations.parseAnnotations(this._template);
this._processAnnotations(this._notes);
}
this._processAnnotations(this._notes);
Polymer.Annotations.prepElement = null;
}
},
@ -188,10 +188,15 @@ TODO(sjmiles): this module should produce either syntactic metadata
if (p.signature) {
var args = p.signature.args;
for (var kk=0; kk<args.length; kk++) {
pp[args[kk].model] = true;
var model = args[kk].model;
if (model) {
pp[model] = true;
}
}
} else {
pp[p.model] = true;
if (p.model) {
pp[p.model] = true;
}
}
}
}

View File

@ -222,8 +222,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
;
// basic argument descriptor
var a = {
name: arg,
model: this._modelForPath(arg)
name: arg
};
// detect literal value (must be String or Number)
var fc = arg[0];
@ -246,6 +245,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
// if not literal, look for structured path
if (!a.literal) {
a.model = this._modelForPath(arg);
// detect structured path (has dots)
a.structured = arg.indexOf('.') > 0;
if (a.structured) {

View File

@ -139,7 +139,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
behaviors: [
Polymer.BehaviorA,
null,
Polymer.BehaviorB
],
@ -260,4 +259,4 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
</script>
</script>

View File

@ -127,6 +127,27 @@ suite('multi-behaviors element', function() {
assert.equal(el.attributes.user.value, 'user', 'Behavior hostAttribute overrode user attribute');
});
test('behaviour is null generates warning', function() {
var warned = false, oldWarn = Polymer.Base._warn;
Polymer.Base._warn = function (message) {
assert.match(message, /behavior is null/);
warned = true;
};
Polymer({
behaviors: [
null
],
is: 'behavior-null'
});
assert.equal(warned, true, 'Null behaviour should generate warning');
Polymer.Base._warn = oldWarn;
});
});

View File

@ -676,7 +676,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noObserver = 42;
assert.equal(warned, true, 'no warning for undefined observer');
@ -686,7 +685,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noComplexObserver = {};
assert.equal(warned, true, 'no warning for undefined complex observer');
@ -696,7 +694,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noComputed = 99;
assert.equal(warned, true, 'no warning for undefined computed function');
@ -706,7 +703,6 @@ suite('warnings', function() {
var warned = false;
el._warn = function() {
warned = true;
warn.apply(el, arguments);
};
el.noInlineComputed = 99;
assert.equal(warned, true, 'no warning for undefined computed function');

View File

@ -116,7 +116,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(tree.rules.length, 4, 'unexpected number of rules');
assert.equal(tree.rules[2].rules.length, 8, 'unexpected number of rules in keyframes');
assert.equal(tree.rules[3].rules.length, 1, 'unexpected number of rules in @media');
console.log('test');
});
test('rule selectors parse', function() {

View File

@ -235,9 +235,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--variable-property-after-property: 3px;
--variable-property-after-assignment: 4px;
--variable-property-before-assignment: 5px;
--variable-into-first-variable: 9px;
--variable-into-second-variable: 10px;
--variable-into-third-variable: 11px;
}
</style>
<child-variable-with-var id="child"></child-variable-with-var>
@ -254,8 +251,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--variable-between-properties: 6px;
background-color: var(--variable-property-before-property); padding-top: var(--variable-property-after-property);
--variable-assignment-before-property: 7px; padding-bottom: var(--variable-property-after-assignment);
padding-left: var(--variable-property-before-assignment);--variable-assignment-after-property: 8px;
top: 12px;--variable-from-other-variable: var(--variable-into-first-variable);--variable-from-another-variable: var(--variable-into-second-variable); --variable-from-last-variable: var(--variable-into-third-variable);
padding-left: var(--variable-property-before-assignment);--variable-assignment-after-property: 8px
}
</style>
<child-of-child-with-var id="child"></child-of-child-with-var>
@ -270,9 +266,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
padding-right: var(--variable-between-properties);
margin-left: var(--variable-assignment-before-property);
margin-right: var(--variable-assignment-after-property);
bottom: var(--variable-from-other-variable);
left: var(--variable-from-another-variable);
right: var(--variable-from-last-variable);
}
</style>
Text
@ -475,16 +468,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assertComputed(el, '7px', 'margin-left');
assertComputed(el, '8px', 'margin-right');
assertComputed(el, 'rgb(255, 255, 0)', 'background-color');
assertComputed(el, '9px', 'bottom');
assertComputed(el, '10px', 'left');
assertComputed(el, '11px', 'right');
assertComputed(el, '12px', 'top');
// Because FireFox and Chrome parse font-family differently...
var computed = getComputedStyle(el);
assert.equal(computed['font-family'].replace(/['"]+/g, ''), 'Varela font');
});
test('BEM-like CSS selectors under media queries', function() {
assertComputed(document.querySelector('.foo--bar'), '3px');
});

View File

@ -1,5 +1,4 @@
<script>
console.log('x-needs-repeat loaded')
Polymer({
is: 'x-needs-host',
ready: function() {
@ -9,4 +8,4 @@ console.log('x-needs-repeat loaded')
this.config = this.dataHost.getAttribute('config');
}
});
</script>
</script>

View File

@ -226,6 +226,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</script>
<link rel="import" href="dom-bind-elements2.html">
<link rel="import" href="should-404.html">
</body>
</html>

View File

@ -103,9 +103,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('errors', function() {
test('items must be array', function() {
assert.throws(function() {
inDocumentRepeater.items = {};
}, /expected array/, 'should warn when items is not array');
var warned = false;
inDocumentRepeater._error = function(message) {
assert.match(message, /expected array/)
warned = true;
}
inDocumentRepeater.items = {};
assert.equal(warned, true, 'should warn when items is not array');
});
});

View File

@ -94,7 +94,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
#gc4 {
--grand-child-scope-var:
--grand-child-scope-var:
var(--gc4-scope);
}
</style>
@ -286,7 +286,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
</script>
</dom-module>
<dom-module id="x-scope">
<style>
:host {
@ -439,14 +439,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
</style>
<template>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-inside'
});
});
});
</script>
</dom-module>
@ -679,7 +679,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// test('var values can be overridden by subsequent concrete properties', function() {
// assertComputed(styled.$.overridesConcrete, '4px');
// });
});
</script>

0
test/unit/sub/foo.png Normal file
View File

0
test/unit/sub/foo.z Normal file
View File

0
test/unit/sub/google.png Normal file
View File

View File

@ -11,6 +11,7 @@
obj="{{obj}}"
obj-prop="{{obj.prop}}"
conflict="{{outerInnerConflict.prop}}"
computed-from-literal="{{computeFromLiteral(33, prop)}}"
></x-child>
</template>
</x-templatizer>
@ -238,7 +239,8 @@
],
outerObjChanged: function() {},
objAChanged: function() {},
objBChanged: function() {}
objBChanged: function() {},
computeFromLiteral: function() {}
});
</script>

View File

@ -250,6 +250,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(childA.conflict, 'bar');
});
test('ensure literals are not forwarded to templates', function() {
assert.notOk(host._propertyEffects[33]);
assert.notOk(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(host), 33));
});
});
</script>