Closed Bug 803211 Opened 13 years ago Closed 13 years ago

Max line box width API should not limit line boxes based on absolute position

Categories

(Core :: Layout, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: jwir3, Assigned: jwir3)

Details

Attachments

(1 file, 1 obsolete file)

Right now, the following code exists in the API for changing the max line box width: > if (maxLineBoxWidth > 0 && psd->mRightEdge > maxLineBoxWidth) { > psd->mRightEdge = maxLineBoxWidth; > } This effectively limits a max line boxes' width based on an absolute position, which is causing reflow-on-zoom to be overly conservative when limiting line box widths. Instead, it should take into account the WIDTH of the line box, not the position of the right edge.
Attached file b803211 (obsolete) —
Attachment #672899 - Flags: review?(dbaron)
Comment on attachment 672899 [details] b803211 Going to add a test, so will repost shortly.
Attachment #672899 - Flags: review?(dbaron)
Attached patch b803211Splinter Review
Now with a mochitest!
Attachment #672899 - Attachment is obsolete: true
Attachment #673415 - Flags: review?(dbaron)
Comment on attachment 673415 [details] [diff] [review] b803211 r=dbaron, though I think the test is a bit confusing with part of it in functions and part of it not in functions (especially given the order in which the functions and the other tests live within the file). Maybe it can be organized a bit more clearly? Oh, and I now realize RTL is even worse than I thought: * it's not clear to me that positioning things at the left edge is the right thing for RTL * RTL + text-indent is also different from what I originally thought; given that this code adjusts mRightEdge just like text-indent, we end up erasing the text indent (rather than indenting out the other end, as I was originally worried) I think you should probably get a bug filed for improving RTL behavior here.
Attachment #673415 - Flags: review?(dbaron) → review+
[oops, I thought I'd submitted this comment before the last one!] (In reply to Scott Johnson (:jwir3) from comment #0) > This effectively limits a max line boxes' width based on an absolute > position, which is causing reflow-on-zoom to be overly conservative when This had me confused for a bit, because I thought you were using "absolute position" in the sene of CSS absolute positioning. But now I realize that I think you just meant it as the English term. So this change looks reasonable, except after poking around nsLineLayout a bit to look into what mLeftEdge and mRightEdge are, I realize that this is still broken in the presence of mTextIndent when direction is RTL (since we handle text-indent asymmetrically).
(In reply to David Baron [:dbaron] from comment #4) > Comment on attachment 673415 [details] [diff] [review] > b803211 > > r=dbaron, though I think the test is a bit confusing with part of it in > functions and part of it not in functions (especially given the order in > which the functions and the other tests live within the file). Maybe it can > be organized a bit more clearly? I re-organized the test so that everything is in functions now. There are four functions: setupFirstTest(), setupSecondTest(), performFirstTest(), and performSecondTest(). > I think you should probably get a bug filed for improving RTL behavior here. Filed bug 804640 for this.
Note that this landed with the wrong bug number in the commit message... https://hg.mozilla.org/mozilla-central/rev/fd1b86ceab1a
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: