Rounded Borders dont support a dashed/dotted style



20 years ago
6 years ago


(Reporter: christinehoff4, Assigned: kae)



Dependency tree / graph

Firefox Tracking Flags

(Not tracked)




(1 attachment)



20 years ago
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.

Comment 1

20 years ago


20 years ago
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...

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

  <style type="text/css">
     div { -moz-border-radius:50px; padding: 10px; margin: 10px; }
  <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.


20 years ago
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.]


20 years ago
Blocks: 16950


20 years ago
Last Resolved: 20 years ago
Resolution: --- → REMIND

Comment 5

20 years ago
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.
*** Bug 18993 has been marked as a duplicate of this bug. ***
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:
Just move these two lines:
   (~2562)       case NS_STYLE_BORDER_STYLE_DOTTED:
   (~2563)       case NS_STYLE_BORDER_STYLE_DASHED: 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
Resolution: REMIND → ---


20 years ago
Last Resolved: 20 years ago20 years ago
Resolution: --- → REMIND

Comment 9

20 years ago
It now will default to solid for those styles until I get to putting in dotted
and dashed styles.  Thanks for the info!!!!
Verified with:
Behaviour: dotted and dashed styles use solid style for now.
Keywords: css-moz
REMIND is deprecated per bug 35839.
Resolution: REMIND → ---
Assignee: dcone → dbaron
QA Contact: chrisd → ian
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

Comment 16

16 years ago
*** 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. ***

Comment 20

14 years ago
*** Bug 288672 has been marked as a duplicate of this bug. ***

Comment 21

14 years ago
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?

Comment 22

14 years ago
I found a page with the required maths:

now I need to learn how to read the maths....

Comment 23

14 years ago
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....

Comment 26

14 years ago
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.

Comment 27

14 years ago
I have an example of a dashed curve now.

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 

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

Oh - could someone assign this bug to me? I seem to be the only one active on 
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.

Comment 29

14 years ago
According to the following URL, the new API will be available soon:

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
Duplicate of this bug: 374266

Comment 32

12 years ago
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

Comment 33

12 years ago
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.

Comment 35

11 years ago
What's the version for your Firefox? In the latest non-beta Firefox, the bug is gone
Product: Core → Core Graveyard

Comment 36

10 years ago
(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.
Last Resolved: 20 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.