Bug 31054

Summary: position: relative; top: N px; miscalculates rect and therefor dirty rects when updated, though painting is in correct place
Product: WebKit Reporter: Onne Gorter <onne.gorter>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
URL: http://www.mijnalbum.nl/?m=nettv
Attachments:
Description Flags
misrendering
none
rect position is incorrect from web inspector none

Description Onne Gorter 2009-11-03 05:04:16 PST
Javascript updated content suffers because old rendering is not updated. Any new (longer) rendering is showing correctly, see below for minimal test case, and the attached screenshots of this testcase.

---- test.html:
<html>
    <body>
        <span id=span1 style="position: relative; top: 30px;">hello</span>
    </body>

    <script>
setTimeout(function() {
    document.getElementById("span1").innerHTML="BRRRRRRRRRRRRRRRRR";
}, 500);
    </script>
</html>
Comment 1 Onne Gorter 2009-11-03 05:05:35 PST
Created attachment 42369 [details]
misrendering
Comment 2 Onne Gorter 2009-11-03 05:06:22 PST
Created attachment 42370 [details]
rect position is incorrect from web inspector
Comment 3 Ahmad Saleem 2022-12-30 15:17:04 PST
I am not able to reproduce this in Safari 16.2 using following JSFiddle (based of Comment 0):

JSFiddle - https://jsfiddle.net/rb8yLtpg/show

It does not show empty rect position in Inspector and also rendering issue is also not present and it matches other browsers (Chrome Canary 111 and Firefox Nightly 110).

I am marking this as "RESOLVED CONFIGURATION CHANGED" but if it is still reproducing, please reopen with updated test case. Thanks!