Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: third_party/polymer/components-chromium/core-layout-trbl/core-slide-extracted.js

Issue 1215543002: Remove Polymer 0.5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/components-chromium/core-layout-trbl/core-slide-extracted.js
diff --git a/third_party/polymer/components-chromium/core-layout-trbl/core-slide-extracted.js b/third_party/polymer/components-chromium/core-layout-trbl/core-slide-extracted.js
deleted file mode 100644
index 17b46f052f31ba2211db593d9fa82043b3f2eb85..0000000000000000000000000000000000000000
--- a/third_party/polymer/components-chromium/core-layout-trbl/core-slide-extracted.js
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
- Polymer('core-slide', {
-
- closed: false,
- open: true,
- vertical: false,
- targetId: '',
- target: null,
-
- ready: function() {
- this.setAttribute('nolayout', '');
- },
-
- attached: function() {
- this.target = this.parentNode;
- },
-
- targetIdChanged: function() {
- var p = this.parentNode;
- while (p.parentNode) {p = p.parentNode;};
- this.target = p.querySelector('#' + this.targetId);
- },
-
- targetChanged: function() {
- if (this.closed) {
- this.asyncMethod(this.update);
- }
- },
-
- toggle: function() {
- this.open = !this.open;
- },
-
- closedChanged: function() {
- this.open = !this.closed;
- },
-
- openChanged: function() {
- this.asyncMethod(this.update);
- },
-
- update: function() {
- this.closed = !this.open;
- if (this.target) {
- if (this.vertical) {
- if (this.target.style.top !== '') {
- this.updateTop();
- } else {
- this.updateBottom();
- }
- } else {
- if (this.target.style.left !== '') {
- this.updateLeft();
- } else {
- this.updateRight();
- }
- }
- }
- },
-
- updateLeft: function() {
- var w = this.target.offsetWidth;
- var l = this.open ? 0 : -w;
- this.target.style.left = l + 'px';
- var s = this.target.nextElementSibling;
- while (s) {
- if (!s.hasAttribute('nolayout')) {
- if (s.style.left === '' && s.style.right !== '') {
- break;
- }
- l += w;
- s.style.left = l + 'px';
- w = s.offsetWidth;
- }
- s = s.nextElementSibling;
- }
- },
-
- updateRight: function() {
- var w = this.target.offsetWidth;
- var r = this.open ? 0 : -w;
- this.target.style.right = r + 'px';
- //var s = this.target.previousElementSibling;
- var s = previousElementSibling(this.target);
- while (s) {
- if (!s.hasAttribute('nolayout')) {
- if (s.style.right === '' && s.style.left !== '') {
- break;
- }
- r += w;
- s.style.right = r + 'px';
- w = s.offsetWidth;
- }
- //if (s == s.previousElementSibling) {
- // console.error(s.localName + ' is its own sibling', s);
- // break;
- //}
- //s = s.previousElementSibling;
- s = previousElementSibling(s);
- }
- },
-
- updateTop: function() {
- var h = this.target.offsetHeight;
- var t = this.open ? 0 : -h;
- this.target.style.top = t + 'px';
- var s = this.target.nextElementSibling;
- while (s) {
- if (!s.hasAttribute('nolayout')) {
- if (s.style.top === '' && s.style.bottom !== '') {
- break;
- }
- t += h;
- s.style.top = t + 'px';
- h = s.offsetHeight;
- }
- s = s.nextElementSibling;
- }
- },
-
- updateBottom: function() {
- var h = this.target.offsetHeight;
- var b = this.open ? 0 : -h;
- this.target.style.bottom = b + 'px';
- //var s = this.target.previousElementSibling;
- var s = previousElementSibling(this.target);
- while (s) {
- if (!s.hasAttribute('nolayout')) {
- if (s.style.bottom === '' && s.style.top !== '') {
- break;
- }
- b = b + h;
- s.style.bottom = b + 'px';
- h = s.offsetHeight;
- }
- //if (s == s.previousElementSibling) {
- // console.error(s.localName + ' is its own sibling', s);
- // break;
- //}
- //s = s.previousElementSibling;
- s = previousElementSibling(s);
- }
- }
-
- });
-
- // TODO(sjmiles): temporary workaround for b0rked property in ShadowDOMPolyfill
- function previousElementSibling(e) {
- do {
- e = e.previousSibling;
- } while (e && e.nodeType !== Node.ELEMENT_NODE);
- return e;
- };
-
-

Powered by Google App Engine
This is Rietveld 408576698