<?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>250814</bug_id>
          
          <creation_ts>2023-01-18 17:13:28 -0800</creation_ts>
          <short_desc>scrollTop and scrollLeft always 0 in DOMContentLoaded handler on a scrolled page</short_desc>
          <delta_ts>2023-09-24 11:04:15 -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>New Bugs</component>
          <version>WebKit Nightly 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=125879</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>karlcow</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1926490</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-18 17:13:28 -0800</bug_when>
    <thetext>Hi Team,

While going through Blink&apos;s commit, I came across this nasty bug where the test case make Safari do continuous reload and cause issue. I think it is good to fix it right away.

Test Case with continuous reloading - https://jsfiddle.net/v960ryzt/

^ in Safari 16.2 &amp; STP161, it will continuously reload scrollbar while it does not in Chrome Canary 111 and Firefox Nightly 111. It seems like that the navigation is stuck and page is refreshing.

Blink Commit - https://chromium.googlesource.com/chromium/blink/+/3ad81cf0b724a2a25ee5cc79a09541d9a971ae15

WebKit Source - https://searchfox.org/wubkat/source/Source/WebCore/loader/FrameLoader.cpp#2739

I just wanted to raise bug so we can fix it.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926863</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-20 04:21:38 -0800</bug_when>
    <thetext>I tried this PR - https://github.com/WebKit/WebKit/pull/8809

&gt;&gt; THIS TIMEOUT - scroll-position-restored-on-back-at-load-event.html

But I think this test is wrong because it is timing-out in EWS as well and I tried fixing based on my understanding but it didn&apos;t work.

As it is - it is failing in Chrome Canary 111 &amp; Firefox Nightly 111 as well but the scrollbar repainting or refreshing is not as severe as Safari. They just refresh page.

____

As for taking updated copy of test case from source.chromium.org, you have to bring following in WebKit:

&gt; gesture-util.js
&gt; back.html [which is just &lt;script&gt;history.back()&lt;/script&gt;]

^ Although, I think &apos;gesture-util.js&apos; is not needed because I tried to look into one by one function or variable which one is from it in the test but couldn&apos;t find.


____

Appreciate if someone can give any direction or input to fix this test. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928344</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-25 17:14:29 -0800</bug_when>
    <thetext>&lt;rdar://problem/104674675&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1934999</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-02-19 15:50:39 -0800</bug_when>
    <thetext>I manage to fix the last failing test but it is failing in iOS, which might be because we might have platform limitation.

Appreciate if someone can have a quick look and see if we need this - https://github.com/WebKit/WebKit/pull/8809

I can add platform specific exception in iOS unless except if it is genuine bug. I have seen various &quot;scroll&quot; tests being skipped in iOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1946500</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-04-04 05:18:48 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #3)
&gt; I manage to fix the last failing test but it is failing in iOS, which might
&gt; be because we might have platform limitation.
&gt; 
&gt; Appreciate if someone can have a quick look and see if we need this -
&gt; https://github.com/WebKit/WebKit/pull/8809
&gt; 
&gt; I can add platform specific exception in iOS unless except if it is genuine
&gt; bug. I have seen various &quot;scroll&quot; tests being skipped in iOS.

I noticed that the didFirstLayout() code has special path for iOS platform, which was added as part of bug 125879.

I think we might have to skip these failing tests and since these are only failing tests on iOS platform and all other tests pass. So I think it is safe change.

@Simon - Any input?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1979650</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-09-24 11:04:15 -0700</bug_when>
    <thetext>This also works:

if (isBackForwardLoadType(m_loadType) || isReload(m_loadType))</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>