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

Side by Side Diff: Source/web/tests/data/touch-action-tests.js

Issue 215313003: Remove applyAuthorStyles flag from ShadowRoot. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Git is hard Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/data/touch-action-tests.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Disable compositor hit testing 1 // Disable compositor hit testing
2 document.addEventListener('touchstart', function() {}); 2 document.addEventListener('touchstart', function() {});
3 3
4 window.addEventListener('load', function() { 4 window.addEventListener('load', function() {
5 // Create any shadow DOM nodes requested by the test. 5 // Create any shadow DOM nodes requested by the test.
6 var shadowTrees = document.querySelectorAll('[make-shadow-dom]'); 6 var shadowTrees = document.querySelectorAll('[make-shadow-dom]');
7 if (shadowTrees.length > 0 && !HTMLElement.prototype.createShadowRoot) { 7 if (shadowTrees.length > 0 && !HTMLElement.prototype.createShadowRoot) {
8 document.body.innerHTML = 'ERROR: Shadow DOM not supported!'; 8 document.body.innerHTML = 'ERROR: Shadow DOM not supported!';
9 return; 9 return;
10 } 10 }
11 for (var i = 0; i < shadowTrees.length; i++) { 11 for (var i = 0; i < shadowTrees.length; i++) {
12 var tree = shadowTrees[i]; 12 var tree = shadowTrees[i];
13 var host = tree.previousElementSibling; 13 var host = tree.previousElementSibling;
14 if (!host.hasAttribute('shadow-host')) { 14 if (!host.hasAttribute('shadow-host')) {
15 document.body.innerHTML = 'ERROR: make-shadow-dom node must follow a shado w-host node'; 15 document.body.innerHTML = 'ERROR: make-shadow-dom node must follow a shado w-host node';
16 return; 16 return;
17 } 17 }
18 tree.parentElement.removeChild(tree); 18 tree.parentElement.removeChild(tree);
19 var shadowRoot = host.createShadowRoot(); 19 var shadowRoot = host.createShadowRoot();
20 shadowRoot.applyAuthorStyles = true;
21 shadowRoot.appendChild(tree); 20 shadowRoot.appendChild(tree);
22 } 21 }
23 }); 22 });
24 23
25 /* 24 /*
26 * Visualization of hit test locations for manual testing. 25 * Visualization of hit test locations for manual testing.
27 * To be invoked manually (so it doesn't intefere with testing). 26 * To be invoked manually (so it doesn't intefere with testing).
28 */ 27 */
29 function addMarker(x, y) 28 function addMarker(x, y)
30 { 29 {
31 const kMarkerSize = 6; 30 const kMarkerSize = 6;
32 var marker = document.createElement('div'); 31 var marker = document.createElement('div');
33 marker.className = 'marker'; 32 marker.className = 'marker';
34 marker.style.top = (y - kMarkerSize/2) + 'px'; 33 marker.style.top = (y - kMarkerSize/2) + 'px';
35 marker.style.left = (x - kMarkerSize/2) + 'px'; 34 marker.style.left = (x - kMarkerSize/2) + 'px';
36 document.body.appendChild(marker); 35 document.body.appendChild(marker);
37 } 36 }
38 37
39 function addMarkers() 38 function addMarkers()
40 { 39 {
41 var tests = document.querySelectorAll('[expected-action]'); 40 var tests = document.querySelectorAll('[expected-action]');
42 for (var i = 0; i < tests.length; i++) { 41 for (var i = 0; i < tests.length; i++) {
43 var r = tests[i].getClientRects()[0]; 42 var r = tests[i].getClientRects()[0];
44 addMarker(r.left, r.top); 43 addMarker(r.left, r.top);
45 addMarker(r.right - 1, r.bottom - 1); 44 addMarker(r.right - 1, r.bottom - 1);
46 addMarker(r.left + r.width / 2, r.top + r.height / 2); 45 addMarker(r.left + r.width / 2, r.top + r.height / 2);
47 } 46 }
48 } 47 }
OLDNEW
« no previous file with comments | « Source/web/tests/data/touch-action-tests.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698