Closed Bug 261792 Opened 20 years ago Closed 20 years ago

Text elements don't seem to inherit body styles if there is significant white space at the top of the page.

Categories

(Core :: DOM: HTML Parser, defect)

1.7 Branch
x86
Windows XP
defect
Not set
trivial

Tracking

()

VERIFIED DUPLICATE of bug 178088

People

(Reporter: danielb, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040803 Firefox/0.9.3

Page declared as: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

We had several hundred lines of whitespace generated at the top of our pages
before any HTML output.

A body style was declared in our style sheet.

Elements embedded in tables did not follow this style.

Removing the whitespace caused the elements embedded in tables to use this style.

Reproducible: Always
Steps to Reproduce:
1. Create an HTML page with a few hundred lines of whitespace at the top
2. Create a style sheet with just a body declaration
3. Create HTML and link to the style sheet after the whitespace mentioned above
4. Embed some text inside a table in the body of your page
5. View the page

Actual Results:  
Text embedded in the table did not inherit the body style

Expected Results:  
Text embedded in the table should inherit the body style since no other
overriding style was declared

Removing the white space fixes the issue.
This would be a general problem -> browser.

Can we see a testcase for this?
Component: General → Browser-General
Product: Firefox → Browser
Version: unspecified → Trunk
This would be, I bet, because the parser doesn't find the DOCTYPE (I forget how
far into the file it checks to find it, but it will stop at some point I
believe), it assumes there is no DOCTYPE and puts the page in 'quirks mode'. 
The symptoms being described here sound like a quirks mode document.

Check View -> Page Info on the General tab and see what the Render Mode reads
when the whitespace is present.
Assignee: firefox → parser
Component: Browser-General → HTML: Parser
QA Contact: firefox.general
See links below - one has 1000 lines of whitespace the other has none, that is
the only difference.

http://dev4.clientsaccess.com/whitespace.cfm
http://dev4.clientsaccess.com/nowhitespace.cfm

Interestingly, it only ignores the font size and font weight styles.
Well, they both render the same for me using the 20040927 trunk build.

Presumably this is a branch-only issue.
Version: Trunk → 1.7 Branch
Here's how the whitespace renders for me on Firefox.
This is bug 178088, essentially.  Fixed in newer FF releases than the one this
bug is written on.

*** This bug has been marked as a duplicate of 178088 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Daniel, could you test with Firefox 1.0PR? That version seems to have the
problem fixed. If it does, we can verify that this bug is a duplicate.
Just updated to 1.0PR and the problem is indeed fixed.

Sorry for the false alarm.
VERIFIED DUPLICATE of bug 178088: Mozilla jumping between standards compliance
and quirks mode on same page (which should have a better title, like "DOCTYPE
sniffing can be fooled by lots of initial whitespace").
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: