Ticket #3359 (closed feature: fixed)

Opened 2 years ago

Last modified 22 months ago

svg2: rendering problem in firefox

Reported by: arno Owned by: ahocevar
Priority: minor Milestone: 2.11 Release
Component: Renderer.NG Version: 2.11 RC1
Keywords: Cc: aguertin
State: Pullup

Description

Hi, I tried svg2 to render some linestrings and encountered some problems with firefox (ffx4, and nightly build)

It works fine at some zoom level, but linestring disappear when zoom is high. Here is a short testcase:  http://renevier.net/bugs/23.html geometry is correctly displayed in chromium, but is not displayed in firefox.

Attachments

openlayers-3359.patch Download (7.0 KB) - added by ahocevar 23 months ago.

Change History

  Changed 23 months ago by aguertin

  • cc aguertin added

  Changed 23 months ago by aguertin

Some basic tests I've done seem to indicate that this is because of coordinate overrun in firefox. No proof yet, unfortunately.

follow-up: ↓ 6   Changed 23 months ago by ahocevar

@aguertin: you are right. It's because of the CSS left and top coordinates of the layer's div. Maybe it's possible to fix this by juggling with the svg viewBox to get the offset in SVG instead of CSS. If this also fails, we can only create a minimal html example for the Gecko bug tracker, so the issue can be fixed in Firefox.

Changed 23 months ago by ahocevar

  Changed 23 months ago by ahocevar

  • state set to Review

Thanks @arno for the test case. I simplified it a bit and included it as manual test case in openlayers-3359.patch Download.

The solution was indeed to reduce the range of CSS coordinates used, by changing the renderer's extent from the map's maxExtent to the current map extent scaled by 3.

The manual test now passes in FF3, FF4, FF5 and Safari5. Unit tests still pass in Safari5. Thanks for any review.

  Changed 23 months ago by ahocevar

  • milestone changed from 2.12 Release to 2.11 Release

Setting the milestone to 2.11, since the SVG2 layer is new in this release and we want it to work, don't we?

in reply to: ↑ 3   Changed 23 months ago by arno

Thanks for fixing it.

Replying to ahocevar: If this also fails, we can only create a minimal html example for the Gecko bug tracker, so the issue can be fixed in Firefox.

By the way, even if it's not needed anymore for OpenLayers, I've setup a minimal html example, and opened a bug on mozilla side:  https://bugzilla.mozilla.org/show_bug.cgi?id=670438

follow-up: ↓ 8   Changed 23 months ago by ahocevar

@arno: thanks for the Mozilla bug report, but the information you provide there is not accurate. This issue is different than the cairo issue you referenced. The cairo issue is one we ran into in the past, but it is fixed. The one we're facing now is that css left and top positions have a limited coordinate range.

in reply to: ↑ 7   Changed 23 months ago by arno

Replying to ahocevar:

@arno: thanks for the Mozilla bug report, but the information you provide there is not accurate. This issue is different than the cairo issue you referenced.

I debugged firefox, and noticed it make a call to cairo_path_extents to get the extent of covered region. Returned extent is false and I think that's the reason why firefox draws nothing.

The cairo issue is one we ran into in the past, but it is fixed.

What do you mean by "fixed" ? I tried with latest cairo trunk.

The one we're facing now is that css left and top positions have a limited coordinate range.

maximal coordinates are 17 895 697pixels in firefox. It is more than the 8 400 000 limit we hit in current bug.

  Changed 23 months ago by ahocevar

@arno: in Cairo, we used to have a value range of about 15000 for coordinates. And this is an issue we worked around in the old SVG renderer. This is the issue that is fixed now (sorry, I read your cairo bug report after my comment). Anyway, the failure to draw the line in the example was fixed by using lower CSS coordinate values - the only thing that changes in SVG in the viewBox, and the coordinates there are now larger than before. Also, I ran into the same CSS issue when I tried to create a grid layer with the coordinate origin of the map's maxExtent - without any SVG involved.

  Changed 23 months ago by ahocevar

@arno, thanks again for finding out about the cairo problem - after more investigation, I see that this is indeed what causes the issue. Let's hope that this will be fixed in cairo and gecko soon. But regardless, in OpenLayers, the fix proposed in openlayers-3359.patch Download is a reasonable one.

  Changed 23 months ago by bartvde

Reviewing this one now.

  Changed 23 months ago by bartvde

  • state changed from Review to Commit

Looks good to me, unit tests also pass in FF4. Please commit.

  Changed 23 months ago by ahocevar

  • status changed from new to closed
  • resolution set to fixed

(In [12163]) don't waste coordinate space by using a smaller renderer extent and updating it on moveend. r=bartvde (closes #3359)

  Changed 23 months ago by bartvde

Hey Andreas, if it was not clear, I would agree with including this in 2.11.

  Changed 23 months ago by ahocevar

  • status changed from closed to reopened
  • state changed from Commit to Pullup
  • version changed from 2.10 to 2.11 RC1
  • resolution fixed deleted

  Changed 22 months ago by ahocevar

  • status changed from reopened to closed
  • resolution set to fixed

in 2.11-rc2

Note: See TracTickets for help on using tickets.