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

Side by Side Diff: pkg/custom_element/lib/custom-elements.debug.js

Issue 112433002: update our CustomElement+Shadow DOM patch (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/custom_element/lib/custom-elements.min.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Polymer Authors. All rights reserved. 1 // Copyright (c) 2012 The Polymer Authors. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are 4 // modification, are permitted provided that the following conditions are
5 // met: 5 // met:
6 // 6 //
7 // * Redistributions of source code must retain the above copyright 7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above 9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer 10 // copyright notice, this list of conditions and the following disclaimer
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 } else { 1435 } else {
1436 var loadEvent = window.HTMLImports ? 'HTMLImportsLoaded' : 1436 var loadEvent = window.HTMLImports ? 'HTMLImportsLoaded' :
1437 document.readyState == 'loading' ? 'DOMContentLoaded' : 'load'; 1437 document.readyState == 'loading' ? 'DOMContentLoaded' : 'load';
1438 window.addEventListener(loadEvent, bootstrap); 1438 window.addEventListener(loadEvent, bootstrap);
1439 } 1439 }
1440 1440
1441 })(window.CustomElements); 1441 })(window.CustomElements);
1442 1442
1443 (function() { 1443 (function() {
1444 // Patch to allow custom element and shadow dom to work together, from: 1444 // Patch to allow custom element and shadow dom to work together, from:
1445 // https://github.com/Polymer/platform/blob/master/src/patches-shadowdom-polyfil l.js 1445 // https://github.com/Polymer/platform-dev/blob/60ece8c323c5d9325cbfdfd6e8cd180d 4f38a3bc/src/patches-shadowdom-polyfill.js
1446 // include .host reference 1446 // include .host reference
1447 if (HTMLElement.prototype.createShadowRoot) { 1447 if (HTMLElement.prototype.createShadowRoot) {
1448 var originalCreateShadowRoot = HTMLElement.prototype.createShadowRoot; 1448 var originalCreateShadowRoot = HTMLElement.prototype.createShadowRoot;
1449 HTMLElement.prototype.createShadowRoot = function() { 1449 HTMLElement.prototype.createShadowRoot = function() {
1450 var root = originalCreateShadowRoot.call(this); 1450 var root = originalCreateShadowRoot.call(this);
1451 root.host = this; 1451 root.host = this;
1452 CustomElements.watchShadow(this);
1452 return root; 1453 return root;
1453 } 1454 }
1454 } 1455 }
1455 1456
1456 1457
1457 // Patch to allow custom elements and shadow dom to work together, from: 1458 // Patch to allow custom elements and shadow dom to work together, from:
1458 // https://github.com/Polymer/platform-dev/blob/2bb9c56d90f9ac19c2e65cdad368668a ff514f14/src/patches-custom-elements.js 1459 // https://github.com/Polymer/platform-dev/blob/2bb9c56d90f9ac19c2e65cdad368668a ff514f14/src/patches-custom-elements.js
1459 if (window.ShadowDOMPolyfill) { 1460 if (window.ShadowDOMPolyfill) {
1460 1461
1461 // ensure wrapped inputs for these functions 1462 // ensure wrapped inputs for these functions
(...skipping 20 matching lines...) Expand all
1482 if (window.CustomElements && !CustomElements.useNative) { 1483 if (window.CustomElements && !CustomElements.useNative) {
1483 var originalImportNode = Document.prototype.importNode; 1484 var originalImportNode = Document.prototype.importNode;
1484 Document.prototype.importNode = function(node, deep) { 1485 Document.prototype.importNode = function(node, deep) {
1485 var imported = originalImportNode.call(this, node, deep); 1486 var imported = originalImportNode.call(this, node, deep);
1486 CustomElements.upgradeAll(imported); 1487 CustomElements.upgradeAll(imported);
1487 return imported; 1488 return imported;
1488 } 1489 }
1489 } 1490 }
1490 1491
1491 })(); 1492 })();
OLDNEW
« no previous file with comments | « no previous file | pkg/custom_element/lib/custom-elements.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698