Closed Bug 12233 Opened 25 years ago Closed 25 years ago

{css} background doesn't write over previous paragraph's text

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: dbaron, Assigned: buster)

Details

(Whiteboard: [TESTCASE])

Attachments

(1 file)

DESCRIPTION:  I *think* that, per CSS1/2, if elements overlap, the background of
the second should overwrite the text of the first.  I think you used to do that,
but then kipp "fixed" a bug dealing with
http://www.w3.org/Style/CSS/Test/current/sec42.htm and that messed things up...

STEPS TO REPRODUCE:  load attached testcase

ACTUAL RESULTS: you can see the text of the three paragraphs overlapping at
various points

EXPECTED RESULTS: The background of the second paragraph hides the text of the
first, and the background of the third hides the text of the second, so you
never see overlapping text.

DOES NOT WORK CORRECTLY ON:
 * Linux, apprunner, 1999-08-16-08-M9.
 * MSIE 4.0

UNSURE HOW IT WORKS ON:
 * should check IE5 - I haven't
 * NN 4.6 Linux - it seems to work on one and not the other.

ADDITIONAL INFORMATION:  I guess you should probably go with IE5 on this one if
CSS is unclear.  I'll have to look at CSS a bit more...
Whiteboard: [TESTCASE]
Assignee: troy → kipp
Assigning to Kipp since he understands the issues better than I do
OS: Linux → All
Hardware: PC → All
ALSO DOES NOT WORK CORRECTLY ON:
 * Windows, apprunner, 1999-08-24-09-M10

Marking All/All
Status: NEW → ASSIGNED
Summary: background doesn't write over previous paragraph's text → {css} background doesn't write over previous paragraph's text
Target Milestone: M12
Can you provide a spec quote to backup your position. The fix that I made
earlier made the layering of background, foreground and floaters work according
to the spec...And last I checked, the spec was silent about peer overlaps and
painting though one might infer that things that occur later in the content
should overwrite things that occur earlier.
From CSS2:
# 9.9 Layered presentation
#
# In the following sections, the expression "in front of" means closer to the
# user as the user faces the screen.
#
# In CSS2, each box has a position in three dimensions. In addition to their
# horizontal and vertical positions, boxes lie along a "z-axis" and are
# formatted one on top of the other. Z-axis positions are particularly
# relevant when boxes overlap visually. This section discusses how boxes may
# be positioned along the z-axis.
#
# Each box belongs to one stacking context. Each box in a given stacking
# context has an integer stack level, which is its position on the z-axis
# relative to other boxes in the same stacking context. Boxes with greater
# stack levels are always formatted in front of boxes with lower stack levels.
# Boxes may have negative stack levels. Boxes with the same stack level in a
# stacking context are stacked bottom-to-top according to document tree order.
#
# The root element creates a root stacking context, but other elements may
# establish local stacking contexts. Stacking contexts are inherited. A local
# stacking context is atomic; boxes in other stacking contexts may not come
# between any of its boxes.
Well that's a nice quote from the spec, but I don't see how it applies. We are
talking about two paragraphs in the same stacking context and therefore the
second paragraph will display over the first one. However, elsewhere in the spec
they say that content displays on top of floaters which display on top of
backgrounds so where's the bug?
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
The spec.

And if you'd like some other rules on the topic, read 17.5.1 (table layers).

Marking INVALID.
Just out of interest, where in the spec does it say that content is drawn over
floats which is drawn over backgrounds?
Buried in the middle of section 9.5 is a line that says:

A float can overlap other boxes in the normal flow (e.g., when a normal flow box
next to a float has negative margins). When an inline
box overlaps with a float, the content, background, and borders of the inline
box are rendered in front of the float. When a block box
overlaps, the background and borders of the block box are rendered behind the
float and are only be visible where the box is
transparent. The content of the block box is rendered in front of the float.
Status: RESOLVED → VERIFIED
Ok, I'm convinced. Thanks Kipp.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: