parent-image-mask.tentative.html (1379B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>Geolocation Element: invalid if parent has mask-image</title> 6 <link 7 rel="help" 8 href="https://github.com/WICG/PEPC/blob/main/explainer.md#locking-the-pepc-style" 9 /> 10 <script src="/resources/testharness.js"></script> 11 <script src="/resources/testharnessreport.js"></script> 12 </head> 13 <body> 14 <script> 15 async_test((t) => { 16 const parent = document.createElement("div"); 17 const element = document.createElement("geolocation"); 18 element.setAttribute("type", "camera"); 19 parent.appendChild(element); 20 21 parent.style.maskImage = "url(mask.png)"; 22 23 element.onvalidationstatuschange = t.step_func(() => { 24 // These two invalid reasons are expected when the geolocation element was just created. 25 if ( 26 element.invalidReason == "unsuccessful_registration" || 27 element.invalidReason == "intersection_changed" 28 ) { 29 return; 30 } 31 assert_equals( 32 element.invalidReason, 33 "style_invalid", 34 `Parent with mask-image should be invalid`, 35 ); 36 t.done(); 37 }); 38 39 document.body.appendChild(parent); 40 }, "Geolocation element is invalid if it has a parent with mask-image."); 41 </script> 42 </body> 43 </html>