Problem with SPAN background when paragraphs are inside it.

RESOLVED FIXED

Status

()

Core
HTML: Parser
--
minor
RESOLVED FIXED
12 years ago
8 years ago

People

(Reporter: Manix Rock, Unassigned)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed by the HTML5 parser])

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

In the following code the letters A and C have a blue background, while the B letter has a white background, tough they should all have a blue background:

<span style="background: #AADDFF; color: red;">A<p><br></p>B<p><br></p>C</span>

I realize it's not a conventional use of the tags, but it's the best way I have found to force IE to display contigious BR tags inside a IFRAME (a more complicated setup, long story :P), and now have run into this problem here.
P.S.: I couldn't find a better place to post it then in General, but it might be better to have special(DOM?) section for these kind of bugs.

Reproducible: Always

Steps to Reproduce:
1. copy the code in the Details section in a new .html file
2. open it in a firefox window
3. look at it
Actual Results:  
The background is white for the "B" letter.

Expected Results:  
The background should be blue for all three letters.
(Reporter)

Updated

12 years ago
Keywords: css1, dom2
Summary: Problem with SPAN background when a combination of #TEXT, P and BR elements is used. → Problem with SPAN background when paragraphs are inside it.
Version: unspecified → 2.0 Branch
(Reporter)

Comment 1

12 years ago
A clearer cause of the problem might be this section:

<span style="background: #AADDFF; color: red;">A<p>m</p>B<p>n</p>C<p>p</p>D</span>

I see the A and D have a blue background, while all the other letters have a white background.
Created attachment 253194 [details]
testcase from comment 0 & 1

Updated

12 years ago
Keywords: testcase
Component: General → Layout
Keywords: css1, dom2
Product: Firefox → Core
QA Contact: general → layout
Version: 2.0 Branch → 1.8 Branch

Comment 3

10 years ago
You're right, p inside span is higly invalid.

However, we're using quirks mode here and that should more or less resemble what authors intended (or rather, what IE and the others do).
Status: UNCONFIRMED → NEW
Component: Layout → HTML: Parser
Ever confirmed: true
OS: Windows XP → All
QA Contact: layout → parser
Hardware: x86 → All
Whiteboard: DUPEME?
Version: 1.8 Branch → Trunk
The remaining part of comment 1 is not a parser bug, and I'm pretty sure it isn't a spec violation in layout, either.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Whiteboard: DUPEME? → [fixed by the HTML5 parser]
You need to log in before you can comment on or make changes to this bug.