Opened 10 years ago

Closed 9 years ago

#11073 closed defect (fixed)

dojox.html.metrics generates huge scroller if text in metrics calc box is long

Reported by: Jared Jurkiewicz Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.5
Component: Dojox Version: 1.5.0b1
Keywords: Cc: Eugene Lazutkin
Blocked By: Blocking:

Description (last modified by Jared Jurkiewicz)

This is because it has to be in the page to calc size, but by being in the page can affect width of the body. Simple 'fix' is to contain it withing a fixed width/height div.

Incoming testcase as well as patch.

Attachments (2)

test_TextBox.html (1.2 KB) - added by Jared Jurkiewicz 10 years ago.
Test demonstrating the issue
metrics.patch (1.4 KB) - added by Jared Jurkiewicz 10 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by Jared Jurkiewicz

Description: modified (diff)
Summary: dojox.html.metrics generates huge scroller if test in metrics calc box is longdojox.html.metrics generates huge scroller if text in metrics calc box is long

Changed 10 years ago by Jared Jurkiewicz

Attachment: test_TextBox.html added

Test demonstrating the issue

Changed 10 years ago by Jared Jurkiewicz

Attachment: metrics.patch added

comment:2 Changed 10 years ago by Eugene Lazutkin

Cc: Eugene Lazutkin added
Owner: changed from uhop to Jared Jurkiewicz

comment:3 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [22022]) Fixing issue with getTextBox causing scrollbar to appear on body. fixes #11073

comment:4 in reply to:  3 Changed 9 years ago by Eugene Lazutkin

Resolution: fixed
Status: closedreopened

Replying to jaredj:

(In [22022]) Fixing issue with getTextBox causing scrollbar to appear on body. fixes #11073

This change doesn't work for me --- w is always 1. Specifically the line 104 could be wrong --- are you sure that

box.w = m.parentNode.scrollWidth;

is correct?

Why not:

box.w = m.scrollWidth;

The former is always 1 for me (using Chrome) and the latter looks like a real value.

comment:5 Changed 9 years ago by Eugene Lazutkin

(In [22881]) dojox.html: added a missing test for getTextBox(), !strict, refs #11073.

comment:6 Changed 9 years ago by Eugene Lazutkin

I couldn't reproduce the problem at home with any browser. I'll try it again tomorrow at work --- it might be CSS-specific, or just plain old bug in a browser.

In any case I added a missing test case for getTextBox() in [22881].

comment:7 Changed 9 years ago by Jared Jurkiewicz

The test is working for me in chrome. I only vaguely remember why I looked at the parent node. Had to do with checking how wide the scroll area of the container wrapping the text was.

comment:8 Changed 9 years ago by Eugene Lazutkin

Resolution: fixed
Status: reopenedclosed

The reason was a tricky CSS class (in the Grid component), which sets height: 0. Apparently it was enough to interpret that the text is never shown.

Note: See TracTickets for help on using tickets.