From fc4189f3cffb738a40321aee5e183de35cd05fb6 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Fri, 2 Jan 2015 13:52:45 +0100 Subject: [PATCH 1/7] Typo --- src/HTMLImports/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HTMLImports/boot.js b/src/HTMLImports/boot.js index 206a99f..87afd26 100644 --- a/src/HTMLImports/boot.js +++ b/src/HTMLImports/boot.js @@ -15,7 +15,7 @@ var isIE = scope.isIE; /* NOTE: Even when native HTMLImports exists, the following api is available by -loading the polyfill. This provides api compabitility where the polyfill +loading the polyfill. This provides api compatibility where the polyfill cannot be "correct": * `document._currentScript` From 5f5864dc982a7c09bce2f1bcaf08d2dd1ac68c7b Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Fri, 2 Jan 2015 13:55:47 +0100 Subject: [PATCH 2/7] Typo --- src/HTMLImports/base.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HTMLImports/base.js b/src/HTMLImports/base.js index 7519922..f12f8f8 100644 --- a/src/HTMLImports/base.js +++ b/src/HTMLImports/base.js @@ -62,7 +62,7 @@ Object.defineProperty(rootDocument, '_currentScript', currentScriptDescriptor); Add support for the `HTMLImportsLoaded` event and the `HTMLImports.whenReady` method. This api is necessary because unlike the native implementation, script elements do not force imports to resolve. Instead, users should wrap - code in either an `HTMLImportsLoaded` hander or after load time in an + code in either an `HTMLImportsLoaded` handler or after load time in an `HTMLImports.whenReady(callback)` call. NOTE: This module also supports these apis under the native implementation. From 38bcdd15fb50d774441ae111868a4e68d11ab59b Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Wed, 14 Jan 2015 10:56:55 -0800 Subject: [PATCH 3/7] prepare for 0.5.3 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e8c495c..d8fce91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webcomponents.js", - "version": "0.5.1-1", + "version": "0.5.3", "description": "webcomponents.js", "main": "gulpfile.js", "directories": { From b87c8f4ce0e512e909fccd0ad3c579abf8527889 Mon Sep 17 00:00:00 2001 From: AJ Ortega Date: Fri, 16 Jan 2015 12:42:47 -0800 Subject: [PATCH 4/7] Document.matches shouldn't be defined. See https://github.com/webcomponents/webcomponentsjs/issues/12 for context. --- src/ShadowDOM/wrappers/Document.js | 8 +++++++- tests/ShadowDOM/js/Document.js | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ShadowDOM/wrappers/Document.js b/src/ShadowDOM/wrappers/Document.js index 82c4859..6dee221 100644 --- a/src/ShadowDOM/wrappers/Document.js +++ b/src/ShadowDOM/wrappers/Document.js @@ -242,7 +242,13 @@ 'querySelectorAll', 'removeChild', 'replaceChild', - ].concat(matchesNames)); + ]); + + forwardMethodsToWrapper([ + window.HTMLBodyElement, + window.HTMLHeadElement, + window.HTMLHtmlElement, + ], matchesNames); forwardMethodsToWrapper([ window.HTMLDocument || window.Document, // Gecko adds these to HTMLDocument diff --git a/tests/ShadowDOM/js/Document.js b/tests/ShadowDOM/js/Document.js index 0dcbfe4..45f2453 100644 --- a/tests/ShadowDOM/js/Document.js +++ b/tests/ShadowDOM/js/Document.js @@ -53,6 +53,11 @@ htmlSuite('Document', function() { assert.equal(doc.head.parentNode, doc.documentElement); }); + test('document.matches', function() { + var doc = wrap(document); + assert.isTrue(doc.matches === undefined); + }); + test('getElementsByTagName', function() { var elements = document.getElementsByTagName('body'); assert.isTrue(elements instanceof HTMLCollection); From d53d49770c30d6dd31b11f420eac7166d8ffe6d5 Mon Sep 17 00:00:00 2001 From: Jan Alonzo Date: Sun, 18 Jan 2015 11:39:28 +1100 Subject: [PATCH 5/7] Sync bower version to package version --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 473f8b1..a689f1f 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "webcomponentsjs", "main": "webcomponents.js", - "version": "0.5.1-1", + "version": "0.5.3", "homepage": "http://webcomponents.org", "authors": [ "The Polymer Authors" From 3ceb98fadf01749daa75444097b29cdd52fe2ebd Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Tue, 20 Jan 2015 11:45:04 -0800 Subject: [PATCH 6/7] Fix broken call node removal in normalize removeChild is the correct api Fixes #145 --- src/ShadowDOM/wrappers/Node.js | 2 +- tests/ShadowDOM/js/Node.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/ShadowDOM/wrappers/Node.js b/src/ShadowDOM/wrappers/Node.js index d174de6..c670e91 100644 --- a/src/ShadowDOM/wrappers/Node.js +++ b/src/ShadowDOM/wrappers/Node.js @@ -692,7 +692,7 @@ n = nodes[i]; if (n.nodeType === Node.TEXT_NODE) { if (!modNode && !n.data.length) - this.removeNode(n); + this.removeChild(n); else if (!modNode) modNode = n; else { diff --git a/tests/ShadowDOM/js/Node.js b/tests/ShadowDOM/js/Node.js index a0b9dbe..3fbd142 100644 --- a/tests/ShadowDOM/js/Node.js +++ b/tests/ShadowDOM/js/Node.js @@ -416,6 +416,25 @@ suite('Node', function() { assert.equal(div.childNodes.length, 3); }); + test('normalize - issue 145', function() { + var div = document.createElement('div'); + div.appendChild(document.createTextNode('')); + div.appendChild(document.createTextNode('')); + div.appendChild(document.createTextNode('')); + var childDiv = document.createElement('div'); + childDiv.appendChild(document.createTextNode('')); + childDiv.appendChild(document.createTextNode('')); + div.appendChild(childDiv); + + assert.equal(div.childNodes.length, 4); + assert.equal(childDiv.childNodes.length, 2); + + div.normalize(); + + assert.equal(div.childNodes.length, 1); + assert.equal(childDiv.childNodes.length, 0); + }); + test('appendChild last and first', function() { var a = document.createElement('a'); a.innerHTML = ''; From cd3fe52dbf8b677c1feb1ee3c3aa5c09d821d07b Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Tue, 20 Jan 2015 16:08:07 -0800 Subject: [PATCH 7/7] Wrap SVGElement.ownerSVGElement Fixes #159 --- src/ShadowDOM/wrappers/SVGElement.js | 3 +++ tests/ShadowDOM/js/SVGElement.js | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ShadowDOM/wrappers/SVGElement.js b/src/ShadowDOM/wrappers/SVGElement.js index 366d3fa..5611d87 100644 --- a/src/ShadowDOM/wrappers/SVGElement.js +++ b/src/ShadowDOM/wrappers/SVGElement.js @@ -14,6 +14,7 @@ var Element = scope.wrappers.Element; var HTMLElement = scope.wrappers.HTMLElement; var registerObject = scope.registerObject; + var defineWrapGetter = scope.defineWrapGetter; var SVG_NS = 'http://www.w3.org/2000/svg'; var svgTitleElement = document.createElementNS(SVG_NS, 'title'); @@ -30,5 +31,7 @@ delete Element.prototype.classList; } + defineWrapGetter(SVGElement, 'ownerSVGElement'); + scope.wrappers.SVGElement = SVGElement; })(window.ShadowDOMPolyfill); diff --git a/tests/ShadowDOM/js/SVGElement.js b/tests/ShadowDOM/js/SVGElement.js index 3c889f4..324a322 100644 --- a/tests/ShadowDOM/js/SVGElement.js +++ b/tests/ShadowDOM/js/SVGElement.js @@ -72,4 +72,17 @@ suite('SVGElement', function() { } }); + test('ownerSVGElement', function() { + var el = document.createElementNS(SVG_NS, 'svg'); + var el2 = document.createElementNS(SVG_NS,'svg'); + var g = document.createElementNS(SVG_NS, 'g'); + el.appendChild(g); + + assert.equal(g.ownerSVGElement, el); + + el2.appendChild(g); + + assert.equal(g.ownerSVGElement, el2); + }); + });