Element.getSize() instead of Element.getComputedSize() in Mask.resize()#1274
Element.getSize() instead of Element.getComputedSize() in Mask.resize()#1274lorenzos wants to merge 5 commits intomootools:masterfrom
Conversation
Conflicts: Source/Drag/Drag.Move.js
|
There was a problem hiding this comment.
getComputedSize does a lot of things, but one of them is that it checks for when the style is auto. Here you'd get NaN when you call .toInt(), I believe, if that's what the style is set to. It also will do this addition for you, telling you what the total margin is on the sides and the top & bottom. Is there a reason you opted to not use it?
If the purpose is to handle the box model stuff, I think all you need to do is change what getComputedSize measures, as you can configure it to use only the element size, the element size + margins, + margins and padding, + margins, padding, and border, etc.
|
Any contribution here is always welcome, but before we pull this we'd need to test it. There aren't any specs for Regardless, I'll reiterate that the pull request is most welcome. It may take a short while for us to pull it without the tests so don't fret. |
|
Just saw your comment here: #1273 (comment) I understand your reasoning for using |
|
@anutron Yes, I wrote my motivations on #1273 :) Anyway I understand may be better to fix You decide whether to leave my issue and my PR opened, or close them and open a new issue about |
|
@lorenzos yep. I may not be the one to get to this (either helping with tests or working on element.measure); someone else may beat me to it (my week is rather busy). Will reiterate how much the pull request is appreciated! |
This fixes bad Mask resizing in case target element has a
box-sizingthat is notcontent-box. See #1273.PS: I don't know why Github is including old commits of mine in this PR, anyway they were already merged before 1.5.0 - and in fact they brings no diffs at all.