Closed
Bug 1781
Opened 26 years ago
Closed 19 years ago
1px double border invisible (was: division of space within double borders)
Categories
(Core :: Layout: Block and Inline, defect, P2)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: dbaron, Assigned: zbraniecki)
References
()
Details
(Keywords: css1, testcase, Whiteboard: [nsbeta3-][CSS1-5.5.22])
Attachments
(3 files, 4 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
asa
:
review+
asa
:
superreview+
asa
:
approval-aviary1.1a2+
|
Details | Diff | Splinter Review |
The inside and outside edges of double borders are not always even. Often the
different sides are not even consistent. I would recommend the following
algorithm, since it works at small px values, which are currently also a
problem (this refers to width in px):
If width is a multiple of 3 : split evenly among border/noborder/border
If width is two more than a multiple of 3: make the gap 1px smaller than either
side.
There are two alternatives for the third case:
1) If width is one more than a multiple of 3: make the outer border 1px bigger
than the gap or the inner border (this is what MSIE does, but I don't like it
very much either. On second though, however, I guess I prefer it to the
following.)
2) If width is one more than a multiple of 3: make the gap 2px smaller than
either side (this has the disadvantage that the gap for a 4px border would be
0px, while the gap for a 3px border would be 1px)
See the test case above (it should be useful).
Reporter | ||
Comment 1•26 years ago
|
||
Actually, choice two is basically out, because it yields what would end up
being a 3px solid border for the 1px case. I think choice 1 is really the only
way to do it.
Reporter | ||
Comment 2•26 years ago
|
||
Actually, there is another way
3) If width is one more than a multiple of 3: make the gap 1px larger than it
otherwise would be, and handle 1px as a special case. This is probably the
best way, even though the gap sizes progress (starting with 1px:
0,0,1,2,1,2,3,2,3,4,...) - the trick is to make the 1px case yield a 0px gap
and not a 1px gap. This is done by Opera.
Reporter | ||
Comment 3•26 years ago
|
||
You seem to have chosen method 3, except that you haven't handled 1px as a
special case yet. So most of the issues are fixed for borders in px.
However, thin, medium, and thick still act very strangely. It would seem to me
that if you just internally converted them to px then they would work fine.
(Or are they in some other unit that doesn't work as well?) Perhaps if you
converted to px before doing some of the calculations?
Updated•26 years ago
|
QA Contact: 4110
Comment 5•26 years ago
|
||
assigning ChrisD as qa
Reporter | ||
Comment 6•26 years ago
|
||
I think most of this was fixed by what peterl did to bug 1052. That is, edges
are even now. I think the only real remaining issue is the 1px borders, unless
you want to change the way you are doing the others.
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M5 → M7
Updated•25 years ago
|
Target Milestone: M7 → M8
Reporter | ||
Comment 7•25 years ago
|
||
I'm seeing uneven borders again, as I described originally.
Reporter | ||
Comment 8•25 years ago
|
||
To be more specific, I'm seeing problems on 1px, 2px, 4px, and 5px, on the top
and bottom borders (plus, you're not correcting for 1px, which really makes the
1px problem on the sides).
Updated•25 years ago
|
Target Milestone: M8 → M9
Comment 9•25 years ago
|
||
Moving to M9
Updated•25 years ago
|
Target Milestone: M9 → M10
Comment 10•25 years ago
|
||
Moving to M10.
Comment 11•25 years ago
|
||
On WIN32 the double borders look OK. On Linux they are uneven. In addition the
double border with width = 1 does not appear on WIN32. The problem is that
nsCSSRendering::MakeSide creates a polygon where the coordinates x1, y1, x2, y2,
x3, y3, x4, y4 are set to y1 = y2 = y3 = y4. This produces a line on GTK but
fails to render anything on WIN32. Simply substituting a line in this case is
not sufficient. Lines do not have the same pixel coverage as a polygon for the
same set of vertices. The ending point of a line is not covered.
The uneven borders are probably caused by rounding errors caused by the nscoord
truncating the calculation of the edges.
if (borderPart == BORDER_INSIDE) {
outsideEdge = nscoord(outsideEdge * borderFrac + insideEdge * borderRest);
outsideTL = nscoord(outsideTL * borderFrac + insideTL * borderRest);
outsideBR = nscoord(outsideBR * borderFrac + insideBR * borderRest);
} else if (borderPart == BORDER_OUTSIDE ) {
insideEdge = nscoord(insideEdge * borderFrac + outsideEdge * borderRest);
insideTL = nscoord(insideTL * borderFrac + outsideTL * borderRest);
insideBR = nscoord(insideBR * borderFrac + outsideBR * borderRest);
}
Updated•25 years ago
|
Target Milestone: M10 → M11
Comment 12•25 years ago
|
||
Moving to M11
Updated•25 years ago
|
Summary: division of space within double borders → {css1} division of space within double borders
Updated•25 years ago
|
Target Milestone: M11 → M13
Comment 13•25 years ago
|
||
Moving to M13
Updated•25 years ago
|
Assignee: kmcclusk → dcone
Status: ASSIGNED → NEW
Comment 14•25 years ago
|
||
This problem is caused by not rounding off the twips to pixel boundaries.
Don you already have code to fix this for rounded rects, so I'm re-assigning to
you so you can fix it for regular border rects.
Updated•25 years ago
|
Assignee: dcone → kmcclusk
Comment 15•25 years ago
|
||
Transform fix has killed the line spacing problem. Half the problem.
Giving it back to you Kevin for disposition on the other problems.
Updated•25 years ago
|
Target Milestone: M13 → M14
Comment 16•25 years ago
|
||
Moving to M14
Updated•25 years ago
|
Status: NEW → ASSIGNED
Updated•25 years ago
|
Target Milestone: M14 → M15
Comment 17•25 years ago
|
||
Migrating from {css1} to css1 keyword. The {css1}, {css2}, {css3} and {css-moz}
radars should now be considered deprecated in favour of keywords.
I am *really* sorry about the spam...
Comment 18•25 years ago
|
||
Recap of the remaining problem:
the double border with width = 1 does not appear on WIN32. The problem is that
nsCSSRendering::MakeSide creates a polygon where the coordinates x1, y1, x2, y2,
x3, y3, x4, y4 are set to y1 = y2 = y3 = y4. This produces a line on GTK but
fails to render anything on WIN32. Simply substituting a line in this case is
not sufficient. Lines do not have the same pixel coverage as a polygon for the
same set of vertices. The ending point of a line is not covered.
Updated•25 years ago
|
Summary: {css1} division of space within double borders → division of space within double borders
Comment 19•25 years ago
|
||
Moving to M16.
In nsRenderingContextWin :: DrawPolygon we need to look for the case described
above and render the Polygon as a line with the proper pixel coverage.
Target Milestone: M15 → M16
Comment 21•24 years ago
|
||
Moving to M18
Updated•24 years ago
|
Target Milestone: M17 → M18
Comment 22•24 years ago
|
||
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Target Milestone: M18 → Future
Comment 23•24 years ago
|
||
Attempting to reassign bug.
Assignee: kmcclusk → dcone
Status: ASSIGNED → NEW
Component: Layout → XP Toolkit/Widgets
Keywords: nsbeta3
OS: other → All
QA Contact: chrisd → petersen
Hardware: Other → All
Summary: division of space within double borders
Target Milestone: Future → ---
Reporter | ||
Comment 24•24 years ago
|
||
Restoring original summary and component.
Component: XP Toolkit/Widgets → Compositor
Summary: division of space within double borders
Comment 25•24 years ago
|
||
This is for Kevin to disposition and assign. Why was this taken off of future?
Assignee: dcone → kmcclusk
Comment 27•24 years ago
|
||
The only remaining problem is that the double border with width = 1 does not
appear on WIN32.
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Status: NEW → ASSIGNED
Target Milestone: M22 → Future
Comment 29•24 years ago
|
||
Use border width = 2 as a work around. Will fix in a future release
Whiteboard: nsbeta3-
Comment 31•24 years ago
|
||
*** Bug 54827 has been marked as a duplicate of this bug. ***
Updated•24 years ago
|
QA Contact: petersen → chrisd
Comment 32•24 years ago
|
||
Netscape's standard compliance QA team reorganised itself once again, so taking
remaining non-tables style bugs. Sorry about the spam. I tried to get this done
directly at the database level, but apparently that is "not easy because of the
shadow db", "plus it screws up the audit trail", so no can do...
QA Contact: chrisd → ian
Comment 33•23 years ago
|
||
Updating summary based on Kevin's last few comments.
What I see now (for <input> elements):
- "1px double" or "thin double" makes a single, thin border appear, and only on
the right.
- "2px double" makes a single, thick border appear on the top, bottom, and
left. A single, thin border appears on the right, just as with "1px double".
- "3px double" does what you want it to do (two thin borders around the
element).
Summary: division of space within double borders → 1px double border invisible on win32 (was: division of space within double borders)
Comment 34•23 years ago
|
||
still able to reproduce this bug on win32 buildID: 2001-10-22-18-0.9.4 (branch
build) and macOS9.1 buildID: 2001-10-20-113.0.9.4 (branch build)
Updated•23 years ago
|
Whiteboard: [nsbeta3-] → [nsbeta3-][CSS1-5.5.22]
Reporter | ||
Comment 35•22 years ago
|
||
*** Bug 139193 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 36•22 years ago
|
||
*** Bug 22881 has been marked as a duplicate of this bug. ***
Comment 37•22 years ago
|
||
*** Bug 156003 has been marked as a duplicate of this bug. ***
Comment 38•22 years ago
|
||
I have a similar problem with the borders implementation in Mozilla. whenever I
assign a border to the <body> tag Mozilla hacks the borders of all css elements
in the page. please see http://jim.macdonald.org/test.html as an example.
Comment 39•22 years ago
|
||
I saved a local copy of http://jim.macdonald.org/test.html and removed the body
borders. Nothing really changed, so the problem there isn't the body borders
(it's actually the way the CSS is authored), and it's not really relevant to
this bug anyway.
Comment 40•22 years ago
|
||
The "on Win32" really ought to come out the summary. Using Linux 1.2 on a P
tag, "double black 1px" gives no border at all. nor does using "thin" instead.
"double thick black" will give a double border. [Also checked in Galeon 1.2.6
on a different machine]
Comment 41•22 years ago
|
||
Expected: Three double-underlines paragraphs
Result: [Linux 1.2] Only third paragraph has any border
Reporter | ||
Comment 42•22 years ago
|
||
*** Bug 114336 has been marked as a duplicate of this bug. ***
Comment 43•21 years ago
|
||
*** Bug 204378 has been marked as a duplicate of this bug. ***
Reporter | ||
Updated•21 years ago
|
Comment 44•20 years ago
|
||
*** Bug 273712 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Assignee: kmcclusk → win32
Status: ASSIGNED → NEW
Comment 45•20 years ago
|
||
Comment 46•20 years ago
|
||
*** Bug 282929 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Assignee: win32 → nobody
Component: GFX: Win32 → Layout: Block and Inline
QA Contact: ian → layout.block-and-inline
Summary: 1px double border invisible on win32 (was: division of space within double borders) → 1px double border invisible (was: division of space within double borders)
Assignee | ||
Comment 47•19 years ago
|
||
taking.
Assignee: nobody → gandalf
Target Milestone: Future → mozilla1.9alpha
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 48•19 years ago
|
||
fix. This patch adds forceSolid array to PaintBorder and optional boolean
argument aFrameSolid to DrawSide.
Attachment #183334 -
Flags: superreview?(roc)
Attachment #183334 -
Flags: review?(roc)
Why do you need to add the parameter to DrawSide? You should be able to just
change the passed-in borderStyle.
+ forceSolid[cnt] = (aBorderStyle.GetBorderStyle(cnt) ==
NS_STYLE_BORDER_STYLE_DOUBLE
You should probably wrap this entire block of code (including the switch) in "if
(aBorderStyle.GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_DOUBLE)"
+ && sizeWidth/twipsPerPixel == 1);
Maybe this should be sizeWidth/twipsPerPixel < 2
Assignee | ||
Comment 50•19 years ago
|
||
(In reply to comment #49)
> Why do you need to add the parameter to DrawSide? You should be able to just
> change the passed-in borderStyle.
But I need to determinate if the border width is 1px. It is hard to do this from
inside DrawSide. I can do this by doing
(borderInside.x+borderInside.width)-(borderOutside.x+borderOutside.width) and
stuff like this for every border...
> + forceSolid[cnt] = (aBorderStyle.GetBorderStyle(cnt) ==
> NS_STYLE_BORDER_STYLE_DOUBLE
>
> You should probably wrap this entire block of code (including the switch) in "if
> (aBorderStyle.GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_DOUBLE)"
>
> + && sizeWidth/twipsPerPixel == 1);
right
> Maybe this should be sizeWidth/twipsPerPixel < 2
If it's possible that 0 > sizeWidth/twipsPerPixel > 2 and not 1 then sure.
I'll send updated patch as soon as you agree (or not) on that parameter.
(In reply to comment #50)
> (In reply to comment #49)
> > Why do you need to add the parameter to DrawSide? You should be able to just
> > change the passed-in borderStyle.
>
> But I need to determinate if the border width is 1px. It is hard to do this from
> inside DrawSide. I can do this by doing
> (borderInside.x+borderInside.width)-(borderOutside.x+borderOutside.width) and
> stuff like this for every border...
Instead of passing PR_TRUE for aForceSolid, you could just pass
NS_STYLE_BORDER_STYLE_SOLID as the style when you call DrawSide.
Assignee | ||
Comment 52•19 years ago
|
||
patch addresses roc's notes.
Attachment #183334 -
Attachment is obsolete: true
Attachment #184142 -
Flags: review?(roc)
Assignee | ||
Updated•19 years ago
|
Attachment #183334 -
Flags: superreview?(roc)
Attachment #183334 -
Flags: review?(roc)
Instead of the switch, it would be more readable to write this:
nscoord widths = { border.bottom, border.left, border.top, border.right };
forceSolid = widths[cnt]/twipsPerPixel < 2;
The comment should also be a bit more meaningful. I would just say
// If a side needs a double border but will be less than two pixels,
// force it to be solid (see bug 1781).
With that, r+sr=roc
Assignee | ||
Comment 55•19 years ago
|
||
umm, this one compiles :)
Attachment #184168 -
Attachment is obsolete: true
Assignee | ||
Comment 56•19 years ago
|
||
comment updated and removed trailing spaces.
Attachment #184170 -
Attachment is obsolete: true
Comment 57•19 years ago
|
||
+ /*
+ If a side needs a double border but will be less than two pixels,
+ force it to be solid (see bug 1781).
+ */
is that comment style the style of the file? seems to me like it almost
exclusively uses the style roc used in his comment...
Assignee | ||
Updated•19 years ago
|
Attachment #184142 -
Flags: review?(roc)
Assignee | ||
Comment 58•19 years ago
|
||
Comment on attachment 184171 [details] [diff] [review]
patch v6
I'll fix comment style before checkin
Attachment #184171 -
Flags: approval-aviary1.1a2?
Comment 59•19 years ago
|
||
I don't see reviews flagged on this patch. Can you get the appropriate reviews
noted there? Thanks.
Assignee | ||
Comment 60•19 years ago
|
||
Comment on attachment 184171 [details] [diff] [review]
patch v6
In comment 53 Roc gave me r+sr, next patches were only about comments, no
changes in code.
Attachment #184171 -
Flags: superreview?(roc)
Attachment #184171 -
Flags: review?(roc)
Comment 61•19 years ago
|
||
Comment on attachment 184171 [details] [diff] [review]
patch v6
sorry, didn't see that in the comments. Approved.
Attachment #184171 -
Flags: superreview?(roc)
Attachment #184171 -
Flags: superreview+
Attachment #184171 -
Flags: review?(roc)
Attachment #184171 -
Flags: review+
Attachment #184171 -
Flags: approval-aviary1.1a2?
Attachment #184171 -
Flags: approval-aviary1.1a2+
Assignee | ||
Comment 62•19 years ago
|
||
Comment on attachment 184171 [details] [diff] [review]
patch v6
Checking in layout/base/nsCSSRendering.cpp;
/cvsroot/mozilla/layout/base/nsCSSRendering.cpp,v <-- nsCSSRendering.cpp
new revision: 3.261; previous revision: 3.260
done
Assignee | ||
Updated•19 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•