Bug 143327 - No-op inline style changes cause style recalcs
Summary: No-op inline style changes cause style recalcs
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 18:30 PDT by Elliott Sprehn
Modified: 2022-07-14 13:45 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Sprehn 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).
Comment 1 Brent Fulgham 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.