Closed
Bug 368155
Opened 18 years ago
Closed 17 years ago
text-indent needs to contribute to intrinsic width (e.g., of floats)
Categories
(Core :: Layout: Floats, defect, P1)
Core
Layout: Floats
Tracking
()
VERIFIED
FIXED
mozilla1.9alpha6
People
(Reporter: RyanVM, Assigned: dbaron)
References
Details
(Keywords: regression, testcase)
Attachments
(3 files, 4 obsolete files)
489 bytes,
text/html
|
Details | |
2.65 KB,
patch
|
RyanVM
:
review+
RyanVM
:
superreview+
|
Details | Diff | Splinter Review |
28.02 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
See the attached testcase. This is a reflow branch regression.
Reporter | ||
Comment 1•18 years ago
|
||
Reduced testcase
Reporter | ||
Updated•18 years ago
|
Flags: in-testsuite?
Comment 2•18 years ago
|
||
Hmm. So I figure we should add the text-indent to the first line for both min and pref width if it's a coord (and treat percentages as 0). That said, if text-indent is negative (especially if it plus the pref width of the text is negative), what should happen?
Flags: blocking1.9?
Assignee | ||
Comment 3•18 years ago
|
||
Negative is fine, except that we need to fix InlineMinWidthData::Break to no-op if the current line so far is negative. Min and pref width should be (and are already, I think) a max over a list of line min/pref widths and zero, so that they don't go below zero.
Assignee | ||
Comment 4•18 years ago
|
||
(In reply to comment #3) > Negative is fine, except that we need to fix InlineMinWidthData::Break to no-op > if the current line so far is negative. ... for optional breaks, but not forced ones.
Comment 5•18 years ago
|
||
Hmm... Why should Break() no-op in this case?
Assignee | ||
Comment 6•18 years ago
|
||
Because the negative indents absorb the ability of what follows them to widen the container. (Likewise for negative margins.) Nothing would ever need to break until it's at least into positive width.
Comment 7•18 years ago
|
||
Ah, ok. Fair enough. So we need to pass a boolean to Break() indicating whether it's forced or not, eh?
Reporter | ||
Comment 8•17 years ago
|
||
This is what I get for hanging out in #developers too much.
Reporter | ||
Updated•17 years ago
|
Attachment #255750 -
Attachment mime type: application/octet-stream → text/plain
Reporter | ||
Updated•17 years ago
|
Attachment #255750 -
Flags: superreview?(dbaron)
Attachment #255750 -
Flags: review?(dbaron)
Assignee | ||
Comment 9•17 years ago
|
||
Comment on attachment 255750 [details]
Reftests for once this bug gets fixed
These tests look fine, except they'd need a "fails" at the beginning of the line in the manifest if they're checked in before the bug is fixed.
Attachment #255750 -
Flags: superreview?(dbaron)
Attachment #255750 -
Flags: superreview+
Attachment #255750 -
Flags: review?(dbaron)
Attachment #255750 -
Flags: review+
Assignee | ||
Updated•17 years ago
|
Assignee: nobody → dbaron
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Summary: Div width incorrectly calculated when float and indent are defined → text-indent needs to contribute to intrinsic width (e.g., of floats)
Target Milestone: --- → mozilla1.9alpha3
Assignee | ||
Comment 10•17 years ago
|
||
Oops, and, as jwalden pointed out, if they're XHTML they should have .xhtml filenames.
Reporter | ||
Comment 11•17 years ago
|
||
Sorry about that, forgot that the files should have .xhtml extensions
Attachment #255750 -
Attachment is obsolete: true
Attachment #255751 -
Flags: review?
Reporter | ||
Comment 12•17 years ago
|
||
Comment on attachment 255751 [details] [diff] [review] Fixing minor filename issue Carrying over dbaron's previous r/sr+
Attachment #255751 -
Flags: superreview+
Attachment #255751 -
Flags: review?
Attachment #255751 -
Flags: review+
Assignee | ||
Comment 13•17 years ago
|
||
But if we did the fancy break stuff, we'd need to go to even more trouble to get the spaces to contribute to min width. So I think it's not worth the bother.
Assignee | ||
Comment 14•17 years ago
|
||
But it is worth the bother to make sure negative text-indent can't cause min width to be greater than pref width.
Flags: blocking1.9? → blocking1.9+
Assignee | ||
Updated•17 years ago
|
Target Milestone: mozilla1.9alpha3 → mozilla1.9alpha6
Assignee | ||
Comment 15•17 years ago
|
||
This fixes the bug, and fixes the accumulation issues for negative indents and margins, but I haven't written testcases for any of the negative stuff yet.
Assignee | ||
Comment 16•17 years ago
|
||
Writing the tests caught a bug in the patch: In min-width calculation I need to force the first thing on the line to fit, since there is no break-opportunity after the text-indent.
Assignee | ||
Comment 17•17 years ago
|
||
The nsIFrame.h changes explain the basic idea of what's going on here. roc, see my XXX comment in nsTextFrameThebes as well...
Attachment #268703 -
Flags: superreview?(roc)
Attachment #268703 -
Flags: review?(roc)
Reporter | ||
Updated•17 years ago
|
Attachment #255751 -
Attachment is patch: true
Assignee | ||
Updated•17 years ago
|
Attachment #267648 -
Attachment is obsolete: true
> // XXXldb Where is the equivalent code in GetInlineMinWidth?
here:
if (i < flowEndInTextRun && !mTextRun->CanBreakLineBefore(i)) {
PRBool preformattedNewline = !collapseWhitespace &&
frag->CharAt(iter.ConvertSkippedToOriginal(i)) == '\n';
if (!preformattedNewline) {
// we can't break here
continue;
}
}
the code after this block handles both optional and forced line-breaks. You probably need to set a flag in here (maybe just move preformattedNewline out) to indicate whether the break is forced or not.
Assignee | ||
Comment 19•17 years ago
|
||
Still an XXX comment, but nsTextFrameThebes passes my tests now...
Attachment #268703 -
Attachment is obsolete: true
Attachment #269018 -
Flags: superreview?(roc)
Attachment #269018 -
Flags: review?(roc)
Attachment #268703 -
Flags: superreview?(roc)
Attachment #268703 -
Flags: review?(roc)
+ frag->CharAt(iter.ConvertSkippedToOriginal(start) == '\n')) { I don't think the parentheses are in the right place.... + PRBool preformattedNewline; You probably want to initialize this to prevent warnings. + // XXXldb Shouldn't we be including the newline as part of the + // segment that it ends rather than part of the segment that it + // starts (and avoid the extra chunk above)? Probably the best way would be to just have i start at "start".
Assignee | ||
Comment 21•17 years ago
|
||
Attachment #269237 -
Flags: superreview?(roc)
Attachment #269237 -
Flags: review?(roc)
Assignee | ||
Updated•17 years ago
|
Attachment #269018 -
Attachment is obsolete: true
Attachment #269018 -
Flags: superreview?(roc)
Attachment #269018 -
Flags: review?(roc)
Comment on attachment 269237 [details] [diff] [review] patch + PRBool preformattedNewline; I still think you should initialize this to avoid warnings. + // XXXldb Shouldn't we be including the newline as part of the + // segment that it ends rather than part of the segment that it + // starts (and avoid the extra chunk above)? You want to change this comment now that there is no extra chunk above...
Attachment #269237 -
Flags: superreview?(roc)
Attachment #269237 -
Flags: superreview+
Attachment #269237 -
Flags: review?(roc)
Attachment #269237 -
Flags: review+
Assignee | ||
Comment 23•17 years ago
|
||
Checked in to trunk, with those comments addressed. Also checked in Ryan's reftest -- thanks for the test.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 24•17 years ago
|
||
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/layout/reftests/bugs&command=DIFF_FRAMESET&file=reftest.list&rev1=1.93&rev2=1.94&root=/cvsroot http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/layout/reftests/text-indent&command=DIFF_FRAMESET&file=reftest.list&rev1=1.1&rev2=1.2&root=/cvsroot
Flags: in-testsuite? → in-testsuite+
Comment 25•16 years ago
|
||
v.fixed Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008050704 Minefield/3.0pre
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•