Ticket #2465 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

vector features aren't rendered in IE

Reported by: tschaub Owned by: ahocevar
Priority: minor Milestone: 2.9 Release
Component: Renderer.VML Version: 2.8
Keywords: Cc:
State: Complete

Description

To see the problem in action:

  • Open the spherical-mercator.html example in IE6.
  • Draw a polygon (see blue sketch with draw with temporary intent)
  • Finish drawing a feature and see it disappear.

Attachments

openlayers-2465.patch Download (5.3 KB) - added by ahocevar 3 years ago.
2465.patch Download (9.8 KB) - added by tschaub 3 years ago.
vml fixes
2465.2.patch Download (9.8 KB) - added by ahocevar 3 years ago.
fixed a typo (should read + "px" instead of | "px")
openlayers-1465-reopened.patch Download (0.6 KB) - added by ahocevar 3 years ago.
fillColor likes to be set before visibility
2465_test.patch Download (1.8 KB) - added by bartvde 3 years ago.
update the IE test as Tim suggested

Change History

  Changed 3 years ago by ahocevar

Same in IE7 and IE8.

Changed 3 years ago by ahocevar

  Changed 3 years ago by ahocevar

  • owner set to ahocevar
  • state set to Review
  • component changed from Renderer to Renderer.VML

The attached patch fixes the reported issue, and brings a couple of other improvements:

  • Aet style.visibility to "visible" in postDraw(). This fixes the reported issue.
  • Always start with an initial origin of (0,0) and use offset. This reduces the chance that we run out of significant digits for large coordinate figures and fixes the  snap-split.html example.
  • Use toFixed() everywhere (and not just in some places, as it was before) for values that we use as coordinates. This just makes things more consistent.

Tests needed some modifications because we now need to mock up an offset, which was set in initialize() before, but is set in setExtent() now, which we don't call for the draw* tests.

Tests pass and both the spherical-mercator and the snap-split examples work in IE7 and IE8. Please review.

follow-up: ↓ 4   Changed 3 years ago by tschaub

Nice work figuring this out.

One minor comment from the optimization department: for truncating positive numbers to integers, (num | 0) runs a good bit faster than (num.toFixed()) (5x faster on FF, 3x faster on IE8, 2x faster on IE6).

in reply to: ↑ 3   Changed 3 years ago by tschaub

Replying to tschaub:

Nice work figuring this out. One minor comment from the optimization department: for truncating positive numbers to integers, (num | 0) runs a good bit faster than (num.toFixed()) (5x faster on FF, 3x faster on IE8, 2x faster on IE6).

Meant "truncating numbers" instead of "truncating positive numbers".

  Changed 3 years ago by tschaub

I also notice  one place where node.style.top and node.style.left are set without appending "px".

I'm pretty sure this isn't intentional. If not, it seems like the fix fits with the others above.

Changed 3 years ago by tschaub

vml fixes

  Changed 3 years ago by tschaub

Above patch includes the changes mentioned (using bitwise truncation and appending "px" to style). Examples are looking good. Will verify tests pass shortly.

  Changed 3 years ago by ahocevar

Thanks tschaub for the bitwise truncation hint. And the missing "px" was indeed unintentional, and fits in well.

  Changed 3 years ago by tschaub

  • state changed from Review to Commit

All looks good. I verified that tests pass and examples work in IE6 and IE8.

Thanks for tracking down the issues. These are some nice fixes. Please commit.

Changed 3 years ago by ahocevar

fixed a typo (should read + "px" instead of | "px")

  Changed 3 years ago by ahocevar

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10039]) Fix initial offset and visibility issues in VML renderer; also make sure that all floats are converted to integers (previously using toFixed(), now using (num | 0)). p=tschaub,me, r=tschaub,me (closes #2465)

Changed 3 years ago by ahocevar

fillColor likes to be set before visibility

  Changed 3 years ago by ahocevar

  • status changed from closed to reopened
  • state changed from Complete to Review
  • resolution fixed deleted
  • summary changed from vector features aren't rendered in IE6 to vector features aren't rendered in IE

[10039] introduced a regression (see http://openlayers.org/pipermail/users/2010-February/016141.html), which is fixed by the above patch.

Examples mentioned in this thread still work, tests still pass. Please review.

  Changed 3 years ago by crschmidt

  • state changed from Review to Commit

Looks good, tests pass, please commit.

  Changed 3 years ago by ahocevar

  • status changed from reopened to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10049]) fixed regression with broken polygon fills. r=crschmidt (closes #2465)

  Changed 3 years ago by bartvde

  • status changed from closed to reopened
  • resolution fixed deleted

I've got a good suspicion that this ticket caused the !Layer.Vector tests to fail in IE (I've tested with version 6), see also: ticket:2538

Tim, Andreas, are you able to look into this?

  Changed 3 years ago by bartvde

Ok, this fixes is partly, however one value is now -16px instead of -17px but this could be becausing of rounding issues.

Index: tests/Layer/Vector.html
===================================================================
--- tests/Layer/Vector.html     (revision 10119)
+++ tests/Layer/Vector.html     (working copy)
@@ -542,6 +542,7 @@
                         "graphicYOffset correctly set");
         }
         if (layer.renderer.CLASS_NAME == 'OpenLayers.Renderer.VML') {
+                layer.renderer.offset = {x: 0, y: 0};
                 feature.style = customStyle1;
                 layer.drawFeature(feature);
                 t.eq(root.firstChild.style.width,

  Changed 3 years ago by bartvde

  • state changed from Complete to Needs Discussion

  Changed 3 years ago by bartvde

  • state changed from Needs Discussion to Review

  Changed 3 years ago by tschaub

  • state Review deleted

I don't see a patch to review here.

  Changed 3 years ago by tschaub

For clarification, the Layer/Vector.html test passes at r10038 and not at r10039 in IE.

  Changed 3 years ago by tschaub

My interpretation is that graphicXOffset and graphicYOffset are working in IE and that the tests are not good. I think a clearer test of symbolizer offsets would be to draw a graphic with zero offset, retrieve the position, draw the graphic with some known offset, and confirm that the difference in position is consistent with the provided offsets.

  Changed 3 years ago by bartvde

I'll try and write a new test like Tim suggests tomorrow morning.

Changed 3 years ago by bartvde

update the IE test as Tim suggested

  Changed 3 years ago by bartvde

  • state set to Review

I've updated the test, the test now passes in IE6. Please review.

  Changed 3 years ago by elemoine

  • state changed from Review to Commit

Looks good. Confirming that Layer.html now passes in IE8.

  Changed 3 years ago by bartvde

  • status changed from reopened to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10141]) fix up Layer.Vector tests in IE which were broken as of r10039, r=elemoine (closes #2465)

Note: See TracTickets for help on using tickets.