Closed
Bug 290377
Opened 19 years ago
Closed 19 years ago
[FIXr]computed value of 'border-width' is incorrect
Categories
(Core :: CSS Parsing and Computation, defect, P1)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: dbaron, Assigned: bzbarsky)
References
Details
(Keywords: css2)
Attachments
(4 files, 3 obsolete files)
499 bytes,
text/html; charset=UTF-8
|
Details | |
526 bytes,
text/html; charset=UTF-8
|
Details | |
77.66 KB,
patch
|
Details | Diff | Splinter Review | |
6.15 KB,
patch
|
Details | Diff | Splinter Review |
This is the bug that makes the rule tree a pain to deal with (again). The computed value of 'border-width' is supposed to be zero when 'border-style' is 'none' or 'hidden', which means it should be inherited that way. But we can't really store that in the rule tree because it would break some cascading cases. But we also really don't want to disable the rule tree optimizations (as we did for the section 9.7 fixups) because this is the default case.
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Comment 2•19 years ago
|
||
Assignee | ||
Comment 3•19 years ago
|
||
I think this actually fully fixes the bug... That said, I'd still like to expose this better on nsStyleBorder. As things stand, we have a lot of weird code in various places because nsStyleBorder can't answer the simple question of "is there a border on this side, and how wide should it be?" I'm also still trying to decide whether the cached border stuff is really worth it...
Assignee | ||
Comment 4•19 years ago
|
||
This fixes this bug and bug 273500... I'm not quite sure whether to add the side constants to gfxCore or nsMargin; in the latter case I'd have to make nsStyleConsts include nsMargin (which might be ok). Note that if we find that the "live" width/style updating is too slow we can go back to having a RecalcData() function like we used to have. But I suspect this won't be an issue.
Assignee: dbaron → bzbarsky
Attachment #180819 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #180963 -
Flags: superreview?(dbaron)
Attachment #180963 -
Flags: review?(dbaron)
Assignee | ||
Updated•19 years ago
|
Priority: -- → P1
Summary: computed value of 'border-width' is incorrect → [FIX]computed value of 'border-width' is incorrect
Target Milestone: --- → mozilla1.8beta2
Assignee | ||
Comment 5•19 years ago
|
||
Note: I should also change the comment at http://lxr.mozilla.org/seamonkey/source/layout/base/nsStyleConsts.h#233 to something more like: "Possible enumerated specified values of border-*-width, used by nsCSSMargin."
Reporter | ||
Comment 6•19 years ago
|
||
Comment on attachment 180963 [details] [diff] [review] Proposed patch >Index: gfx/public/nsMargin.h >+ nscoord& side(PRUint8 aSide) { >+ NS_PRECONDITION(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 && >+ NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3, >+ "Unexpected side constants"); >+ NS_PRECONDITION(aSide <= NS_SIDE_LEFT, "Out of range side"); >+ return *(&top + aSide); >+ } >+ >+#if (NS_SIDE_TOP == 0) && (NS_SIDE_RIGHT == 1) && (NS_SIDE_BOTTOM == 2) && (NS_SIDE_LEFT == 3) >+ nscoord side(PRUint8 aSide) const { >+ NS_PRECONDITION(aSide <= NS_SIDE_LEFT, "Out of range side"); >+ return *(&top + aSide); >+ } >+#else >+#error "Somebody changed the side constants." >+#endif Just put both inside the #if and skip the first NS_PRECONDITION.
Reporter | ||
Comment 7•19 years ago
|
||
Comment on attachment 180963 [details] [diff] [review] Proposed patch >Index: layout/style/nsStyleStruct.h >+ void SetBorderWidth(PRUint8 aSide, nscoord aBorderWidth) > { >+ NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); >+ nscoord GetBorderWidth(PRUint8 aSide) const >+ { >+ NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); Probably better to drop these assertions, and just assume that nsMargin::side has them. Can you eliminate the fourth and fifth parameters to CalcSidesFor and fifth and sixth of CalcSideFor? >Index: layout/generic/nsInlineFrame.cpp You can remove IsBorderZero.
Attachment #180963 -
Flags: superreview?(dbaron)
Attachment #180963 -
Flags: superreview+
Attachment #180963 -
Flags: review?(dbaron)
Attachment #180963 -
Flags: review+
Assignee | ||
Comment 8•19 years ago
|
||
> Can you eliminate the fourth and fifth parameters to CalcSidesFor and fifth and
> sixth of CalcSideFor?
Yes. Will do that and make the other changes you asked for.
Assignee | ||
Comment 9•19 years ago
|
||
This should be pretty safe and simplifies the border code quite a bit, in addition to making us inherit border widths correctly...
Attachment #182136 -
Flags: approval1.8b2?
Assignee | ||
Updated•19 years ago
|
Summary: [FIX]computed value of 'border-width' is incorrect → [FIXr]computed value of 'border-width' is incorrect
Comment 10•19 years ago
|
||
Comment on attachment 182136 [details] [diff] [review] Updated to comments a=asa
Attachment #182136 -
Flags: approval1.8b2? → approval1.8b2+
Assignee | ||
Comment 11•19 years ago
|
||
Attachment #182136 -
Attachment is obsolete: true
Assignee | ||
Comment 12•19 years ago
|
||
Fixed. Even seemed to help out Tp a tad.... Still waiting on luna's Tdhtml to settle from what I think is a temporary spike.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•19 years ago
|
||
Well, looks like luna's spike is not quite temporary. Trying to figure out what's going on there.
Assignee | ||
Comment 14•19 years ago
|
||
I don't know what was going on this morning, but I think I got confused between windows on two different machines.... :( That'll teach me to check in before I'm really awake. This diff, applied on top of the previous one, addresses the comments. I just checked it in.
Attachment #180963 -
Attachment is obsolete: true
Assignee | ||
Comment 15•19 years ago
|
||
And looks like the times on luna are just being very jumpy... it's been back and forth from 2030 to 2080 ever since roc's scrollframe changes. :(
You need to log in
before you can comment on or make changes to this bug.
Description
•