<?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>186216</bug_id>
          
          <creation_ts>2018-06-01 17:50:20 -0700</creation_ts>
          <short_desc>ServicesOverlayController can hold references to Documents after you navigate away</short_desc>
          <delta_ts>2022-02-09 10:46:45 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1429450</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-06-01 17:50:20 -0700</bug_when>
    <thetext>ServiceOverlayController::Highlight() has a Ref&lt;Range&gt;, and Range has a Ref&lt;Document&gt;.

When you change the selection in a view, ServiceOverlayController makes a “potential highlight” Highlight, which retains the Document. If you then navigate, there’s nothing that clears that Highlight, until the selection changes.

We need to either have ServiceOverlayController use weak refs, or clear its highlights on navigation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429451</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-06-01 17:50:34 -0700</bug_when>
    <thetext>rdar://problem/40735219</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429453</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-06-01 17:51:54 -0700</bug_when>
    <thetext>This is visible with any layout test that makes a selection (like LayoutTests/fast/css/counters/counter-after-style-crash.html) and the patch in bug 186214</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839278</commentid>
    <comment_count>3</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2022-02-09 10:46:45 -0800</bug_when>
    <thetext>(In reply to Simon Fraser (smfr) from comment #0)
&gt; ServiceOverlayController::Highlight() has a Ref&lt;Range&gt;, and Range has a
&gt; Ref&lt;Document&gt;.
&gt; 
&gt; When you change the selection in a view, ServiceOverlayController makes a
&gt; “potential highlight” Highlight, which retains the Document. If you then
&gt; navigate, there’s nothing that clears that Highlight, until the selection
&gt; changes.
&gt; 
&gt; We need to either have ServiceOverlayController use weak refs, or clear its
&gt; highlights on navigation.

We should probably add logic to clear state underneath `Document::willBeRemovedFromFrame()` (similar to how some of the other controller-type objects have a `documentDetached` method).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>