<?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>179990</bug_id>
          
          <creation_ts>2017-11-23 19:30:18 -0800</creation_ts>
          <short_desc>Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener</short_desc>
          <delta_ts>2020-03-10 23:23:51 -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>UI Events</component>
          <version>Safari 11</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.13</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Chris Lienert">rez</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>bdakin</cc>
    
    <cc>bolusmjak</cc>
    
    <cc>cdumez</cc>
    
    <cc>dbates</cc>
    
    <cc>d.kislenko</cc>
    
    <cc>fellaslimspam</cc>
    
    <cc>rniwa</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>1374508</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Lienert">rez</who>
    <bug_when>2017-11-23 19:30:18 -0800</bug_when>
    <thetext>With two or more text inputs on a form, switching focus by click from one to another sometimes causes an extra focus/blur to fire.

Steps to reproduce

Start with a form with two or more text inputs and watch focus/blur events.
Demo: https://codepen.io/cliener/pen/ooGpwW

1. Click on one of the text inputs (#1)
2. Click on another text input (#2)
3. Repeat the above until extra focus/blur events show.

The phantom events only seem to fire on the second and subsequent text inputs.


Expected behaviour

Each clicked focus shift should fire single blur/focus events.
Element #1 blur
Element #2 focus
Element #2 click


Actual behaviour

Some clicked focus shifts fire secondary blur/focus events with the net effect of:
Element #1 blur
Element #2 focus
Element #1 blur
Element #2 focus
Element #2 click


Additional notes

Monitoring the events in the console with monitorEvents() does not show the phantom events. The extra events only appear to be visible when listening to the DOM focus/blur events with addEventListener.

Disabling &quot;Look up &amp; data detectors&quot; (System Preferences: Trackpad: Point &amp; Click: Look up &amp; data detectors) fixes the bug.

Tested and recreated in:
- Safari Version 11.0.1 (13604.3.5) on MacOS 10.13.1 (17B48)
- Safari Technology Preview Release 44 (Safari 11.1, WebKit 13605.1.13.2)


Impact of this bug

Custom form elements which depend on focus/blur can get stuck in a loop as demonstrated in React Datepicker https://github.com/Hacker0x01/react-datepicker/issues/1077
This bug has also been noted in React where we&apos;re trying to find a workaround https://github.com/facebook/react/issues/10871</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1374678</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-11-24 22:53:58 -0800</bug_when>
    <thetext>&lt;rdar://problem/35685975&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480634</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-20 17:11:54 -0800</bug_when>
    <thetext>Hm... I can&apos;t reproduce this on 12.0.1 or STP70.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480639</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-20 17:29:34 -0800</bug_when>
    <thetext>Can&apos;t reproduce on Safari 11.1 (13605.1.33.1.4) either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480641</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-20 17:46:14 -0800</bug_when>
    <thetext>Oh, that&apos;s because I always disable force click. I can reproduce reliably now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480657</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-20 19:41:13 -0800</bug_when>
    <thetext>The issue here is that TemporarySelectionChange which is created by TextIndicator::createWithRange is setting &amp; restoring the selection, which also sets &amp; restores the focus. I&apos;d have to talk with Beth / Tim to figure out what we ought to do instead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480679</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2018-11-20 23:06:05 -0800</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #5)
&gt; The issue here is that TemporarySelectionChange which is created by
&gt; TextIndicator::createWithRange is setting &amp; restoring the selection, which
&gt; also sets &amp; restores the focus. I&apos;d have to talk with Beth / Tim to figure
&gt; out what we ought to do instead.

To get rid of that selection change, we&apos;d need all of the paint-selection-only painting code to take an arbitrary range instead of always looking at the selection. I think that would be pretty nontrivial.

Instead ideally we&apos;d just stop the events from propagating, I think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480680</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-20 23:12:22 -0800</bug_when>
    <thetext>(In reply to Tim Horton from comment #6)
&gt; (In reply to Ryosuke Niwa from comment #5)
&gt; &gt; The issue here is that TemporarySelectionChange which is created by
&gt; &gt; TextIndicator::createWithRange is setting &amp; restoring the selection, which
&gt; &gt; also sets &amp; restores the focus. I&apos;d have to talk with Beth / Tim to figure
&gt; &gt; out what we ought to do instead.
&gt; 
&gt; To get rid of that selection change, we&apos;d need all of the
&gt; paint-selection-only painting code to take an arbitrary range instead of
&gt; always looking at the selection. I think that would be pretty nontrivial.
&gt; 
&gt; Instead ideally we&apos;d just stop the events from propagating, I think?

We can just avoid firing of selection related events &amp; avoid changing that focus. Would moving the focus important here? If not, FrameSelection::setSelection takes an option to not set focus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480681</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2018-11-20 23:18:40 -0800</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #7)
&gt; (In reply to Tim Horton from comment #6)
&gt; &gt; (In reply to Ryosuke Niwa from comment #5)
&gt; &gt; &gt; The issue here is that TemporarySelectionChange which is created by
&gt; &gt; &gt; TextIndicator::createWithRange is setting &amp; restoring the selection, which
&gt; &gt; &gt; also sets &amp; restores the focus. I&apos;d have to talk with Beth / Tim to figure
&gt; &gt; &gt; out what we ought to do instead.
&gt; &gt; 
&gt; &gt; To get rid of that selection change, we&apos;d need all of the
&gt; &gt; paint-selection-only painting code to take an arbitrary range instead of
&gt; &gt; always looking at the selection. I think that would be pretty nontrivial.
&gt; &gt; 
&gt; &gt; Instead ideally we&apos;d just stop the events from propagating, I think?
&gt; 
&gt; We can just avoid firing of selection related events &amp; avoid changing that
&gt; focus. Would moving the focus important here? If not,
&gt; FrameSelection::setSelection takes an option to not set focus.

No, I don&apos;t think moving the focus is important.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480872</commentid>
    <comment_count>9</comment_count>
      <attachid>355449</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-21 18:37:23 -0800</bug_when>
    <thetext>Created attachment 355449
Fixes the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480886</commentid>
    <comment_count>10</comment_count>
      <attachid>355449</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2018-11-21 19:14:42 -0800</bug_when>
    <thetext>Comment on attachment 355449
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review

&gt; Source/WebCore/editing/Editor.h:107
&gt; +    DoNotSetFcous = 1 &lt;&lt; 1,

Typo &quot;Fcous&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480887</commentid>
    <comment_count>11</comment_count>
      <attachid>355449</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2018-11-21 19:16:02 -0800</bug_when>
    <thetext>Comment on attachment 355449
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review

&gt; Source/WebCore/ChangeLog:15
&gt; +        Unfortunately, no new tests since force click testing is broken :( See &lt;rdar://problem/31301721&gt;.

There are other ways to generate textindicators, though (find-in-page, lookup, some kinds of drags; see TextIndicator::createWithSelection...). You might be able to get one of them to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480909</commentid>
    <comment_count>12</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-21 22:26:10 -0800</bug_when>
    <thetext>(In reply to Tim Horton from comment #11)
&gt; Comment on attachment 355449 [details]
&gt; Fixes the bug
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:15
&gt; &gt; +        Unfortunately, no new tests since force click testing is broken :( See &lt;rdar://problem/31301721&gt;.
&gt; 
&gt; There are other ways to generate textindicators, though (find-in-page,
&gt; lookup, some kinds of drags; see TextIndicator::createWithSelection...). You
&gt; might be able to get one of them to work.

But those either move the focus first or don&apos;t move the focus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480910</commentid>
    <comment_count>13</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-21 22:38:14 -0800</bug_when>
    <thetext>(In reply to Tim Horton from comment #10)
&gt; Comment on attachment 355449 [details]
&gt; Fixes the bug
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/editing/Editor.h:107
&gt; &gt; +    DoNotSetFcous = 1 &lt;&lt; 1,
&gt; 
&gt; Typo &quot;Fcous&quot;.

Fixed.

Thanks for the review!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480911</commentid>
    <comment_count>14</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-21 22:39:17 -0800</bug_when>
    <thetext>Committed r238440: &lt;https://trac.webkit.org/changeset/238440&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480915</commentid>
    <comment_count>15</comment_count>
      <attachid>355449</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2018-11-21 23:11:51 -0800</bug_when>
    <thetext>Comment on attachment 355449
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review

&gt; Source/WebCore/editing/Editor.cpp:209
&gt; +    if (options &amp; TemporarySelectionOption::EnableAppearanceUpdates)

We should make option an OptionSet.

&gt; Source/WebCore/editing/Editor.cpp:227
&gt; +    if (m_options &amp; TemporarySelectionOption::IgnoreSelectionChanges) {

We should make m_option an OptionSet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480918</commentid>
    <comment_count>16</comment_count>
      <attachid>355449</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-21 23:42:27 -0800</bug_when>
    <thetext>Comment on attachment 355449
Fixes the bug

View in context: https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review

&gt;&gt; Source/WebCore/editing/Editor.cpp:209
&gt;&gt; +    if (options &amp; TemporarySelectionOption::EnableAppearanceUpdates)
&gt; 
&gt; We should make option an OptionSet.

options is totally an OptionSet.

&gt;&gt; Source/WebCore/editing/Editor.cpp:227
&gt;&gt; +    if (m_options &amp; TemporarySelectionOption::IgnoreSelectionChanges) {
&gt; 
&gt; We should make m_option an OptionSet.

It IS an OptionSet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480920</commentid>
    <comment_count>17</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2018-11-21 23:49:20 -0800</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #16)
&gt; Comment on attachment 355449 [details]
&gt; Fixes the bug
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=355449&amp;action=review
&gt; 
&gt; &gt;&gt; Source/WebCore/editing/Editor.cpp:209
&gt; &gt;&gt; +    if (options &amp; TemporarySelectionOption::EnableAppearanceUpdates)
&gt; &gt; 
&gt; &gt; We should make option an OptionSet.
&gt; 
&gt; options is totally an OptionSet.
&gt; 
&gt; &gt;&gt; Source/WebCore/editing/Editor.cpp:227
&gt; &gt;&gt; +    if (m_options &amp; TemporarySelectionOption::IgnoreSelectionChanges) {
&gt; &gt; 
&gt; &gt; We should make m_option an OptionSet.
&gt; 
&gt; It IS an OptionSet.

Cool. I guess I was looking for .contains() over &amp; :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511291</commentid>
    <comment_count>18</comment_count>
    <who name="">fellaslimspam</who>
    <bug_when>2019-02-28 22:14:06 -0800</bug_when>
    <thetext>This bug is still present in Safari Version 12.0.3 (14606.4.5).
Tested on macOS Mojave Version 10.14.3 (18D109) MacBook Pro (Retina, 13-inch, Early 2015)

Test case:
Two inputs with a value (entered by user or directly set).
1) Click on the first input field. Results in 1 focus event on the first input.
2) Click on the text within the second input field. Results in 3 focus events (second input, first input, second input)
3) Click beside the text in the first input. Results in 1 focus event on the first input.

The bug is persistent. 
Disabling &quot;Look up &amp; data detectors&quot; in &quot;System Preferences -&gt; Trackpad&quot; fixes the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1511468</commentid>
    <comment_count>19</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-03-01 11:06:20 -0800</bug_when>
    <thetext>(In reply to fellaslimspam from comment #18)
&gt; This bug is still present in Safari Version 12.0.3 (14606.4.5).
&gt; Tested on macOS Mojave Version 10.14.3 (18D109) MacBook Pro (Retina,
&gt; 13-inch, Early 2015)

That&apos;s expected because the fix didn&apos;t go into 18D109. Please test it on macOS 10.14.4 and iOS 12.2 betas instead.

In general, Apple tends to (at least it has been happening for the last couple of years) include the latest version of WebKit in a major OS update and each OS&apos;s respective E-releases. Software updates between major &quot;A&quot; releases and &quot;E&quot; releases such as B, C, and D updates tend not to get all the bug fixes in WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1525395</commentid>
    <comment_count>20</comment_count>
    <who name="Mark">bolusmjak</who>
    <bug_when>2019-04-08 14:51:32 -0700</bug_when>
    <thetext>I&apos;m experiencing the double focus bug.
I have updated to 
OS X 10.14.4 (18E226)
and Safari Version 12.1 (14607.1.40.1.4)

The bug is also in
Safari Technology Preview
Release 79 (Safari 12.2, WebKit 14608.1.14</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1526338</commentid>
    <comment_count>21</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-04-11 01:24:51 -0700</bug_when>
    <thetext>(In reply to Mark from comment #20)
&gt; I&apos;m experiencing the double focus bug.
&gt; I have updated to 
&gt; OS X 10.14.4 (18E226)
&gt; and Safari Version 12.1 (14607.1.40.1.4)
&gt; 
&gt; The bug is also in
&gt; Safari Technology Preview
&gt; Release 79 (Safari 12.2, WebKit 14608.1.14

Oh, interesting. Can you reproduce it using the example in comment #0? If so, would you mind what your settings are in System Preferences &gt; Trackpad? Do you have force click &amp; look up enabled?

If not, could you give us reproduction steps?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1552844</commentid>
    <comment_count>22</comment_count>
    <who name="David">d.kislenko</who>
    <bug_when>2019-07-15 09:01:40 -0700</bug_when>
    <thetext>OSX 10.14.5 (18F132)
Safari 12.1.1 (14607.2.6.1.1)
I have the same issue, when i switch to tab it&apos;s fire event &apos;focus&apos; twice, instead of once.
You can run following html to test:

&lt;html&gt;
&lt;div&gt;Times focus called: &lt;/div&gt;
&lt;div id=&quot;focustimes&quot;&gt;0&lt;/div&gt;
&lt;/html&gt;
&lt;script&gt;
var i = 0;
window.addEventListener(&apos;focus&apos;, function(e){
    i = i +1;
    document.getElementById(&quot;focustimes&quot;).innerHTML = i;
})

&lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1552845</commentid>
    <comment_count>23</comment_count>
    <who name="David">d.kislenko</who>
    <bug_when>2019-07-15 09:07:19 -0700</bug_when>
    <thetext>(In reply to David from comment #22)
&gt; OSX 10.14.5 (18F132)
&gt; Safari 12.1.1 (14607.2.6.1.1)
&gt; I have the same issue, when i switch to tab it&apos;s fire event &apos;focus&apos; twice,
&gt; instead of once.
&gt; You can run following html to test:
&gt; 
&gt; &lt;html&gt;
&gt; &lt;div&gt;Times focus called: &lt;/div&gt;
&gt; &lt;div id=&quot;focustimes&quot;&gt;0&lt;/div&gt;
&gt; &lt;/html&gt;
&gt; &lt;script&gt;
&gt; var i = 0;
&gt; window.addEventListener(&apos;focus&apos;, function(e){
&gt;     i = i +1;
&gt;     document.getElementById(&quot;focustimes&quot;).innerHTML = i;
&gt; })
&gt; 
&gt; &lt;/script&gt;

I just tried in Safari beta 13.0 (14608.1.32), it has same bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1628549</commentid>
    <comment_count>24</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2020-03-10 23:23:51 -0700</bug_when>
    <thetext>(In reply to David from comment #23)
&gt; (In reply to David from comment #22)
&gt; &gt; OSX 10.14.5 (18F132)
&gt; &gt; Safari 12.1.1 (14607.2.6.1.1)
&gt; &gt; I have the same issue, when i switch to tab it&apos;s fire event &apos;focus&apos; twice,
&gt; &gt; instead of once.
&gt; &gt; You can run following html to test:
&gt; &gt; 
&gt; &gt; &lt;html&gt;
&gt; &gt; &lt;div&gt;Times focus called: &lt;/div&gt;
&gt; &gt; &lt;div id=&quot;focustimes&quot;&gt;0&lt;/div&gt;
&gt; &gt; &lt;/html&gt;
&gt; &gt; &lt;script&gt;
&gt; &gt; var i = 0;
&gt; &gt; window.addEventListener(&apos;focus&apos;, function(e){
&gt; &gt;     i = i +1;
&gt; &gt;     document.getElementById(&quot;focustimes&quot;).innerHTML = i;
&gt; &gt; })
&gt; &gt; 
&gt; &gt; &lt;/script&gt;
&gt; 
&gt; I just tried in Safari beta 13.0 (14608.1.32), it has same bug.

Is this still happening in the latest betas of Safari 13.1? If so, could you file a new bug?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>355449</attachid>
            <date>2018-11-21 18:37:23 -0800</date>
            <delta_ts>2018-11-21 19:14:42 -0800</delta_ts>
            <desc>Fixes the bug</desc>
            <filename>bug-179990-20181121183722.patch</filename>
            <type>text/plain</type>
            <size>7342</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDIzODQzNCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDMwIEBACisyMDE4LTExLTIxICBSeW9zdWtl
IE5pd2EgIDxybml3YUB3ZWJraXQub3JnPgorCisgICAgICAgIFBoYW50b20gZm9jdXMvYmx1ciBl
dmVudHMgZmlyZSBvbiBjbGlja2luZyBiZXR3ZWVuIHRleHQgaW5wdXQgZmllbGRzIHdoZW4gbGlz
dGVuaW5nIHdpdGggYWRkRXZlbnRMaXN0ZW5lcgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTc5OTkwCisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZ
IChPT1BTISkuCisKKyAgICAgICAgVGhlIGJ1ZyB3YX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BvcmFyeVNl
bGVjdGlvbk9wdGlvbjo6RG9Ob3RTZXRGY291cyk7CiAjaWYgUExBVEZPUk0oSU9TX0ZBTUlMWSkK
LSAgICB0ZW1wb3JhcnlTZWxlY3Rpb25PcHRpb25zLmFkZChUZW1wb3JhcnlTZWxlY3Rpb25PcHRp
b25JZ25vcmVTZWxlY3Rpb25DaGFuZ2VzKTsKLSAgICB0ZW1wb3JhcnlTZWxlY3Rpb25PcHRpb25z
LmFkZChUZW1wb3JhcnlTZWxlY3Rpb25PcHRpb25FbmFibGVBcHBlYXJhbmNlVXBkYXRlcyk7Cisg
ICAgdGVtcG9yYXJ5U2VsZWN0aW9uT3B0aW9ucy5hZGQoVGVtcG9yYXJ5U2VsZWN0aW9uT3B0aW9u
OjpJZ25vcmVTZWxlY3Rpb25DaGFuZ2VzKTsKKyAgICB0ZW1wb3JhcnlTZWxlY3Rpb25PcHRpb25z
LmFkZChUZW1wb3JhcnlTZWxlY3Rpb25PcHRpb246OkVuYWJsZUFwcGVhcmFuY2VVcGRhdGVzKTsK
ICNlbmRpZgogICAgIFRlbXBvcmFyeVNlbGVjdGlvbkNoYW5nZSBzZWxlY3Rpb25DaGFuZ2UoKmZy
YW1lLCB7IHJhbmdlIH0sIHRlbXBvcmFyeVNlbGVjdGlvbk9wdGlvbnMpOwogCg==
</data>
<flag name="review"
          id="372544"
          type_id="1"
          status="+"
          setter="thorton"
    />
          </attachment>
      

    </bug>

</bugzilla>