<?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>197438</bug_id>
          
          <creation_ts>2019-04-30 13:42:23 -0700</creation_ts>
          <short_desc>REGRESSION(r244494): editing/pasteboard/5761530-1.html is flaky due to a simple line layout bug</short_desc>
          <delta_ts>2019-05-01 15:38:04 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</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="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="alan">zalan</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>koivisto</cc>
    
    <cc>tsavell</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1531686</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-04-30 13:42:23 -0700</bug_when>
    <thetext>Truitt Savell 2019-04-30 09:56:55 PDT
It looks like the changes in https://trac.webkit.org/changeset/244494/webkit

has caused the test editing/pasteboard/5761530-1.html to become flakey. 

I was able to reproduce this using command:
run-webkit-tests editing/pasteboard/5761530-1.html --iterations 20 --ios-simulator
The test passes on 244493 and with fail on 244494

History:
https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&amp;tests=editing%2Fpasteboard%2F5761530-1.html

Diff:
--- /Volumes/Data/slave/ios-simulator-12-release-tests-wk2/build/layout-test-results/editing/pasteboard/5761530-1-expected.txt
+++ /Volumes/Data/slave/ios-simulator-12-release-tests-wk2/build/layout-test-results/editing/pasteboard/5761530-1-actual.txt
@@ -1,3 +1,3 @@
 This tests to see that tabs are put into tab spans when they are copied individually. The pasted tab should be inside of a tab span, not a style span. To run the test manually, paste and then inspect the editable region, and ensure that there is a tab span at the beginning of the editable div.
 
-&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt;	&lt;/span&gt;xxx
+&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre;&quot;&gt; &lt;/span&gt;xxx</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1531688</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-04-30 13:43:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/50348091&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1531846</commentid>
    <comment_count>2</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-04-30 20:07:59 -0700</bug_when>
    <thetext>It was specifically this change:

--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp
@@ -1125,7 +1125,7 @@ void WebPage::updateEditorStateAfterLayoutIfEditabilityChanged()
     Frame&amp; frame = m_page-&gt;focusController().focusedOrMainFrame();
     EditorStateIsContentEditable editorStateIsContentEditable = frame.selection().selection().isContentEditable() ? EditorStateIsContentEditable::Yes : EditorStateIsContentEditable::No;
     if (m_lastEditorStateWasContentEditable != editorStateIsContentEditable)
-        sendPartialEditorStateAndSchedulePostLayoutUpdate();
+        scheduleFullEditorStateUpdate();
 }

 String WebPage::renderTreeExternalRepresentation() const

...that causes this test to be flaky. Reverting to always send the partial editor state update immediately when changing editability fixes the flakiness for me. I&apos;ll need to see what exactly in the UI process is depending on this state being up to date.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1531859</commentid>
    <comment_count>3</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-04-30 22:42:59 -0700</bug_when>
    <thetext>...this is even weirder than I thought!

Simply asking whether the current selection is at the beginning of a sentence via FrameSelection::selectionAtSentenceStart (and not even using the result) in this function:

     Frame&amp; frame = m_page-&gt;focusController().focusedOrMainFrame();
     EditorStateIsContentEditable editorStateIsContentEditable = frame.selection().selection().isContentEditable() ? EditorStateIsContentEditable::Yes : EditorStateIsContentEditable::No;
-    if (m_lastEditorStateWasContentEditable != editorStateIsContentEditable)
+    if (m_lastEditorStateWasContentEditable != editorStateIsContentEditable) {
+        frame.selection().selectionAtSentenceStart();
         scheduleFullEditorStateUpdate();
+    }

...seems to make this test pass reliably 🤔.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1531871</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-05-01 00:49:08 -0700</bug_when>
    <thetext>Oh, I wonder this is an issue with simple line layout. Try disabling it via settings?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1531915</commentid>
    <comment_count>5</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-05-01 07:32:39 -0700</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #4)
&gt; Oh, I wonder this is an issue with simple line layout. Try disabling it via
&gt; settings?

Oh interesting! Adding `internals.settings.setSimpleLineLayoutEnabled(false);` to the beginning of the test does seem to fix the flakiness...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1531947</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-05-01 09:25:05 -0700</bug_when>
    <thetext>Okay. So I think this might be a bug in TextIterator / StylizedMarkupAccumulator with simple line layout code in which a tab character or 4 spaces is collapsed in its serialization even though white-space: pre is set.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532052</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-05-01 13:53:44 -0700</bug_when>
    <thetext>It&apos;s probably a bug in TextIterator::handleTextNode. When copying the content of a plain text, we end up using TextIterator to grab the content in StyledMarkupAccumulator::appendText</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532054</commentid>
    <comment_count>8</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-05-01 13:59:51 -0700</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #7)
&gt; It&apos;s probably a bug in TextIterator::handleTextNode. When copying the
&gt; content of a plain text, we end up using TextIterator to grab the content in
&gt; StyledMarkupAccumulator::appendText

Yep, I&apos;m poking around in and around this code at the moment :)

I&apos;ll post some more findings in a bit. There&apos;s some behaviors regarding the lifetime of a renderer&apos;s SLL that are currently confusing me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532064</commentid>
    <comment_count>9</comment_count>
      <attachid>368708</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-05-01 14:16:18 -0700</bug_when>
    <thetext>Created attachment 368708
Reduction

Here&apos;s a reduction of the issue Zalan and I worked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532069</commentid>
    <comment_count>10</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-05-01 14:22:20 -0700</bug_when>
    <thetext>Alan, Ryosuke and I chatted about this over IRC. For now, let&apos;s disable SLL in this test to make it pass; Alan will continue investigating a fix in SLL logic to get innerText working for tab-spans in SLL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532077</commentid>
    <comment_count>11</comment_count>
      <attachid>368714</attachid>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-05-01 14:37:18 -0700</bug_when>
    <thetext>Created attachment 368714
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532109</commentid>
    <comment_count>12</comment_count>
      <attachid>368714</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-05-01 15:34:09 -0700</bug_when>
    <thetext>Comment on attachment 368714
Patch

Clearing flags on attachment: 368714

Committed r244854: &lt;https://trac.webkit.org/changeset/244854&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532110</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-05-01 15:34:10 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1532111</commentid>
    <comment_count>14</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-05-01 15:38:04 -0700</bug_when>
    <thetext>Reopening to track the SLL issue described above.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>368708</attachid>
            <date>2019-05-01 14:16:18 -0700</date>
            <delta_ts>2019-05-01 14:16:18 -0700</delta_ts>
            <desc>Reduction</desc>
            <filename>5761530-1.html</filename>
            <type>text/html</type>
            <size>219</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8Ym9keT4KYQliCjxzY3JpcHQ+CmNvbnN0IHJlc3VsdCA9
IGRvY3VtZW50LmJvZHkuaW5uZXJUZXh0Owpkb2N1bWVudC5ib2R5LnRleHRDb250ZW50ID0gJyc7
CmRvY3VtZW50LndyaXRlKGBUaGVyZSBzaG91bGQgYmUgYSB0YWIgY2hhcmFjdGVyIGJlbG93Ojxw
cmU+JHtyZXN1bHR9PC9wcmU+YCk7Cjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>368714</attachid>
            <date>2019-05-01 14:37:18 -0700</date>
            <delta_ts>2019-05-01 15:34:09 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-197438-20190501143718.patch</filename>
            <type>text/plain</type>
            <size>1912</size>
            <attacher name="Wenson Hsieh">wenson_hsieh</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQ0ODQwCmRpZmYgLS1naXQgYS9MYXlvdXRUZXN0cy9DaGFu
Z2VMb2cgYi9MYXlvdXRUZXN0cy9DaGFuZ2VMb2cKaW5kZXggODUyNWE0MTNjNjQzNTA0ZjQwZTEy
NTg5Y2NjYTIzYzIxZWNhZGM1OC4uMjE1MDVhNzE5M2ExOTMwNjM0YzhmYjNiMWVkOTM3ZjUwNTE2
OWJiMSAxMDA2NDQKLS0tIGEvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCisrKyBiL0xheW91dFRlc3Rz
L0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDE5LTA1LTAxICBXZW5zb24gSHNpZWggIDx3
ZW5zb25faHNpZWhAYXBwbGUuY29tPgorCisgICAgICAgIFJFR1JFU1NJT04ocjI0NDQ5NCk6IGVk
aXRpbmcvcGFzdGVib2FyZC81NzYxNTMwLTEuaHRtbCBpcyBmbGFreSBkdWUgdG8gYSBzaW1wbGUg
bGluZSBsYXlvdXQgYnVnCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVn
LmNnaT9pZD0xOTc0MzgKKyAgICAgICAgPHJkYXI6Ly9wcm9ibGVtLzUwMzQ4MDkxPgorCisgICAg
ICAgIFJldmlld2VkIGJ5IE5PQk9EW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