Last Comment Bug 909157 - -moz-element background fails to update after image reloads
: -moz-element background fails to update after image reloads
Status: VERIFIED FIXED
: dev-doc-complete, regression, site-compat
Product: Core
Classification: Components
Component: Layout: View Rendering (show other bugs)
: 19 Branch
: All All
: -- normal (vote)
: mozilla26
Assigned To: Robert O'Callahan (:roc) (email my personal email if necessary)
:
Mentors:
Depends on:
Blocks: 798964
  Show dependency treegraph
 
Reported: 2013-08-25 16:25 PDT by Peter J. Sloetjes
Modified: 2013-10-17 06:52 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
affected
affected
affected
affected
verified
unaffected


Attachments
reporter's testcase (423 bytes, text/html)
2013-08-25 23:33 PDT, Alice0775 White
no flags Details
fix (21.84 KB, patch)
2013-08-26 20:38 PDT, Robert O'Callahan (:roc) (email my personal email if necessary)
matt.woodrow: review+
Details | Diff | Splinter Review

Description Peter J. Sloetjes 2013-08-25 16:25:40 PDT
User Agent: Mozilla/5.0 (masking-agent; rv:17.0) Gecko/17.0 Firefox/17.0 (Nightly/Aurora)
Build ID: 20130825004001

Steps to reproduce:

I used -moz-element in the following way (test case):

<html>
	<head>
		<style>
			#B{background-image:-moz-element(#A)}
		</style>
		<script>
			function setBackground() {
				document.getElementById("A").style.backgroundImage = 
					"url(data:image/gif;base64,R0lGODlhAQABAJEAAAAA" + 
					"/wAAAAAAAAAAACwAAAAAAQABAAAIBAABBAQAOw==)";
			}
		</script>
	</head>
	<body onload="setBackground()">
		<div id="A">A</div>
		<div id="B">_ ->B</div>
	</body>
</html>



Actual results:

After the background of div A is modified, the background of div B fails to be updated. The update can be forced by selecting text or by events that enforce a full redraw. The update does not fail after reloading the page, probably due to caching (please consider this when trying to confirm this bug).

In other cases involving -moz-element, no means can be found to enforce redraws, hence in those cases backgrounds remain missing (details are complex and will not be discussed in this thread).



Expected results:

-moz-element is a very useful feature, but it should be perfectly reliable or it may lead to invisible background images and hidden page functionality.

Almost 4000 users of my add-ons are affected by this bug. I have post-poned the release of several new add-ons because of it.
Comment 1 Alice0775 White 2013-08-25 23:32:49 PDT
Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/3523098f7911
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121106135430
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/8d793eb6a281
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121106140530
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=3523098f7911&tochange=8d793eb6a281

regressed by: Bug 798964
Comment 2 Alice0775 White 2013-08-25 23:33:25 PDT
Created attachment 795284 [details]
reporter's testcase
Comment 3 Robert O'Callahan (:roc) (email my personal email if necessary) 2013-08-26 20:38:12 PDT
Created attachment 795812 [details] [diff] [review]
fix
Comment 4 Robert O'Callahan (:roc) (email my personal email if necessary) 2013-09-04 04:15:15 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/b48f9c8d7aff
Comment 5 Wes Kocher (:KWierso) 2013-09-04 16:27:14 PDT
https://hg.mozilla.org/mozilla-central/rev/b48f9c8d7aff
Comment 7 Catalin Varga [QA][:VarCat] 2013-10-17 06:52:39 PDT
Verified as fixed using the following environments:

Build identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build id:20131017004002
http://hg.mozilla.org/releases/mozilla-aurora/rev/7b18d2da3414
OS: Windows 7 x64

Build identifier: Mozilla/5.0 (X11; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Build id:20131017004002
http://hg.mozilla.org/releases/mozilla-aurora/rev/7b18d2da3414
OS:Ubuntu 12.10 x32

Build Identifier:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:26.0) Gecko/20100101 Firefox/26.0
Build id:20131017004002
http://hg.mozilla.org/releases/mozilla-aurora/rev/7b18d2da3414
OS: Mac Os x Version 10.7.5

Note You need to log in before you can comment on or make changes to this bug.