xml3d / xml3d.js

The WebGL/JS implementation of XML3D
Other
75 stars 25 forks source link

xml3dElement.width and .height are incorrect #160

Closed csvurt closed 8 years ago

csvurt commented 8 years ago

The width and height reported by the accessors on the xml3d element are only correct if the dimensions were set using an attribute, not CSS. eg:

<xml3d width="1280" height="720"></xml3d>
document.querySelector("xml3d").width --> 1280

<xml3d style="width: 1280px; height: 720px"></xml3d>
document.querySelector("xml3d").width --> 800
csvurt commented 8 years ago

Should mention this mimics the behavior of the DOM interface for the <canvas> element so maybe we want to keep it this way, but it's fairly confusing if you ask me. We should mention this behavior in the spec in any case.