| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Crash test for using declared style map with no associated style rule</title> |
| <style> |
| #target { color: red; } |
| </style> |
| </head> |
| <body> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <script> |
| test(() => { |
| var sheet = document.styleSheets[0]; |
| var styleMap = sheet.cssRules[0].styleMap; |
| sheet.deleteRule(0); |
| gc(); |
| |
| // Make sure none of the styleMap methods crash. |
| styleMap.get('color'); |
| styleMap.getAll('color'); |
| [...styleMap]; |
| styleMap.append('transition-duration', '1s'); |
| styleMap.delete('color'); |
| styleMap.set('width', '10px'); |
| styleMap.clear(); |
| styleMap.size; |
| }, "Deleting a style rule does not crash the corresponding declared style map"); |
| </script> |