Closed Bug 120734 Opened 23 years ago Closed 22 years ago

outliner cell text dimensions wrong

Categories

(Core :: XUL, defect, P3)

x86
Windows 95
defect

Tracking

()

RESOLVED FIXED
mozilla1.4alpha

People

(Reporter: neil, Assigned: janv)

References

Details

Attachments

(2 files, 5 obsolete files)

Using Build ID: 2002011703 When using border or padding on outlinerchildren:-moz-outliner-cell-text then the background dimensions are calculated incorrectly, although the text is painted in the correct location. This means that the border and/or background of the -moz-outliner-cell-text is drawn incorrectly. Note that behaviour with older builds is that text background consists of the remainder of the cell after the indent, twisty and image are accounted for.
Attached image Screenshot
Attached patch patch (obsolete) — Splinter Review
Comment on attachment 65607 [details] [diff] [review] patch This needs work, I'll send a new patch later.
Attachment #65607 - Flags: needs-work+
Attached patch new patch (obsolete) — Splinter Review
Attachment #65607 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9
Comment on attachment 65827 [details] [diff] [review] new patch it still has some issues
Attachment #65827 - Flags: needs-work+
Target Milestone: mozilla0.9.9 → mozilla1.0
Target Milestone: mozilla1.0 → mozilla1.1alpha
Bug 80837 probably needs this to be fixed.
Blocks: 80837
Attached patch Proposed patch (obsolete) — Splinter Review
This works for me. I allow for border/padding before calculating the text size, but add it back when I'm actually painting the background, so that the border gets drawn in the right place.
Attachment #65827 - Attachment is obsolete: true
Attachment #114338 - Flags: review?(varga)
Comment on attachment 114338 [details] [diff] [review] Proposed patch >+ // Adjust the rect for its border and padding. >+ nsStyleBorderPadding bPad; >+ textContext->GetBorderPaddingFor(bPad); >+ bPad.GetBorderPadding(textMargin); >+ textRect.Deflate(textMargin); does this differ from AdjustForBorderPadding(textContext, textRect) ?
>> I allow for border/padding before calculating the text size, but add it back > does this differ from AdjustForBorderPadding(textContext, textRect) ? Only in that I need the value so that I can add it back...
*** Bug 170387 has been marked as a duplicate of this bug. ***
Attached patch basically the same as above (obsolete) — Splinter Review
I cleaned up it a bit. Neil, could you try this one and possibly r= ?
Comment on attachment 115385 [details] [diff] [review] basically the same as above Can't you use AdjustForBorderPadding here? Once you've done that you might as well inline it... >@@ -2045,11 +2042,9 @@ > nsRect nsTreeBodyFrame::GetInnerBox() > { > nsRect r(0,0,mRect.width, mRect.height); >- nsMargin m(0,0,0,0); >- nsStyleBorderPadding bPad; >- mStyleContext->GetBorderPaddingFor(bPad); >- bPad.GetBorderPadding(m); >- r.Deflate(m); >+ nsMargin bp(0,0,0,0); >+ GetBorderPadding(mStyleContext, bp); >+ r.Deflate(bp); > return r; > } >
Attached patch new patch (obsolete) — Splinter Review
good catch Neil
Attachment #114338 - Attachment is obsolete: true
Attachment #115385 - Attachment is obsolete: true
Comment on attachment 115488 [details] [diff] [review] new patch I suppose that'll do...
Attachment #115488 - Flags: review+
Attached patch another trySplinter Review
Attachment #115488 - Attachment is obsolete: true
Comment on attachment 115489 [details] [diff] [review] another try I actually like this one!
Attachment #115489 - Flags: review+
Target Milestone: mozilla1.1alpha → mozilla1.4alpha
Attachment #115489 - Flags: superreview?(jaggernaut)
Comment on attachment 115489 [details] [diff] [review] another try >Index: nsTreeBodyFrame.cpp >=================================================================== >RCS file: /cvsroot/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp,v >retrieving revision 1.156 >diff -u -r1.156 nsTreeBodyFrame.cpp >--- nsTreeBodyFrame.cpp 23 Feb 2003 02:47:56 -0000 1.156 >+++ nsTreeBodyFrame.cpp 25 Feb 2003 13:02:03 -0000 >@@ -374,6 +374,24 @@ > return nsnull; > } > >+static void >+GetBorderPadding(nsStyleContext* aContext, nsMargin& aMargin) >+{ >+ nsStyleBorderPadding borderPaddingStyle; >+ aContext->GetBorderPaddingFor(borderPaddingStyle); >+ borderPaddingStyle.GetBorderPadding(aMargin); >+} >+ >+static void >+AdjustForBorderPadding(nsStyleContext* aContext, nsRect& aRect) >+{ >+ nsStyleBorderPadding borderPaddingStyle; >+ aContext->GetBorderPaddingFor(borderPaddingStyle); >+ nsMargin borderPadding(0,0,0,0); >+ borderPaddingStyle.GetBorderPadding(borderPadding); >+ aRect.Deflate(borderPadding); >+} Why not: static void AdjustForBorderPadding(nsStyleContext* aContext, nsRect& aRect) { nsMargin borderPadding(0, 0, 0, 0); GetBorderPadding(aContext, borderPadding); aRect.Deflate(borderPadding); } >@@ -2042,15 +2039,10 @@ >+void nsTreeBodyFrame::CalcInnerBox() > { >+ mInnerBox.SetRect(0,0,mRect.width, mRect.height); Space after comma.
Attachment #115489 - Flags: superreview?(jaggernaut) → superreview+
ok, I'll do that
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Attachment #114338 - Flags: review?(varga)
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: