From 8ac207f5fbd2ca5094acb067db53c31101a32d6f Mon Sep 17 00:00:00 2001 From: Anthony Wikkerink Date: Fri, 16 Jun 2017 16:47:43 -0400 Subject: [PATCH 1/4] Hybridize Dependencies --- .gitignore | 6 ++++-- bower.json | 17 ++++++++++++++--- d2l-dom.html | 6 ++++++ demo/dom-focus.html | 4 ++-- package.json | 16 +++++++--------- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index ee7cd60..4bb5e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -bower_components -node_modules/ +bower_components +bower_components-1.x +bower-1.x.json +node_modules/ diff --git a/bower.json b/bower.json index 2da3a46..77edf55 100644 --- a/bower.json +++ b/bower.json @@ -10,10 +10,21 @@ "package.json" ], "dependencies": { - "polymer": "^1.5.0" + "polymer": "Polymer/polymer#1.9 - 2.0" }, "devDependencies": { - "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.1.5", - "web-component-tester": "^4.2.2" + "iron-test-helpers": "PolymerElements/iron-test-helpers#1 - 2", + "web-component-tester": "^6.0.0" + }, + "variants": { + "1.x": { + "dependencies": { + "polymer": "Polymer/polymer#^1.9.1" + }, + "devDependencies": { + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.4.1", + "web-component-tester": "^5.0.0" + } + } } } diff --git a/d2l-dom.html b/d2l-dom.html index 21b9055..636e4de 100644 --- a/d2l-dom.html +++ b/d2l-dom.html @@ -27,6 +27,8 @@ if (node.tagName === 'CONTENT') { nodes = node.getDistributedNodes(); + } else if (node.tagName === 'SLOT') { + nodes = node.assignedNodes({flatten: true}); } else { if (node.shadowRoot) { node = node.shadowRoot; @@ -53,6 +55,10 @@ } } + if (node.assignedSlot) { + return node.assignedSlot; + } + if (node.parentNode) { return node.parentNode; } else if (node.host) { diff --git a/demo/dom-focus.html b/demo/dom-focus.html index 2e4a734..c02bbfd 100644 --- a/demo/dom-focus.html +++ b/demo/dom-focus.html @@ -1,7 +1,7 @@ D2L DOM Focus - + + diff --git a/demo/dom-focus.html b/demo/dom-focus.html index c02bbfd..10851a9 100644 --- a/demo/dom-focus.html +++ b/demo/dom-focus.html @@ -12,37 +12,12 @@ + - - - - -

d2l-dom-focus

focus order