Rounded Borders dont support a dashed/dotted style

RESOLVED FIXED in Future

Status

Core Graveyard
GFX
P5
normal
RESOLVED FIXED
18 years ago
5 years ago

People

(Reporter: Christine Hoffman, Assigned: Kae Verens)

Tracking

({css-moz})

Trunk
Future
css-moz
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

18 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.
(Reporter)

Comment 1

18 years ago
Created attachment 1683 [details]
Test case to demonstrate problem

Updated

18 years ago
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.
See also bug 6772.

Updated

18 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.]

Updated

18 years ago
Blocks: 16950

Updated

18 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → REMIND

Comment 5

18 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.
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 → ---

Updated

18 years ago
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → REMIND

Comment 9

18 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!!!!
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

Comment 16

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

Comment 18

13 years ago
*** Bug 266099 has been marked as a duplicate of this bug. ***
*** Bug 271372 has been marked as a duplicate of this bug. ***

Comment 20

12 years ago
*** Bug 288672 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 21

12 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?
(Assignee)

Comment 22

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

Comment 23

12 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....
(Assignee)

Comment 26

12 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.
(Assignee)

Comment 27

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

Comment 29

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

Comment 32

10 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

10 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

9 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

8 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.
Status: NEW → RESOLVED
Last Resolved: 18 years ago8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.