Closed
Bug 120734
Opened 23 years ago
Closed 22 years ago
outliner cell text dimensions wrong
Categories
(Core :: XUL, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla1.4alpha
People
(Reporter: neil, Assigned: janv)
References
Details
Attachments
(2 files, 5 obsolete files)
5.82 KB,
image/gif
|
Details | |
7.48 KB,
patch
|
neil
:
review+
jag+mozilla
:
superreview+
|
Details | Diff | Splinter Review |
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.
Reporter | ||
Comment 1•23 years ago
|
||
Assignee | ||
Comment 2•23 years ago
|
||
Assignee | ||
Comment 3•23 years ago
|
||
Comment on attachment 65607 [details] [diff] [review]
patch
This needs work, I'll send a new patch later.
Attachment #65607 -
Flags: needs-work+
Assignee | ||
Comment 4•23 years ago
|
||
Attachment #65607 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9
Assignee | ||
Comment 5•23 years ago
|
||
Comment on attachment 65827 [details] [diff] [review]
new patch
it still has some issues
Attachment #65827 -
Flags: needs-work+
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.9 → mozilla1.0
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla1.0 → mozilla1.1alpha
Reporter | ||
Comment 7•22 years ago
|
||
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.
Reporter | ||
Updated•22 years ago
|
Attachment #65827 -
Attachment is obsolete: true
Reporter | ||
Updated•22 years ago
|
Attachment #114338 -
Flags: review?(varga)
Assignee | ||
Comment 8•22 years ago
|
||
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) ?
Reporter | ||
Comment 9•22 years ago
|
||
>> 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...
Reporter | ||
Comment 10•22 years ago
|
||
*** Bug 170387 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 11•22 years ago
|
||
I cleaned up it a bit.
Neil, could you try this one and possibly r= ?
Reporter | ||
Comment 12•22 years ago
|
||
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;
> }
>
Assignee | ||
Comment 13•22 years ago
|
||
good catch Neil
Attachment #114338 -
Attachment is obsolete: true
Attachment #115385 -
Attachment is obsolete: true
Reporter | ||
Comment 14•22 years ago
|
||
Comment on attachment 115488 [details] [diff] [review]
new patch
I suppose that'll do...
Attachment #115488 -
Flags: review+
Assignee | ||
Comment 15•22 years ago
|
||
Attachment #115488 -
Attachment is obsolete: true
Reporter | ||
Comment 16•22 years ago
|
||
Comment on attachment 115489 [details] [diff] [review]
another try
I actually like this one!
Attachment #115489 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.1alpha → mozilla1.4alpha
Assignee | ||
Updated•22 years ago
|
Attachment #115489 -
Flags: superreview?(jaggernaut)
Comment 17•22 years ago
|
||
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+
Assignee | ||
Comment 18•22 years ago
|
||
ok, I'll do that
Assignee | ||
Comment 19•22 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•22 years ago
|
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.
Description
•