Opened 6 years ago

Closed 5 years ago

#10214 closed bug (fixed)

WebPositive: border-radius make border color overwrite background.

Reported by: dsjonny Owned by: pulkomandy
Priority: normal Milestone: R1
Component: Applications/WebPositive Version: R1/Development
Keywords: Cc:
Blocked By: #10645 Blocking: #10311, #10319, #10624
Has a Patch: no Platform: All

Description

Using WebPositive/1.2 there are many sites have drawing problem. Many html elements are not updated or drawing with gray color.

For example: Trac, Building Haiku Guide, Facebook...

Some images attached.

Attachments (3)

screenshot1.png (65.0 KB) - added by dsjonny 6 years ago.
screenshot2.png (110.1 KB) - added by dsjonny 6 years ago.
wp.1.2.png (21.5 KB) - added by dsjonny 6 years ago.

Download all attachments as: .zip

Change History (13)

Changed 6 years ago by dsjonny

Attachment: screenshot1.png added

Changed 6 years ago by dsjonny

Attachment: screenshot2.png added

Changed 6 years ago by dsjonny

Attachment: wp.1.2.png added

comment:1 Changed 6 years ago by diver

Owner: changed from leavengood to pulkomandy
Status: newassigned

comment:2 Changed 6 years ago by pulkomandy

What happens is the CSS border color is used for the background as well. This shows mostly on things using border-radius (rounded rectangles).

comment:3 Changed 5 years ago by pulkomandy

Summary: WebPositive: page drawing problemWebPositive: border-radius make border color overwrite background.

comment:4 Changed 5 years ago by diver

Blocking: 10319 added

comment:5 Changed 5 years ago by pulkomandy

Blocking: 10311 added

comment:6 Changed 5 years ago by pulkomandy

The situation is better now, http://haiku-os.org works as expected, and so does http://whatif.xkcd.com. But not all issues are solved. It seems that a border of more than 1 pixel will still trigger the issue. Investigating...

comment:7 Changed 5 years ago by pulkomandy

Problem identified, I think. When the border is only 1 pixel big, it is drawn using line drawing primitives. When it is bigger, it is drawn as a BShape made of 2 parts:

  • An "outside" polygon that marks the outside limit of the border
  • An "inside" polygon that marks the inside limit (where the contents starts)

The idea is that these should "cancel" each other, so the BShape is filled with a hole in the middle, letting the contents shine through. There are two ways to do this:

  • Use the even/odd fill rule, or
  • Use the "winding"/"non-zero" rule, and make sure the two polygons are in opposite directions (one should be clockwise, and the other counter-clockwise). This way the winding of the intersection part will be 0, not 1. Note that such a polygon would also work with the even/odd rule.

In Haiku, we don't have an API for using the even/odd rule. Unfortunately, WebKit apparently expects us to use the first way.

I'll see if I can change this in WebKit. However, supporting both winding rules in Haiku will be required at some later point, anyway. (they are part of the canvas API).

comment:8 Changed 5 years ago by pulkomandy

Blocked By: 10645 added

comment:9 Changed 5 years ago by pulkomandy

Blocking: 10624 added

(In #10624) This is actually a duplicate of #10214, or close enough that the fix for them two is the same.

comment:10 Changed 5 years ago by pulkomandy

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.