<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>188362</bug_id>
          
          <creation_ts>2018-08-06 16:09:16 -0700</creation_ts>
          <short_desc>Document click listener will sometimes show tap highlights</short_desc>
          <delta_ts>2018-09-06 01:16:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari 11</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philipp Spiess">hello</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
    
    <cc>dino</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1448272</commentid>
    <comment_count>0</comment_count>
      <attachid>346663</attachid>
    <who name="Philipp Spiess">hello</who>
    <bug_when>2018-08-06 16:09:16 -0700</bug_when>
    <thetext>Created attachment 346663
Reproduction Example

A bug report at React indicated a strange behavior: Sometimes, tapping somewhere on the screen will cause the whole page to splash: https://github.com/facebook/react/issues/12717#issuecomment-410854325

We could trim it down to the following HTML that still shows the issue:

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    document.onclick = function() {};
   &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

Opening this page on iOS (I tried 12, 11.4, 11.0, 10.3.1) and tapping anywhere will cause the page to show a grey tap highlight.

There are some strange behaviors with this, which leads us to believe that this is a WebKit bug:

1. Removing &lt;!DOCTYPE html&gt; from the HTML will remove the splash.
2. Adding the event handler to body instead of document will also remove it.
3. Changing the tap highlight color via CSS shows no effect: The highlight is still grey although a button on the same page might turn red when tapped.
4. Giving body and html a width and height of 100% will also make the tap disappear.  

It makes sense that clickable elements show the tap highlight color. If you have an element that is as big as the viewport and add an `click` event to it, it&apos;s expected that it shows the tap behavior - There&apos;s no way to distinguish that form a giant button. What&apos;s strange in the document case is that it only happens under certain conditions and that it&apos;s completely unexpected when using frameworks like React that adds event listeners to the document all the time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448541</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-08-07 13:11:13 -0700</bug_when>
    <thetext>&lt;rdar://problem/43015556&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>346663</attachid>
            <date>2018-08-06 16:09:16 -0700</date>
            <delta_ts>2018-08-06 16:09:16 -0700</delta_ts>
            <desc>Reproduction Example</desc>
            <filename>issue.html</filename>
            <type>text/html</type>
            <size>122</size>
            <attacher name="Philipp Spiess">hello</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPC9oZWFkPgo8Ym9keT4KICA8c2NyaXB0Pgog
ICAgZG9jdW1lbnQub25jbGljayA9IGZ1bmN0aW9uKCkge307CiAgIDwvc2NyaXB0Pgo8L2JvZHk+
CjwvaHRtbD4=
</data>

          </attachment>
      

    </bug>

</bugzilla>