Closed Bug 399532 Opened 18 years ago Closed 18 years ago

nsDisplayBackground::GetBounds() should take nsITheme overflow into account

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: frnchfrgg, Assigned: frnchfrgg)

Details

Attachments

(3 files, 2 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-1) Build Identifier: nsDisplayBackground doesn't override ::GetBounds(), and as such it returns the underlying frame rect. This is right, since CSS backgrounds cannot overflow the frame rect; *except* for themed frames (-moz-appearance) which advertize this via nsITheme::GetWidgetOverflow(). Reproducible: Always Actual Results: nsDisplayBackground never takes the advertized overflow into account, even for themed frames. Expected Results: nsDisplayBackground::GetBounds() should take the overflow rect into account if the underlying frame is themed.
Hmm. Would you mind adding a PRPackedBool mIsThemed to nsDisplayBackground to record whether or not the frame is themed? IsThemed() isn't the cheapest function. Just set mIsThemed in the constructor. Thanks!
So in the constructor, I call mFrame->IsThemed() and cache that in mIsThemed ? I thought display lists were short-lived one-shot things ? Is GetBounds() called several times on each display item when optimizing/painting ?
(In reply to comment #3) > So in the constructor, I call mFrame->IsThemed() and cache that in mIsThemed ? Yep > I thought display lists were short-lived one-shot things ? Yes but we may still call GetBounds more than once. We also call IsOpaque and other methods that can use mIsThemed. > Is GetBounds() > called several times on each display item when optimizing/painting ? Can be, yes.
Attachment #292938 - Flags: review?(roc)
Attachment #292757 - Flags: review?(roc)
Sorry, a "configure" was wrongly pasted in before diffing. This is the correct version.
Attachment #292938 - Attachment is obsolete: true
Attachment #292943 - Flags: review?(roc)
Assignee: nobody → frnchfrgg-mozbugs
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 292943 [details] [diff] [review] Both patches merged, correct version This patch corrects wrong behaviour, and the possible slowdown due to an added test should be offseted by the new way of caching IsThemed(), so this patch could even accelerate things. No real risk, the change is completely non-controversial.
Attachment #292943 - Flags: approval1.9?
Comment on attachment 292943 [details] [diff] [review] Both patches merged, correct version a=beltzner for 1.9
Attachment #292943 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in layout/base/nsDisplayList.cpp; /cvsroot/mozilla/layout/base/nsDisplayList.cpp,v <-- nsDisplayList.cpp new revision: 3.36; previous revision: 3.35 done Checking in layout/base/nsDisplayList.h; /cvsroot/mozilla/layout/base/nsDisplayList.h,v <-- nsDisplayList.h new revision: 3.25; previous revision: 3.24 done
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: