mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
a2581f4219
As filed the bug is about table backgrounds failing to print. The root cause of this is that we load images from the original document, because print/print-preview documents (which are static clones of the original) cannot do loads. This results in an entry in the css::ImageValue's request table under the original document, but entry under the printing document. Then we do layout, try to get the request, and fail, and nothing is displayed. The solution to this is to force us to clone the request for the printing document if we're loading off the original document. I manually verified that this does not regress Bug 560235. While writing a test for this, we discovered another problem. The reftest print code does not actually use the printing codepath. Instead it takes an existing document, tears down its presshell, and creates a new presshell for printing. Fixing the above bug did not make the reftest print test pass because ImageLoader does not deal properly with presshell destruction/recreation. It assumes that when the presshell is destroyed all of the css::ImageValues can be cleared of their entries for that document. This fails for ImageValues for mapped attributes because they are held alive by the content tree. When a new presshell for this document is then created there is no entry for the document and thus no image request to paint. The fix for this is to only clear the frame to request and request to frame mapping hashtables and not to clear the document's entry on the ImageValue when the presshell is destroyed. The destruction of the ImageLoader (which is held from a strong reference on the document) is when those entries are removed. The final change is to change css::ImageValue's hashtable from holding a strong reference to the keys (which are documents) to holding raw pointer references. This is safe because we clear the relevant entry when the corresponding ImageLoader dies, and is needed to prevent a reference cycle that was being broken by presshell destruction. --HG-- rename : layout/reftests/backgrounds/table-background-ref.html => layout/reftests/backgrounds/table-background-print-ref.html rename : layout/reftests/backgrounds/table-background.html => layout/reftests/backgrounds/table-background-print.html
42 lines
845 B
HTML
42 lines
845 B
HTML
<html>
|
|
<body>
|
|
<table style="background-image: url('aqua-yellow-32x32.png')">
|
|
<thead style="background-image: url('blue-16x20-green-16x20.png')">
|
|
<tr>
|
|
<td>
|
|
Foo
|
|
</td>
|
|
<td style="background-image: url('yellow-32x32.png')">
|
|
Bar
|
|
</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody style="background-image: url('red-32x32.png')">
|
|
<tr>
|
|
<th style="background-image: url('fuchsia-32x32.png')">
|
|
Foo
|
|
</th>
|
|
<th>
|
|
Bar
|
|
</th>
|
|
</tr>
|
|
<tr style="background-image: url('fuchsia-32x32.png')">
|
|
<td>
|
|
Foo
|
|
</td>
|
|
<td style="background-image: url('yellow-32x32.png')">
|
|
Bar
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tfoot style="background-image: url('yellow-32x32.png')">
|
|
<tr>
|
|
<td>
|
|
Baz
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</body>
|
|
</html>
|