Closed Bug 310124 Opened 19 years ago Closed 19 years ago

Double border is incorrectly compressed when rendered; regression.

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: mbolin, Assigned: masayuki)

References

()

Details

(Keywords: fixed1.8.1, regression, testcase)

Attachments

(4 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

In Firefox 1.0.7, a double border was given its correct spacing. In Firefox
1.5b1, this is not the case. The provided URL demonstrates this problem where a
double border is compressed into a single line for certain screen resizings.

Reproducible: Always

Steps to Reproduce:
1. Go to http://www.bolinfest.com/mozilla/missing_border.html
2. Click the link to show the page at the specified size


Actual Results:  
Look at the 4th border and note it is compressed.

Expected Results:  
Should have been a double border with a visible space between the two lines.
Somewhere in March 2005.
Build with double line: 1.8b2_2005032807
Build with single line: 1.8b2_2005032906
I get the same regression range (although it's not clear to me what is causing it)
http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-03-28+07%3A00%3A00&maxdate=2005-03-29+07%3A00%3A00&cvsroot=%2Fcvsroot
Status: UNCONFIRMED → NEW
Component: General → Layout
Ever confirmed: true
Keywords: regression, testcase
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → Trunk
taking.
Assignee: nobody → masayuki
same problem is occured with "groove" and "ridge".
See this groove case.
http://bugzilla.mozilla.gr.jp/attachment.cgi?id=2982&action=view
Status: NEW → ASSIGNED
Hardware: PC → All
Target Milestone: --- → mozilla1.9alpha
It looks like this allows a 1px double border to be drawn 2px wide, and thus extend outside layout's border-box for the frame. Is that true?
(In reply to comment #7)
> It looks like this allows a 1px double border to be drawn 2px wide, and thus
> extend outside layout's border-box for the frame. Is that true?
> 

I cannot reproduce it on comment 6's testcase.
But I can see sometimes the case in 0.5px + ridge or groove cases.
This patch has a ploblem when the border-width < 1px.
But I think that we can fix this problem by fixing bug 287624.
roc:

We don't draw 2px wide if the border-width < 1px. See:
http://lxr.mozilla.org/mozilla/source/layout/base/nsCSSRendering.cpp#1807
> 1807     // If a side needs a double border but will be less than two pixels,
> 1808     // force it to be solid (see bug 1781).
> 1809     if (aBorderStyle.GetBorderStyle(side) == NS_STYLE_BORDER_STYLE_DOUBLE) {
> 1810       nscoord widths[] = { border.top, border.right, border.bottom, border.left };
> 1811       forceSolid = (widths[side]/twipsPerPixel < 2);
> 1812     } else 
> 1813       forceSolid = PR_FALSE;

Sorry.

> We don't draw 2px wide if the border-width < 1px. See:

We don't draw 2px wide if the border-width < 2px. See:
                                            ^^^
Ah... Should we expand this code as following?

> 1809     if (aBorderStyle.GetBorderStyle(side) == NS_STYLE_BORDER_STYLE_DOUBLE ||
               aBorderStyle.GetBorderStyle(side) == NS_STYLE_BORDER_STYLE_GROOVE ||
               aBorderStyle.GetBorderStyle(side) == NS_STYLE_BORDER_STYLE_RIDGE) {
> 1810       nscoord widths[] = { border.top, border.right, border.bottom, border.left };
> 1811       forceSolid = (widths[side]/twipsPerPixel < 2);

Attached patch Patch rv1.1Splinter Review
This patch looks better than previous patch.
Attachment #203691 - Attachment is obsolete: true
Attachment #203758 - Flags: superreview?(roc)
Attachment #203758 - Flags: review?(roc)
Attachment #203691 - Flags: superreview?(roc)
Attachment #203691 - Flags: review?(roc)
Attachment #203758 - Flags: superreview?(roc)
Attachment #203758 - Flags: superreview+
Attachment #203758 - Flags: review?(roc)
Attachment #203758 - Flags: review+
checked-in. Thank you Ichimaru-san.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Oops, now, the tree is closed, I backed out the patch.
I will retry to check-in after opened.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
checked-in.
Status: REOPENED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
Masayuki Nakano, do you want to add that testcase to the layout regression tests?  Or should I do it?
(In reply to comment #17)
> Masayuki Nakano, do you want to add that testcase to the layout regression
> tests?  Or should I do it?

What's? I cannot understand what you say...
Does this patch make regression?
No, this didn't cause a regression.  What I was saying was that if we can create a testcase for this bug that shows the problem when just loaded in a window (independently of window size), we should check the testcase into CVS at http://lxr.mozilla.org/seamonkey/source/layout/html/tests/block/bugs/ and add it to the list at http://lxr.mozilla.org/seamonkey/source/layout/html/tests/block/bugs/rtest.lst so that running the layout regression tests would catch this bug being reintroduced if that ever happens.

The problem would be writing such a testcase, I guess.  I hadn't realized till I just looked at it that this testcase depends on a particular window size.  :(
(In reply to comment #19)
Yes. This bug is reproduced *sometimes*. But I can see this bug in this testcase.
http://bugzilla.mozilla.gr.jp/attachment.cgi?id=2981&action=view

if "border: double 2px;", the border should be rendered as two pixel width solid line. And if "border: double 5px;" or "border: double 7px;", these twin lines should be rendered always same witdh.

And "border-width: 0.5px;", it should be rendered as 1px line. Because it means border. We should render the border, even if we ignore the width.
# but we are having this bug in dotted and dashed cases.
# This, I will file a new bug and fix it.

I think that we can make stable testcase with above cases.
Attached file testcase3
Something like this? I think this is a testcase that is resolution independant.
Maybe a more elaborate testcase (like from comment 20) is needed that is also resolution independant.
Flags: blocking1.8.1?
Flags: blocking1.8.1? → blocking1.8.1+
Attachment #203758 - Flags: approval-branch-1.8.1+
checked-in to 1.8 branch.
Keywords: fixed1.8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: