Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
simplify ‘unresolved’. Now to shim :unresolved, we simply remove an a…
Browse files Browse the repository at this point in the history
…ttribute named unresolved.
  • Loading branch information
sorvell committed Nov 15, 2013
1 parent 94288d1 commit fdcbf08
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"../MutationObservers/build.json",
"src/scope.js",
"src/unresolved.js",
"src/MutationObserver.js",
"src/Observer.js",
"src/CustomElements.js",
Expand Down
1 change: 0 additions & 1 deletion custom-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var thisFile = 'custom-elements.js';
var scopeName = 'CustomElements';
var modules = [
'../MutationObservers/mutation-observers.js',
'src/unresolved.js',
'src/Observer.js',
'src/CustomElements.js',
'src/Parser.js',
Expand Down
2 changes: 2 additions & 0 deletions src/CustomElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ if (useNative) {
if (definition.is) {
element.setAttribute('is', definition.is);
}
// remove 'unresolved' attr, which is a standin for :unresolved.
element.removeAttribute('unresolved');
// make 'element' implement definition.prototype
implement(element, definition);
// flag as upgraded
Expand Down
13 changes: 11 additions & 2 deletions test/js/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,16 @@ suite('upgradeElements', function() {
assert.equal(b.test, 'ybutton');
assert.equal(b.textContent, i);
});


});

// polyfill only tests
if (!CustomElements.useNative) {
test('unresolved attribute removed after upgrade', function() {
work.innerHTML = '<x-res unresolved>Resolved!</x-res>';
registerTestComponent('x-res', 'res');
var xres = work.firstChild;
assert.equal(xres.value, 'res');
assert.isFalse(xres.hasAttribute('unresolved'), 'unresolved is removed after upgrade');
});
}
});

0 comments on commit fdcbf08

Please sign in to comment.