Closed
Bug 574621
Opened 15 years ago
Closed 14 years ago
Need to use prescontext's DefaultBackgroundColor in toplevel content documents
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: roc, Assigned: roc)
References
Details
Attachments
(1 file, 2 obsolete files)
9.01 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
With bug 130078 fixed, we need to ensure that toplevel content documents still get the prescontext's DefaultBackgroundColor in their background if the document is transparent/translucent. This patch does that.
Attachment #453998 -
Flags: review?(tnikkel)
Comment 1•15 years ago
|
||
Comment on attachment 453998 [details] [diff] [review]
fix
rootFrame here isn't the root frame, it is the root element style frame, so I think it will always have a parent. Feel free to rename the variable so this problem is removed.
I recall a bug that I can't locate now that you fixed that was a regression from removing child widgets (?) with opening of pages in a sidebar via opening a bookmark that has "load this bookmark in the sidebar" checked where there was an unusual setup with chrome/content in the docshell hierarchy. Does IsChildOfSameType do the right thing in that case?
Looking at this code I wonder if it's ever possible that we wouldn't update mCanvasBackgroundColor because neither 'if' is entered. Do you think we could assert that one of the 'if' statement executes?
Comment 2•15 years ago
|
||
Also, thanks for doing this, it removes an item from my bug 130078 todo list.
Assignee | ||
Comment 3•15 years ago
|
||
Comment on attachment 453998 [details] [diff] [review]
fix
OK, so the patch is wrong ... rootFrame needs to be renamed to rootStyleFrame, and we should probably have proper API for checking whether a prescontext is for a toplevel content document.
Attachment #453998 -
Attachment is obsolete: true
Attachment #453998 -
Flags: review?(tnikkel)
Assignee | ||
Comment 4•15 years ago
|
||
IIRC that bug I fixed was a chrome subdocument of a chrome document, which should not get a background here IMHO.
I'll update this later.
Comment 5•15 years ago
|
||
Updated•15 years ago
|
Attachment #457777 -
Flags: review?(roc)
Comment 6•15 years ago
|
||
Comment on attachment 457777 [details] [diff] [review]
Updated patch (seems to work)
Stealing review since roc should probably not review this since he basically wrote the patch.
r=me if the local variable rootFrame is renamed to rootStyleFrame.
Attachment #457777 -
Flags: review?(roc) → review+
Comment 7•15 years ago
|
||
Landed with review comments addressed
http://hg.mozilla.org/mozilla-central/rev/9e290d196600
but backed out due to failure in layout/base/test/chrome/test_chrome_content_integration.xul
http://hg.mozilla.org/mozilla-central/rev/a24232050cb1
http://hg.mozilla.org/mozilla-central/rev/c402a67ba0db
Comment 8•15 years ago
|
||
It looks like this also caused a crash in talos tp4 on linux64 loading www.jugem.jp/jugem.jp/index.html
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1280434220.1280434694.24886.gz
Assignee | ||
Comment 9•14 years ago
|
||
We didn't get a stack there. I wonder if that's the same crash that you and karl have been chasing?
Comment 10•14 years ago
|
||
Yes it is the same crash, so it's just the one test fail left.
Comment 11•14 years ago
|
||
Or a very similar crash fixed by the same patch, at least.
Assignee | ||
Comment 12•14 years ago
|
||
OK, so the reason you don't see much of a problem without this patch is that tabbrowser.css styles <tabpanels> with background-color:white. That's what you're seeing as the background for Web content. If you try changing the Web page background color preference to something other than white, you'll see that it doesn't take effect.
I'll write a chrometest for this. I've also fixed up the mochitest failure, so I'll resubmit the patch in a jiffy.
BTW, drawing all Web content to a transparent surface can be bad for performance as well as subpixel AA. So we should definitely get new Talos runs once this is fixed!
Assignee | ||
Comment 13•14 years ago
|
||
Fixes the failure in test_chrome_content_integration.xul; we need to honor the "transparent" attribute on our container element.
Added a test to ensure that the background color pref is honoured. We fail the test with bug 130078 without this patch.
This fixes bug 588407.
Attachment #457777 -
Attachment is obsolete: true
Attachment #469003 -
Flags: review?(tnikkel)
Comment 14•14 years ago
|
||
Comment on attachment 469003 [details] [diff] [review]
fix v2
Can you incorporate the rename of rootFrame -> rootStyleFrame in this patch so there is less potential confusion?
Adding a call to IsTransparentContainerElement in UpdateCanvasBackground adds a fair bit of "stuff" to this little function that gets called every time we paint. Assuming we want to support dynamic changes of the transparent attribute, is it worth it to cache this value and set up some sort of notification when the transparent attribute gets added/removed?
>+ dump(comparison[1] + "\n");
>+ dump(comparison[2] + "\n");
Did you intend to leave these dump's in?
Thanks.
Attachment #469003 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 15•14 years ago
|
||
(In reply to comment #14)
> Can you incorporate the rename of rootFrame -> rootStyleFrame in this patch so
> there is less potential confusion?
Sure!
> Adding a call to IsTransparentContainerElement in UpdateCanvasBackground adds a
> fair bit of "stuff" to this little function that gets called every time we
> paint. Assuming we want to support dynamic changes of the transparent
> attribute, is it worth it to cache this value and set up some sort of
> notification when the transparent attribute gets added/removed?
Painting is a heavyweight operation and should be happening at much less than 1000Hz. IsTransparentContainerElement is noise at that rate.
> >+ dump(comparison[1] + "\n");
> >+ dump(comparison[2] + "\n");
>
> Did you intend to leave these dump's in?
No, I'll take them out. Thanks.
Assignee | ||
Comment 16•14 years ago
|
||
(In reply to comment #15)
> Painting is a heavyweight operation and should be happening at much less than
> 1000Hz. IsTransparentContainerElement is noise at that rate.
(Long term, it should be happening at no more than ~60Hz per browser window, but we won't quite get there for FF4.)
Comment 17•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•