Bug 126267 - Root background doesn't correctly update with composited <html> element
Summary: Root background doesn't correctly update with composited <html> element
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2013-12-27 15:21 PST by Geoffrey Benson
Modified: 2014-01-02 14:34 PST (History)
3 users (show)

See Also:

Example test case which triggers the bug (1.29 KB, text/html)
2013-12-27 15:22 PST, Geoffrey Benson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Benson 2013-12-27 15:21:31 PST
This bug is best seen with a minimal demonstration page, which I have attached.

How to reproduce:
* Apply this style declaration:
html {
  -webkit-backface-visibility: hidden;

* After the page has loaded, change the styling on the <body> tag dynamically via JavaScript, for example by setting the background-color to something new.

Expected behavior:
The body style should be applied, and the viewport should redraw to show the applied style.

Actual behavior:
Only portions of the page get updated.  This bug was found when researching why only parts of the screen were rendered with a new background image when a style was applied to <body> (the parts of the screen which didn't get new elements added remained black, per the <body>'s previous style at the time.)

If the time between initial render and when the <body> style is changed is small enough (1ms or less), the bug doesn't trigger.

This has been reproduced on the following environments:

MacOS: Safari 7.0.1, Chrome 31.0.1650.63, Opera Next 19.0.1326.21
Windows 7: Chrome 31.0.1650.63 m
Android: 4.3, 4.0, 2.3.5 (though 2.3.5 has additional rendering bugs related to this). 
iOS: 7.0.4

If the -webkit-backface-visibility style is applied to <body> instead of <html>, this bug is not triggered.
Comment 1 Geoffrey Benson 2013-12-27 15:22:10 PST
Created attachment 220066 [details]
Example test case which triggers the bug
Comment 2 Radar WebKit Bug Importer 2014-01-02 14:34:49 PST