OpenLayers OpenLayers

Ticket #1477 (closed bug: fixed)

Opened 5 months ago

Last modified 5 months ago

VML renderer draws features in the upperleft corner of the map pane

Reported by: openlayers Assigned to: pgiraud
Priority: major Milestone: 2.6 Release
Component: Renderer.VML Version: 2.6 RC1
Keywords: Cc:
State: Complete

Description

In some cases (don't know exactly when) features are drawn to upper left corner of the map, using IE browser. This did not happen with 2.5 version and is now happening with the SVN head version. If I replace SVN head Elements.js and VML.js with same files from version 2.5 the bug does not exist. This bug happens only with IE, no problems with Firefox or Safari. This bug is somewhat similar to the bug #1360...

Attachments

preventVMLToUpperLeftCornerBug.patch (1.2 kB) - added by openlayers on 04/02/08 03:59:57.
Shows how I can prevent the bug
preventVMLToUpperLeftCornerBug_updated.patch (0.7 kB) - added by openlayers on 04/02/08 05:14:48.
Updated version of the way to prevent bug
1477-r6762-A0.patch (2.6 kB) - added by ahocevar on 04/02/08 07:44:07.

Change History

04/01/08 07:49:44 changed by crschmidt

  • milestone set to 2.6 Release.

More information, like an example of how to reproduce, is neccesary to take any action on this...

04/01/08 10:24:12 changed by openlayers

  • type changed from feature to bug.

04/02/08 03:59:57 changed by openlayers

  • attachment preventVMLToUpperLeftCornerBug.patch added.

Shows how I can prevent the bug

04/02/08 04:06:11 changed by openlayers

I added a patch to show how I can prevent the bug to happen. It's not really a fix because I don't know the VML implementation. I hope this helps figuring the bug out. I tried to create example file of how to produce this bug, but I failed. If I figure it out later I'll post it here. I'm using IE 7.05730.11.

04/02/08 04:07:27 changed by pgiraud

I'm not convinced by this patch since it reverses a previous change. See http://trac.openlayers.org/ticket/965

We won't be able to decide if this ticket is valid if you don't provide an example to reproduce.

04/02/08 05:14:48 changed by openlayers

  • attachment preventVMLToUpperLeftCornerBug_updated.patch added.

Updated version of the way to prevent bug

04/02/08 05:19:16 changed by openlayers

I added a new patch, the first one had too much changes. "if (!document.namespaces.v)" fails in my code for some reason. The document.namespaces.v object already exists when this is first time called.

04/02/08 05:28:35 changed by openlayers

Maybe some other library that I'm using is already adding that same namespace. Then the style("position: relative; display: inline-block;") is never added and that's why the features are on the upperleft corner of the map. Is this something OpenLayers should handle or what should be done to fix this? For example Dojo seems to add the same namespace. From Dojo code: document.namespaces.add("v","urn:schemas-microsoft-com:vml"); document.createStyleSheet().addRule("v\\:*", "behavior:url(#default#VML)");

04/02/08 07:01:57 changed by crschmidt

Ah, now *that* is a decent bug report. (Though of course, an example still would have been better, since I still can't tell when I fix it.)

So, The problem is that we use "Does the VML namespace exist?" as our test case for "Should we do some funky stuff relating to setting up OpenLayers + VML?"

However, other things can set the VML namespace -- dojo, as was pointed out,but you can even set it manually on the page (look at just about any Google Maps example). With that in mind, the thing to do here is probably to:

  • Reproduce it
  • Pull the "set position:relative" block out of that if

However, there is a problem here: It seems to me that we are breaking other existing VML, no? If someone else has VML rendered on their page, we're going to be applying rules to it?

So I think that means that we want to add this stylesheet rule *only* to the stuff we care about -- setting the rule on '.olMapViewport v:*' instead? perhaps we shouldn't even go that far, and just create a new rule for each VML renderer root -- otherwise, maps with multiple layers end up with duplicate stylesheet rules (Though I don't really see how that harms us, to be honest).

Because this is a regression (#1141), we're going to need a new RC. (Which means we need to go fix the popup issue too. Sigh.)

Pierre, for the record, you addressed this in your initial ticket as a question: "Though, I don't really know what happens if user already set a vml namespace in the HTML document but with no proper or wrong style sheet rules."

Now we know :)

Essentially, the patch here reverts the change in #1141. Since that code was *working*, it might be worth it to just go back to it, and re-address #1141 *not* during an RC cycle. I'm somewhat fearful of making a significant change to VML during an RC, simply because we know that IE is more poorly tested in general, and I don't want to miss something important at this point.

But I'll leave that call up tosomeone else.

04/02/08 07:09:04 changed by pgiraud

  • owner set to pgiraud.

04/02/08 07:09:28 changed by pgiraud

  • component changed from general to Renderer.VML.

04/02/08 07:44:07 changed by ahocevar

  • attachment 1477-r6762-A0.patch added.

04/02/08 07:45:19 changed by ahocevar

May I propose that we just use a more unique namespace prefix for our vml? "olv:" instead of just "v:" should do. 1477-r6762-A0.patch works and passes tests in IE6.

04/02/08 08:47:47 changed by ahocevar

  • state set to Awaiting User Feedback.

04/02/08 08:51:19 changed by pgiraud

I'm totally in favour of Adreas' proposal, and I can confirm that it still works for current examples. We are still awaiting for feedbacks from this ticket's reporter.

04/02/08 09:00:23 changed by crschmidt

  • state changed from Awaiting User Feedback to Commit.

Nice. Namespacing for the win!

Pierre: I think we can commit this without further feedback from the user, since it is clear that this is the issue. If it doesn't solve the problem, I'm sure the user will come back to let us know :)

Andreas: Please commit, and include "(Pullup #1477)" in your commit message.

Thanks!

04/02/08 09:03:24 changed by ahocevar

  • keywords set to pullup.
  • state changed from Commit to Pullup.

(In [6764]) changed vml namespace prefix from "v" to "olv" to avoid conflicts with other libraries that use vml. r=pgiraud,crschmidt. (Pullup #1477)

04/02/08 13:07:02 changed by openlayers

That solves the problem. Features works fine now. As far as I can see this issue is now fixed. Thank you.

04/07/08 21:51:04 changed by crschmidt

  • keywords deleted.
  • status changed from new to closed.
  • state changed from Pullup to Complete.
  • resolution set to fixed.

(In [6819]) Pullup commits from trunk to 2.6 branch:

  • virtualStyle typo (Closes #1495)
  • JSON fix for Safari 3.1 (Closes #1493)
  • panzoombar off-by-one (Closes #1486)
  • Handler Hover exception (Closes #1480)
  • Popup.framedcloud exception (Closes #1479)
  • VML Renderer when including namespace in page (Closes #1477)
  • SLD/Rule/Filter changes -- most of this commit (Closes #1492)