Opened 10 years ago
Last modified 6 years ago
#15104 assigned enhancement
auto-detect border-box box model
Reported by: | eschiebel | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.15 |
Component: | HTML | Version: | 1.7.2 |
Keywords: | Cc: | ben hockey | |
Blocked By: | Blocking: |
Description
setMarginBox has incorrect results on an element with box-sizing: border-box,
in firefox 10, shrinks the box by the size of padding + border in chrome 19, it also moves the box.
open the attached file in a browser and call box("a") through box("c") in the console.
Attachments (1)
Change History (9)
Changed 10 years ago by
comment:1 Changed 10 years ago by
Cc: | ben hockey added |
---|
comment:2 Changed 10 years ago by
Component: | General → HTML |
---|---|
Owner: | set to Eugene Lazutkin |
comment:4 Changed 9 years ago by
Summary: | setMarginBox incorrect with box-sizing:border-box → auto-detect border-box box model |
---|---|
Type: | defect → enhancement |
With the current code, if you have box-model box sizing for the page you need to manually tell dom-geometry that you are using it, via something like:
require("dojo/dom-geometry").boxModel = "border-box";
Putting the above line in themeTester.html seems to work.
The alternatives would be:
- Test <body> or some other node on page startup to see its box model. In user code this is done like:
if(domStyle.get(document.body, "boxSizing") == "border-box" || domStyle.get(document.body, "MozBoxSizing") == "border-box"){ domGeom.boxModel = "border-box"; }
- automatically detect the sizing for each node, on every call to setMarginBox() etc. Not sure of the performance implications though; it might cause too much of a performance degradation.
Changing this ticket to an enhancement about those two options.
comment:7 Changed 7 years ago by
Milestone: | tbd → 1.12 |
---|---|
Owner: | changed from Eugene Lazutkin to bill |
Status: | new → assigned |
Bill is this still an issue? If so, is it worth fixing, or close as patchwelcome?
comment:8 Changed 6 years ago by
Milestone: | 1.13 → 1.15 |
---|
Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.
test page