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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt_automation/fullscreen/auto-click.js

Issue 2898503002: Reenable feature policy control over fullscreen (Closed)
Patch Set: Fixing last test nits Created 3 years, 4 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
OLDNEW
1 (function() { 1 (function() {
2 2
3 // Gets the offset of an element in coordinates relative to the top-level frame. 3 // Gets the offset of an element in coordinates relative to the top-level frame.
4 function offset(element) { 4 function offset(element) {
5 const rect = element.getBoundingClientRect(); 5 const rect = element.getBoundingClientRect();
6 const iframe = element.ownerDocument.defaultView.frameElement; 6 const iframe = element.ownerDocument.defaultView.frameElement;
7 if (!iframe) { 7 if (!iframe) {
8 return { left: rect.left, top: rect.top }; 8 return { left: rect.left, top: rect.top };
9 } 9 }
10 const outerOffset = offset(iframe); 10 const outerOffset = offset(iframe);
(...skipping 26 matching lines...) Expand all
37 37
38 function observe(target) { 38 function observe(target) {
39 observer.observe(target, { childList: true, subtree: true }); 39 observer.observe(target, { childList: true, subtree: true });
40 } 40 }
41 41
42 // Handle what's already in the document. 42 // Handle what's already in the document.
43 for (const button of document.getElementsByTagName('button')) { 43 for (const button of document.getElementsByTagName('button')) {
44 click(button); 44 click(button);
45 } 45 }
46 for (const iframe of document.getElementsByTagName('iframe')) { 46 for (const iframe of document.getElementsByTagName('iframe')) {
47 observe(iframe.contentDocument); 47 try {
48 iframe.addEventListener('load', () => {
49 observe(iframe.contentDocument); 48 observe(iframe.contentDocument);
50 }); 49 iframe.addEventListener('load', () => {
50 observe(iframe.contentDocument);
51 });
52 } catch (e) {
53 // Skip cross-origin iframes, but report other errors
54 if (e.name != "SecurityError") {
55 throw e;
56 }
57 }
51 } 58 }
52 59
53 // Observe future changes. 60 // Observe future changes.
54 observe(document); 61 observe(document);
55 62
56 })(); 63 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698