Skip to content

Commit 122b913

Browse files
committed
Dialog: Work around subpixel issues in dialog resizable test
Switching to checking the size of the content element. We should be checking the dimensions of the .ui-dialog element, but that currently fails in Chromium-based browsers. Once we start using box-sizing: border-box, we should try to revert this change. Ref #9845
1 parent e7c932e commit 122b913

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/unit/dialog/dialog_test_helpers.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,20 @@ TestHelpers.dialog = {
2424
actualDY = offsetAfter.top - offsetBefore.top;
2525
ok( expectedDX - actualDX <= 1 && expectedDY - actualDY <= 1, "dragged[" + expectedDX + ", " + expectedDY + "] " + msg);
2626
},
27+
// TODO switch back to checking the size of the .ui-dialog element (var d)
28+
// once we switch to using box-sizing: border-box (#9845) that should work fine
29+
// using the element's dimensions to avoid subpixel errors
2730
shouldResize: function(element, dw, dh, msg) {
2831
var heightAfter, widthAfter, actual, expected,
2932
d = element.dialog("widget"),
3033
handle = $(".ui-resizable-se", d),
31-
heightBefore = d.height(),
32-
widthBefore = d.width();
34+
heightBefore = element.height(),
35+
widthBefore = element.width();
3336

3437
TestHelpers.dialog.drag(element, handle, 50, 50);
3538

36-
heightAfter = d.height();
37-
widthAfter = d.width();
39+
heightAfter = element.height();
40+
widthAfter = element.width();
3841

3942
msg = msg ? msg + "." : "";
4043
actual = { width: widthAfter, height: heightAfter },

0 commit comments

Comments
 (0)