Closed Bug 17644 Opened 25 years ago Closed 23 years ago

[INLINE-H] negative text-indent paragraphs starting with images

Categories

(Core :: Layout, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: Klaus.Malorny, Assigned: attinasi)

References

Details

(4 keywords, Whiteboard: [Hixie-P3] relnote-devel)

Attachments

(2 files)

I was trying to make a paragraph, which consists of a bullet (via an image),
followed by
multiple lines of text, like

  ____
 |____|Text line 1
       Text line 2
       ...

by using padding and negative text indent.

What happens is that "Text line 1" starts at the same position as the image and
overpaints the images

  ____
 |Text|line 1
       Text line 2
       ...

Interestingly this happens only if the padding/negative indent has exactly the
same width
as the image (testcase1), but not if the padding/negative indent is different.


Platform: Win NT 4.0
Mozilla Build: 1999101511, M10 and earlier

How to reproduce:

- create a GIF image, Size 30x10 (WxH) pixel, contents irrelevant
  (light color, eg. yellow) with the name "dummy.gif"
- display the following HTML page


<html>
<head>
<style>

.testcase1
{ padding-left: 30px;
  text-indent: -30px;
}

.testcase2
{ padding-left: 31px;
  text-indent: -31px;
}

</style>
</head>
<body>
<div>This is normal text</div>
<div class=testcase1><img src=dummy.gif width=30
  height=10 alt="dummy image">This is the test text.
This is the test text. This is the test text. This is the test text.
This is the test text. This is the test text. This is the test text.
This is the test text. This is the test text. This is the test text.
</div>
<div class=testcase2><img src=dummy.gif width=30
  height=10 alt="dummy image">This is the test text.
This is the test text. This is the test text. This is the test text.
This is the test text. This is the test text. This is the test text.
This is the test text. This is the test text. This is the test text.
</div>

</body>
</html>
Assignee: troy → kipp
Looks like one for you
Status: NEW → ASSIGNED
Target Milestone: M12
Updating to default Layout Assignee...kipp no longer with us :-(
Why are you re-reassing layout bugs? Do NOT touch layout bugs.

The bugs are assigned to Kipp so they can stay neatly organized until we have a
new owner for the block/inline code.
mass moving all Kipp's pre-beta bugs to M15.  Nisheeth and I will
prioritize these and selectively move high-priority bugs into M13 and M14.
Summary: negative text-indent paragraphs starting with images → [BLOCK] negative text-indent paragraphs starting with images
mine! mine mine mine!  all mine!  whoo-hoo!
Assignee: kipp → buster
moving all buster m15 bugs to m16.
Target Milestone: M15 → M16
Interesting problem, but not high enough priority to look at now.  Moving to 
M18.
Status: NEW → ASSIGNED
Target Milestone: M16 → M18
redistributing bugs across future milestones, sorry for the spam
Target Milestone: M18 → M19
My guess is that we are checking to see whether to apply the text-indent based 
on whether the current X coordinate is the beginning of the line (or something 
like that).  If so, it may not be hard to fix, assuming we can find the problem.
Keywords: css1
Summary: [BLOCK] negative text-indent paragraphs starting with images → [INLINE-H] negative text-indent paragraphs starting with images
correctness but edge case: per reporter, happens only if you use negative-text
indent *and* start with an image *and* the image width matches the indent.
Recommend that we FUTURE and relnote this if we run out of time.
Keywords: correctness
Denied for beta3: release notes would be appropriate.

This bug has been marked "future" because the original netscape engineer working 
on this is over-burdened. If you feel this is an error, that you or another 
known resource will be working on this bug, or if it blocks your work in some 
way -- please attach your concern to the bug for reconsideration.
Keywords: relnote3
Whiteboard: [nsbeta3-]
Target Milestone: M19 → Future
*** Bug 48353 has been marked as a duplicate of this bug. ***
For what it's worth, I discovered this bug independently in the course of real-world work, 

while trying to persuade a client to replace GIFtext headings with CSS-styled real headings. 

So it's not really an edge case cooked up to make a point. I made another test: 

<http://descend.metrius.com/~todd/bugs/hanging_deco.html>.



MacIE5 exhibits a different bug with the same test case, so, ironically, 2 of the best CSS-1 

implementations to date fail with a test that even NS4 and WinIE5 pass.
Keywords: relnote2, relnote3relnote
Whiteboard: [nsbeta3-] → [nsbeta3-] relnote-devel
Upon managerial request, adding the "testcase" keyword to 84 open layout bugs that
do not have the "testcase" keyword and yet have an attachement with the word
"test" in the description field. Apologies for any mistakes.
Keywords: testcase
Nom. nsbeta1. It won't be unusual to start paragraphs with images, and it will
confuse the heck out of the poor web developer when they stumble on this because
the interaction of the indent width and the image width is hard to figure out.
(They'll wonder why negative text indent "almost always" works right ...)
Keywords: nsbeta1
Whiteboard: [nsbeta3-] relnote-devel → [Hixie-P3] relnote-devel
*** Bug 87633 has been marked as a duplicate of this bug. ***
*** Bug 66678 has been marked as a duplicate of this bug. ***
Changin OS to all based on dupes.
OS: Windows NT → All
Build reassigning Buster's bugs to Marc.
Assignee: buster → attinasi
Status: ASSIGNED → NEW
Blocks: 104166
Blocks: 87724
Comment on attachment 59991 [details] [diff] [review]
suggested patch

r=dbaron, although as I suggested (somewhat indirectly) in bug 108187, I think
checking current position rather than remembering what has been done is
fundamentally broken.  However, really fixing that would require some pretty
big changes to the code so this looks fine for now.
Attachment #59991 - Flags: review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: