Closed
Bug 46918
Opened 24 years ago
Closed 23 years ago
[INLINE-H] line-breaking bug caused by +ve margin-right on inline elements [LINE] {ll}
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
VERIFIED
FIXED
mozilla0.9.9
People
(Reporter: ian, Assigned: waterson)
References
()
Details
(Keywords: css1, regression, testcase, Whiteboard: [Hixie-P2] (high profile: css1 test suite) fix in hand, awaiting review)
Attachments
(4 files, 2 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
rbs
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
The margin-right property is affecting line wrapping of inline elements on all
lines, instead of only the last one.
For instance,
span { margin-right: 10em; }
<span> some long text that will span many lines </span>
...will have 10em of right margin on every line, not just after the
word "lines".
TO REPRODUCE:
View attached testcase.
EXPECTED RESULTS:
The top section should lay out identically to the bottom section.
ACTUAL RESULTS:
margin-right is affecting every line of the SPAN.
TESTED ON:
Windows 2000 commercial build 6.0.17.2000072811.
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
Nominating for nsbeta3. This is a bad CSS1 correctness issue. It is also a
regression and is a bug tested on a high profile test suite: the WSP's top 10
for MacIE.
QA Contact: petersen → py8ieh=bugzilla
Whiteboard: hit during nsbeta2 standards compliance testing
Comment 3•24 years ago
|
||
Am going to start with Marc's team for this one.
Assignee: clayton → attinasi
Comment 4•24 years ago
|
||
CC'ing waterson to see if his recent line work caused this regression? Chris,
any chance?
Reporter | ||
Comment 6•24 years ago
|
||
See also related bug 3490, which shows very odd results with negative right
margins on inline elements.
Chris, if you are not too doomed and can take that bug (bug 3490) I'm sure
buster would be very thankful. ;-)
Summary: line breaking bug caused by margin-right on inline elements [LINE] → [INLINE-H] line-breaking bug caused by +ve margin-right on inline elements [LINE] {ll}
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•24 years ago
|
||
Going to mark as [nsbeta3-], but I'll probably be looking at this while
staggering through 3940. There seem to be several problems with margins and
borders on inline elements.
Whiteboard: hit during nsbeta2 standards compliance testing → [nsbeta3-]
Target Milestone: --- → Future
Updated•24 years ago
|
Whiteboard: [nsbeta3-] → [nsbeta3-]hit during nsbeta2 standards compliance testing
Comment 8•24 years ago
|
||
Marking rtm-.
Whiteboard: [nsbeta3-]hit during nsbeta2 standards compliance testing → [nsbeta3-][rtm-] hit during nsbeta2 standards compliance testing
Reporter | ||
Updated•24 years ago
|
Keywords: mozilla1.0
Reporter | ||
Updated•24 years ago
|
Whiteboard: [nsbeta3-][rtm-] hit during nsbeta2 standards compliance testing → [Hixie-P2] (high profile: css1 test suite)
Comment 9•23 years ago
|
||
any progress with this bug?
Assignee | ||
Updated•23 years ago
|
Target Milestone: Future → mozilla0.9.9
Assignee | ||
Comment 10•23 years ago
|
||
This test case illustrates that the problem exists with margin-left, alone.
Assignee | ||
Comment 11•23 years ago
|
||
This fixes margin-left, but not margin-right (that's going to be trickier,
because we may or may not wrap the line depending on whether or not the right
margin is applied).
The fix is to zero the left margin _before_ adjusting the available width.
Also, I'm really stumped as to why nsLineLayout::ApplyLeftMargin was trying to
determine if the frame was floated. Inline frames that are floated get area
frames created for them (see
nsCSSFrameConstructor::ConstructFrameByDisplayType), so this code would never
be reached. So I removed it. (I suppose I could add an NS_NOTREACHED if people
don't trust me!)
Assignee | ||
Updated•23 years ago
|
OS: Windows 2000 → All
Hardware: PC → All
Comment 12•23 years ago
|
||
Comment on attachment 66576 [details] [diff] [review]
fix for margin-left
r=dbaron
Attachment #66576 -
Flags: review+
Comment 13•23 years ago
|
||
... although I think it would be a good idea to add an assertion about floating,
with a comment that there used to be code to handle it. (Remember when I tried
to remove the code that handled incremental reflow during printing? :-)
Assignee | ||
Comment 14•23 years ago
|
||
This test case checks the starting margin for an inline frame: margin-left for
left-to-right text; margin-right for right-to-left text.
Assignee | ||
Comment 15•23 years ago
|
||
The above patch supersedes attachment 66576 [details] [diff] [review]: it attempts to handle
right-to-left text, as well. The only part of the patch that I'm not sure about
is the detection of a right-to-left text frame; specifically, I doubt that I'm
correctly taking embedding levels into account (since I don't really understand
them).
nsLineLayout::CanPlaceFrame had the same vestigial floater detection code,
which I've changed to an assertion.
Attachment #66576 -
Attachment is obsolete: true
Assignee | ||
Comment 16•23 years ago
|
||
Actually, attachment 66878 [details] [diff] [review] should be a complete fix for this bug and bug 3490,
modulo a minor glitch that this patch fixes. (And the question of whether or
not I'm detecting the directionality correctly.)
Attachment #66878 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Keywords: review
Whiteboard: [Hixie-P2] (high profile: css1 test suite) → [Hixie-P2] (high profile: css1 test suite) fix in hand, awaiting review
Comment 17•23 years ago
|
||
You shouldn't need to take embedding levels into account for this, only the
paragraph direction, so the direction tests look OK to me.
Does the patch have any impact on bug 121633?
Assignee | ||
Comment 18•23 years ago
|
||
I banged around on bug 121633 for a while: it may be necessary to fix this bug
for 121633 to work, but it is not sufficient.
Assignee | ||
Comment 19•23 years ago
|
||
Layout regression tests pass with no bbox errors.
Comment 20•23 years ago
|
||
Comment on attachment 66882 [details] [diff] [review]
fix
looks good
r=rbs
Attachment #66882 -
Flags: review+
Comment 21•23 years ago
|
||
Comment on attachment 66882 [details] [diff] [review]
fix
sr=kin@netscape.com
Should we change "left" and "right" in the following comment to "start" and
"end"?
+ // Adjust available width to account for the left margin. The
+ // right margin will be accounted for when we finish flowing the
+ // frame.
Attachment #66882 -
Flags: superreview+
Assignee | ||
Comment 22•23 years ago
|
||
Right. Thanks!
Assignee | ||
Comment 23•23 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•