Bug 143327

Summary: No-op inline style changes cause style recalcs
Product: WebKit Reporter: Elliott Sprehn <esprehn>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: bfulgham, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Elliott Sprehn
Reported 2015-04-01 18:30:45 PDT
Confirmed in r182227 <div id="test"></div> <script> var test = document.getElementById("test"); setInterval(function() { test.style.top = "0px"; }); </script> This causes an infinite number of style recalcs even though it's just assigning the same number repeatedly. It seems the parser returns true to mean "successfully parsed", and the inline style machinery interprets that bool to mean "something changed". Probably want to compare the CSSProperty objects to see that they're actually different instead (different value, different important).
Attachments
Brent Fulgham
Comment 1 2022-07-14 13:45:45 PDT
This doesn't seem to be an issue in Safari 15.5+. I only see the initial style and layout, then the timer running with no further style recalls.
Note You need to log in before you can comment on or make changes to this bug.