Instead of trying to detect all integer overflow at the source, this merely
keeps the sizes non-negative. That may not mean they are less than
nscoord_MAX.
If we give in and accept that integer arithmetic may result in the scrolled
rect being smaller than the scroll port, then we shouldn't assert.
--HG--
extra : transplant_source : RP%15%84zx%B9%E8%2C%1E%0A%AB%82%F4%9C%A2y%AD5%27
I talked about this with bz. The issue is that we have a lot of XUL reftests
that end up getting run as remote XUL given that the reftest harness loads
them with file:// URIs. But realistically most of them probably want to test
the fully-featured XBL environment that we provide to frontend and extensions.
So the compromise here is to do XBL scopes for content, and no XBL scopes
for reftests/crashtests.
1. Start headless X server. Start basic window manager on it.
2. Run reftests with said X server. Take note of failing tests.
3. Disable all reftests that need focus:
find $topsrcdir -name '*.list' | xargs sed -i -e '/needs-focus/s/^/#/'
4. Make reftest.js:Focus never focus the window and always return true.
5. Start reftests with said X server again. Once the tests begin
running, start a xterm on the same X server. The window manager will
focus this xterm and will not return focus to the browser.
6. Compare now-failing tests with baseline. Mark all such tests as
needs-focus.
Comments on specific tests:
editor/reftests/
- spellcheck-input-ref.html and spellcheck-textarea-ref.html focus
input elements and don't work right without the window having focus.
- spellcheck-hyphen-invalid-ref.html and
spellcheck-hyphen-multiple-invalid-ref.html use @autofocus on
textarea.
- 674212-spellcheck.html, 338427-2.html, and
462758-grabbers-resizers.html all wait for onfocus for div elements.
layout/reftests/bugs/
- 652301-1b.html focuses a bogus element with an onfocus handler.
layout/reftests/selection/
- pseudo-element-of-native-anonymous-ref.html .select()s an <input>.
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