Skip to content

Instantly share code, notes, and snippets.

@tuespetre
Created December 7, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuespetre/678f13f3a55a3644f0084ce8bc217479 to your computer and use it in GitHub Desktop.
Save tuespetre/678f13f3a55a3644f0084ce8bc217479 to your computer and use it in GitHub Desktop.
Repro of a WebKit bug with iOS 10 Safari
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
</head>
<body>
<style>
.hover-me:hover {
color: red;
}
</style>
<div id="div1">
<a href="#" class="hover-me" onclick="alert('clicked link')">
I have to be clicked once!
</a>
</div>
<div id="div2">
<div id="div3">
<a href="#" class="hover-me" onclick="alert('clicked link')">
I have to be clicked twice...
</a>
</div>
</div>
<script>
document.getElementById('div1').attachShadow({ mode: 'open' }).innerHTML = `<slot></slot>`;
document.getElementById('div2').attachShadow({ mode: 'open' }).innerHTML = `<slot></slot>`;
document.getElementById('div3').attachShadow({ mode: 'open' }).innerHTML = `<slot></slot>`;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment