<?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>201645</bug_id>
          
          <creation_ts>2019-09-10 08:55:13 -0700</creation_ts>
          <short_desc>[GTK] Text areas render wrongly after using backspace or delete key on a blank line</short_desc>
          <delta_ts>2019-09-27 05:09:34 -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>WebKitGTK</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=201181</see_also>
          <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="Ting-Wei Lan">lantw44</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
    
    <cc>koivisto</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1569554</commentid>
    <comment_count>0</comment_count>
    <who name="Ting-Wei Lan">lantw44</who>
    <bug_when>2019-09-10 08:55:13 -0700</bug_when>
    <thetext>It is probably a regression of WebKitGTK 2.25.92.

To test the problem, open a web page with a text area. The text area should already have text and include at least a blank line. For example, you can test it with a HTML file with the element:

&lt;textarea&gt;
123
456

789
&lt;/textarea&gt;

Don&apos;t test it by typing the text into a blank text area. The bug only occurs when it operates on existing text.

To reproduce the bug with backspace key:
1. Move the cursor to the right of 6.
2. Press backspace 3 times. It shows &apos;123&apos;, two blank lines, &apos;789&apos;.
3. Press backspace again. It still shows &apos;123&apos;, two blank lines, &apos;789&apos;.

This is wrong because the last backspace should delete a blank line, so the correct result should be &apos;123&apos;, one blank line, &apos;789&apos;. The cursor is also partially &apos;locked&apos; after pressing the last backspace. You can&apos;t move the cursor to the &apos;789&apos; line with keyboard. Pressing down arrow key does nothing.

To reproduce the bug with delete key:
1. Move the cursor to the left of 4.
2. Press delete 3 times. It shows &apos;123&apos;, two blank lines, &apos;789&apos;.
3. Press delete again. It still shows &apos;123&apos;, two blank lines, &apos;789&apos;.
4. Press delete again. It shows &apos;123&apos; and &apos;789&apos; with no blank line between them.

Results of step 2 and step 4 are correct, but the result of step 3 isn&apos;t. WebKit seems to maintain the text in the memory correctly, but it renders the text wrongly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1571091</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2019-09-16 07:39:54 -0700</bug_when>
    <thetext>2ebcc2bac3010714ac6ebbc4397187b5e355d052 is the first bad commit
commit 2ebcc2bac3010714ac6ebbc4397187b5e355d052
Author: antti
Date:   Tue Aug 27 19:29:53 2019 +0000

    InlineTextBox::end() should return first-past-end offset
    https://bugs.webkit.org/show_bug.cgi?id=201181
    
    Reviewed by Zalan Bujtas.
    
    It currently points to the last character, except for empty text boxes.
    This is awkward in itself and also inconsistent, as we use first-past-end offset everywhere else.
    
    * dom/Position.cpp:
    (WebCore::Position::downstream const):
    
    Add a check for zero length case to avoid changing behavior.
    
    * layout/Verification.cpp:
    (WebCore::Layout::checkForMatchingTextRuns):
    (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
    * rendering/InlineFlowBox.cpp:
    (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
    * rendering/InlineTextBox.cpp:
    (WebCore::InlineTextBox::paint):
    (WebCore::InlineTextBox::calculateDocumentMarkerBounds const):
    (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
    (WebCore::InlineTextBox::paintCompositionUnderlines const):
    (WebCore::InlineTextBox::paintCompositionUnderline const):
    * rendering/InlineTextBox.h:
    (WebCore::InlineTextBox::end const):
    
    end = start + len
    
    * rendering/RenderText.cpp:
    (WebCore::RenderText::setTextWithOffset):
    * rendering/RenderTextLineBoxes.cpp:
    (WebCore::localQuadForTextBox):
    (WebCore::RenderTextLineBoxes::absoluteRectsForRange const):
    (WebCore::RenderTextLineBoxes::absoluteQuadsForRange const):
    (WebCore::RenderTextLineBoxes::dirtyRange):
    
    Here the incoming &apos;end&apos; used linebox style too, move that to the new definition too.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@249160 268f45cc-cd09-0410-ab3c-d52691b4dbfc

:040000 040000 e110aeb63d19f3d9cf6474087cde263175ea43b6 69079a172fbc33fdabe32f37c9096555324b23dd M	Source</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1574781</commentid>
    <comment_count>2</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2019-09-27 05:09:34 -0700</bug_when>
    <thetext>Ping. I reverted this in WPE and GTK stable branch, but we need to fix it in trunk.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>