Opened 6 years ago

Closed 6 years ago

#17064 closed defect (duplicate)

dom-geometry position works differently in Firefox and Chrome

Reported by: Radim Kolář Owned by:
Priority: undecided Milestone: tbd
Component: Core Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

<body>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js"></script>
<img src="images/novy-hlodac.png" id="hiddenlogo"/>
<script>
require(["dojo/fx", "dojo/dom", "dojo/dom-geometry", "dojo/dom-style", "dojo/domReady!"], function(fx, dom, geom, style) {
    // get target original location of flying logo
    var obrazek = geom.position(dom.byId("hiddenlogo"), true);
    var hlodacx = obrazek.x;
    var hlodacy = obrazek.y;
    alert(hlodacx+"/"+hlodacy);
</script>

#hiddenlogo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 200px;
  height: auto;
  visibility: hidden
}

In firefox 20, location displayed is about 496/8. image auto margins left and right are excluded, you will get exact location of image - this is what i want.

In chrome 26, location printed is 8/23, image is still centred correctly

Change History (2)

comment:1 Changed 6 years ago by Radim Kolář

close this as duplicate, i got server error on save.

comment:2 Changed 6 years ago by bill

Resolution: duplicate
Status: newclosed

Duplicate of #17063.

Note: See TracTickets for help on using tickets.