Closed Bug 13944 Opened 25 years ago Closed 15 years ago

Rounded Borders dont support a dashed/dotted style

Categories

(Core Graveyard :: GFX, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: christinehoff4, Assigned: kae)

References

()

Details

(Keywords: css-moz)

Attachments

(1 file)

Using 9/15 build on Win 95, Win 98, Win NT, Mac8.5 and Linux Red Hat 6.0. Bug is
across platform.

Open the attached file. Style assigned to input element is "border: green dashed
1px; padding: 50px"

Expected result: border should be dashed.
Actual result: border is solid.
Status: NEW → ASSIGNED
Summary: Border style not displaying properly on radio button → {css-moz} -moz-border-radius and border-style:dashed don't work
This isn't anything to do with radio buttons especially. It is a clash of the
border styles and the -moz-border-radius property.

For example, the following border is solid, not dashed:

   <div style="border: dashed; -moz-border-radius: 10px;">
      Hello World...
   </div>

The same problem occurs with some other types of border. Changing the width has
some effect too. For example, the divs in the following test snippet all show
problems:

  <style type="text/css">
     div { -moz-border-radius:50px; padding: 10px; margin: 10px; }
  </style>
  <div style="border: inset 1px">inset 1px</div>
  <div style="border: dotted 1px">dotted 1px</div>
  <div style="border: dotted 2px">dotted 2px</div>
  <div style="border: dashed 20px">dashed 20px</div>

(In fact, the last two don't draw at all!)

This should probably be assigned to whoever wrote the border drawing code.
Summary: {css-moz} -moz-border-radius and border-style:dashed don't work → Rounded Borders dont support a dashed style
Summary: Rounded Borders dont support a dashed style → {css-moz} Rounded Borders dont support a dashed style
[Reinstating {css-moz} radar. I use this to keep track of all bugs related to
CSS issues.]
Blocks: 16950
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → REMIND
This is true... and probably will at a later time.  Currently the rounded
attribute is not a fully supported feature for use with all border styles.
Status: RESOLVED → VERIFIED
Okiedokie.
*** Bug 18993 has been marked as a duplicate of this bug. ***
Status: VERIFIED → REOPENED
Summary: {css-moz} Rounded Borders dont support a dashed style → {css-moz} Rounded Borders dont support a dashed/dotted style
Don: Could you change the logic so that dotted/dashed borders just draw a solid
line, instead of nothing? According to CSS2, interpreting 'dotted' and 'dashed'
as 'none' or 'transparent' is wrong, but interpreting them as 'solid' is ok:

# Conforming HTML user agents may interpret 'dotted', 'dashed', 'double',
# 'groove', 'ridge', 'inset', and 'outset' to be 'solid'.
(Section 8.5.3)

This would involve changing nsCSSRendering::RenderSide, which is in:
   layout/html/style/src/nsCSSRendering.cpp
Just move these two lines:
   (~2562)       case NS_STYLE_BORDER_STYLE_DOTTED:
   (~2563)       case NS_STYLE_BORDER_STYLE_DASHED:
...to just above this line:
   (~2515)       case NS_STYLE_BORDER_STYLE_SOLID:

I'm reopening the bug to track this quick issue, then we can move it back to
VERIFIED REMIND.
Resolution: REMIND → ---
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → REMIND
It now will default to solid for those styles until I get to putting in dotted
and dashed styles.  Thanks for the info!!!!
Status: RESOLVED → VERIFIED
Verified with:
   http://www.bath.ac.uk/%7Epy8ieh/m/border-radius-dotted.html
Behaviour: dotted and dashed styles use solid style for now.
Keywords: css-moz
REMIND is deprecated per bug 35839.
Status: VERIFIED → REOPENED
Resolution: REMIND → ---
->default
Assignee: dcone → dbaron
Status: REOPENED → NEW
QA Contact: chrisd → ian
->GFX
Assignee: dbaron → kmcclusk
Component: Style System → GFX Compositor
QA Contact: ian → petersen
Reassigning to Don.
Assignee: kmcclusk → dcone
Priority: P3 → P5
Target Milestone: --- → Future
*** Bug 153322 has been marked as a duplicate of this bug. ***
Summary: {css-moz} Rounded Borders dont support a dashed/dotted style → Rounded Borders dont support a dashed/dotted style
*** Bug 207902 has been marked as a duplicate of this bug. ***
*** Bug 224244 has been marked as a duplicate of this bug. ***
*** Bug 266099 has been marked as a duplicate of this bug. ***
*** Bug 271372 has been marked as a duplicate of this bug. ***
*** Bug 288672 has been marked as a duplicate of this bug. ***
I'm almost finished writing code which can handle dashed curves. All I need now
is to figure out a formula for finding the various angles of the beginnings and
endings of the dashes. I've been searching various maths sites, but cannot find
the information - does anyone have a useful URL?
I found a page with the required maths:
http://en.wikipedia.org/wiki/Elliptic_integral

now I need to learn how to read the maths....
The math is too hard for me to follow :(

To explain the problem - to draw dashes on a curved line, I need to know where 
each dash begins and ends. For that, I need the angles, so I can get the Tan 
of those angles to figure out the intersection areas.

That is simple, where pure circles are concerned. However, I am working on 
providing the full elliptical curve, as proposed in the W3C's CSS3 draft.
  Getting the exact start angle of a dash on an ellipse is very complex. Even 
just getting the length of the diameter involves integral calculus. Getting 
the angle, though, involves figuring out exactly what point is x far from 
another point, following the elliptic route. There be dragons!

So, unless anyone out there in mozilla-land is a maths genius and can hand me 
a useful formula to solve this, I think I'll solve it by approximating - I'll 
count the pixels (twips, actually) around the ellipse, and use that to guess 
where the angles might be.

I should be ready with this in a few days.
cc'ing some maths geeks. See comment 23.
How bad are the results if you just use dashlength/current_radius for the angle
(in radians)?  For dashes that are short compared to the size of the corner and
for corners that are close to circular that should work well.  For
|border-radius: 1px 3px| it might not work so great, though....
Boris - it may work fine for ellipses that are close to circular, but we all
know that when people realise that they can create elliptical corners, they
will, so correct-length dashes will be important.

Besides - dashes that vary in length would not matter too much, but would look
just plain wrong in the case of dots.

I'm working on dashed code at the moment - I'm going to count the twips and work
it out that way - I think it may look acceptable.

I hope to have a fully-working example in a few days - I have managed to produce
dashed curves already by hard-coding some start/end angles - just need to
generate the angles automatically now.
I have an example of a dashed curve now.
http://verens.com/demos/borders/dashed-curve.html

Once I've ironed out some kinks in that, and applied the same algorithm to all 
the other corners, I can do doubled borders and then convert to C++ for 
firefox.

Note that it is anti-aliased. Just an added bonus. That also needs a little 
work.

Oh - could someone assign this bug to me? I seem to be the only one active on 
it.
Assignee: dcone → kae
Maybe the right way to approach this, given that we're going to be using cairo,
is to get cairo to flatten the curve to line segments and then apply dashing to
those line segments.
According to the following URL, the new API will be available soon:
http://weblogs.mozillazine.org/roc/archives/2005/07/gecko_19.html

Does anyone know if it handles anti-aliasing automatically, or would I need to 
port my anti-aliasing code from my JavaScript as well? The anti-aliasing is the 
most difficult part of my algorithm.
cairo does some antialiasing automatically. It may not work right for multiple
borders. See http://wiki.mozilla.org/Mozilla2:Antialiasing
This has changed significantly with bug 368247: only the corner is solid. Adding dependency of bug 382721 (corners are always solid).
Depends on: 382721
OS: Windows 95 → All
Actually it's not only corners that are solid. With the latest SeaMonkey nightly build, I still get some solid borders. See bug 380549 comment #8 .
FWIW, I was reading into C++0x recently, and TR1 introduced some new mathematics libraries into C++, including methods for complete and incomplete elliptic integrals.

But I doubt any of that is supported in Visual Studio, or possibly even recent versions of GCC.
What's the version for your Firefox? In the latest non-beta Firefox, the bug is gone
Product: Core → Core Graveyard
(In reply to comment #32)

So I'd say FIXED by bug 368247 ?
The remaining issue is bug 382721.
Yes, let's close this out and do the remaining piece in bug 382721.
Status: NEW → RESOLVED
Closed: 25 years ago15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: