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

Side by Side Diff: sky/tests/mutation-observer/shadow-dom.sky

Issue 694423002: Replace <link rel="import"> with <import> (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 <html> 1 <html>
2 <link rel="import" href="../resources/chai.sky" /> 2 <import src="../resources/chai.sky" />
3 <link rel="import" href="../resources/mocha.sky" /> 3 <import src="../resources/mocha.sky" />
4 <div id="range"></div> 4 <div id="range"></div>
5 <script> 5 <script>
6 describe('MutationObservers', function() { 6 describe('MutationObservers', function() {
7 it('should handle shadow dom', function() { 7 it('should handle shadow dom', function() {
8 function mutate(element) { 8 function mutate(element) {
9 element.setAttribute('data-foo', 'bar'); 9 element.setAttribute('data-foo', 'bar');
10 element.insertBefore(document.createTextNode('hello'), element.firstChild) ; 10 element.insertBefore(document.createTextNode('hello'), element.firstChild) ;
11 element.firstChild.textContent = 'goodbye'; 11 element.firstChild.textContent = 'goodbye';
12 element.removeChild(element.firstChild); 12 element.removeChild(element.firstChild);
13 } 13 }
(...skipping 17 matching lines...) Expand all
31 31
32 mutations = observer.takeRecords(); 32 mutations = observer.takeRecords();
33 observer.observe(document, {attributes: true, childList: true, characterData : true, subtree: true}); 33 observer.observe(document, {attributes: true, childList: true, characterData : true, subtree: true});
34 mutate(shadowRoot.firstChild); 34 mutate(shadowRoot.firstChild);
35 // Observing from outside shadow DOM should not see mutations in the shadow: 35 // Observing from outside shadow DOM should not see mutations in the shadow:
36 assert.equal(mutations.length, 0); 36 assert.equal(mutations.length, 0);
37 }); 37 });
38 }); 38 });
39 </script> 39 </script>
40 </html> 40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698