<?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>139694</bug_id>
          
          <creation_ts>2014-12-16 12:29:52 -0800</creation_ts>
          <short_desc>ContentEditable=True inside of an Iframe jumps to the top of the parent window.</short_desc>
          <delta_ts>2019-01-07 22:50:38 -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>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 8.1</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=140018</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Snyder">michael.h.snyder</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cory</cc>
    
    <cc>enrica</cc>
    
    <cc>jacekbogd</cc>
    
    <cc>m.lewandowski</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>s</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1056050</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Snyder">michael.h.snyder</who>
    <bug_when>2014-12-16 12:29:52 -0800</bug_when>
    <thetext>Steps to reproduce (easiest)

1) Create html page with two iframes (800px tall each)
2) In the lower iframe add another iframe with a page consisting of &lt;div contenteditable=&quot;true&quot; style=&quot;width: 100%; height: 500px;&quot;&gt;&lt;/div&gt; inside the frame
3) Open the page on an ipad and start typing in the contenteditable field
4) The page will jump to the top of the parent screen randomly when hitting certain keys and especially the space bar.

TinyMCE will not work either.

I have reproduced in Latest Chrome and Safari IOS. It appears there is a problem calculating the focus scrollTop.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1287578</commentid>
    <comment_count>1</comment_count>
    <who name="">m.lewandowski</who>
    <bug_when>2017-03-14 05:52:38 -0700</bug_when>
    <thetext>Same thing affects CKEditor, which makes it hard to use on iOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1315138</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-06-02 11:43:11 -0700</bug_when>
    <thetext>Does this reproduce in iOS 10.3?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1315194</commentid>
    <comment_count>3</comment_count>
    <who name="Cory LaViska">cory</who>
    <bug_when>2017-06-02 13:42:07 -0700</bug_when>
    <thetext>I&apos;m still seeing this behavior in the latest iOS. I actually discovered this while troubleshooting what I thought was a TinyMCE bug in Postleaf. It appears as though the frame&apos;s document.body.scrollTop value is always 0, regardless of whether or not the frame is scrolled.

Then I realized you can&apos;t set an explicit height on an iframe in iOS. They seem to expand to the full height of their content.

That said, I&apos;m not sure if this is actually a Webkit bug or a side effect of iframe&apos;s on mobile Safari not accepting the height specified by CSS. It could be that TinyMCE, CKEditor, et al assume scrollTop will be a positive value when instead it stays at zero, and the libs are &quot;fixing&quot; the scroll position based on that value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1315197</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-06-02 13:47:02 -0700</bug_when>
    <thetext>Thanks. It would be helpful to have a URL that points to a page that reproduces this for you, rather than me trying to create one from the instructions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1315315</commentid>
    <comment_count>5</comment_count>
      <attachid>311892</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-06-02 17:52:25 -0700</bug_when>
    <thetext>Created attachment 311892
Testcase

With this test case, I cannot reproduce the issue on an iPad running 10.3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448721</commentid>
    <comment_count>6</comment_count>
    <who name="Jacek Bogdański">jacekbogd</who>
    <bug_when>2018-08-08 03:40:15 -0700</bug_when>
    <thetext>The issue also exists on iOS 11.4. You can reproduce test steps using this codepen: https://codepen.io/jacekbogdanski/pen/NMbdwz
Just scroll down and click &quot;Type here&quot; text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448726</commentid>
    <comment_count>7</comment_count>
    <who name="Jacek Bogdański">jacekbogd</who>
    <bug_when>2018-08-08 03:49:24 -0700</bug_when>
    <thetext>It also would be great to get some updates on the issue status thus it&apos;s pretty old and it&apos;s causing WYSIWYG editors based on iframes unusable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1449011</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-08-09 09:22:42 -0700</bug_when>
    <thetext>&lt;rdar://problem/43097167&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>311892</attachid>
            <date>2017-06-02 17:52:25 -0700</date>
            <delta_ts>2017-06-02 17:52:25 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>two-iframes.html</filename>
            <type>text/html</type>
            <size>353</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+Cgo8aHRtbD4KPGhlYWQ+CiAgICA8c3R5bGU+CiAgICAgICAgaWZyYW1l
IHsKICAgICAgICAgICAgaGVpZ2h0OiAxMDAwcHg7CiAgICAgICAgICAgIGRpc3BsYXk6IGJsb2Nr
OwogICAgICAgICAgICBtYXJnaW46IDEwcHg7CiAgICAgICAgfQogICAgPC9zdHlsZT4KPC9oZWFk
Pgo8Ym9keT4KPGlmcmFtZT4KPC9pZnJhbWU+CjxpZnJhbWUgc3JjZG9jPSI8cD5FZGl0YWJsZTo8
L3A+PGRpdiBjb250ZW50ZWRpdGFibGU9J3RydWUnIHN0eWxlPSd3aWR0aDogMTAwJTsgaGVpZ2h0
OiA1MDBweDsgYm9yZGVyOiAxcHggc29saWQgZ3JheSc+PC9kaXY+Ij4KPC9pZnJhbWU+CjwvYm9k
eT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>