<?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>130658</bug_id>
          
          <creation_ts>2014-03-23 21:47:10 -0700</creation_ts>
          <short_desc>Recompute gapLen in deleteInsignificantText()</short_desc>
          <delta_ts>2024-04-03 21:58:28 -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>HTML Editing</component>
          <version>528+ (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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jinwoo Song">jinwoo7.song</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>rniwa</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>993713</commentid>
    <comment_count>0</comment_count>
    <who name="Jinwoo Song">jinwoo7.song</who>
    <bug_when>2014-03-23 21:47:10 -0700</bug_when>
    <thetext>According to Darin&apos;s comment in bug 130634, we should verify if the code is incorrect and the gapLen should be recomputed.

&quot;I suspect the dead store here indicates a bug. I think that gapLen needs to be recomputed. Instead of removing this line of code, we should add a line of code: gapLen = gapEnd - gapStart; But of course, we also need to construct a test case to demonstrate that the code is incorrect, which could be difficult.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2023633</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-03-25 05:59:37 -0700</bug_when>
    <thetext>NOTE - It is about this code:

https://searchfox.org/wubkat/rev/de98fcee68c0bd94f16d6dfb9dac2ea106ee40d5/Source/WebCore/editing/CompositeEditCommand.cpp#1070

gapEnd = std::min(gapEnd, end);

should be replaced with

gapLength = gapEnd - gapStart;

* gapLen was renamed to &apos;gapLength&apos; over the period of time.

___

It compiles with above line change using `build-webkit --release`.

From imported WPT &apos;editing&apos; tests - I didn&apos;t find any regression. As for our own local tests - there were few &apos;diff&apos; but I had other patches on local (related to HTML Editing), so I couldn&apos;t narrow it down which are caused by this change.

Just sharing up-to-date status.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025907</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-04-03 21:58:28 -0700</bug_when>
    <thetext>Hmm.. Came across following from Blink&apos;s commit that &apos;static analyzer&apos; complained on &apos;gapLen&apos;, so it was removed completely:

https://src.chromium.org/viewvc/blink/trunk/Source/core/editing/CompositeEditCommand.cpp?r1=164628&amp;r2=164627&amp;pathrev=164628

Commit: https://src.chromium.org/viewvc/blink?view=revision&amp;revision=164628</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>