Document with illegal element renders CSS style associated with it

NEW
Unassigned

Status

()

Core
Layout
P3
normal
17 years ago
9 years ago

People

(Reporter: Christine Hoffman, Unassigned)

Tracking

({testcase})

Trunk
Future
x86
Windows 2000
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [bae:20011211])

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
Tested on 11_16_05_trunk build. Open the attached file. The testcase has a 4.01
Transitional doctype with a url which renders the document in Standards mode.
The body of the document contains an illegal element 'foo'. The 'foo' element is
given a lime background-color style. The page renders with a lime background. I
have also tested this with using a 4.0 Transitional doctype and a 4.01 Strict
doctype to see the results in both 'Standard' and 'Quirks' modes. I am not sure
what the implementation should be in 'Quirks' mode, but 'Standards' mode should
not recognize an illegal element, regardless of whether it has style or not. I
discussed this with Marc Attinasi and he indicated that there was a bug that
dealt with this issue but I was unable to find it. If this is a duplicate,
please mark it so.
(Reporter)

Comment 1

17 years ago
Created attachment 58651 [details]
Testcase to demonstrate problem
(Reporter)

Comment 2

17 years ago
After thinking about it, why should we recognize illegal elements in 'quirks' OR
'standards' modes?

Comment 3

17 years ago
Quite right - neither IE not Nav 4.7x appear to honor the illegal tags
(according to the testcase anyway). 
Let's not jump all over this yet; someone could declare <!DOCTYPE HTML ...
[!ELEMENT ... ]> and add their own elements to a document, and it would
validate.  If we had a validating parser, maybe we could conclusively tell
whether or not an element was illegal and tell that to the style system, but
that's in the future.
Keywords: testcase
*** Bug 22260 has been marked as a duplicate of this bug. ***

Comment 6

17 years ago
Discarding tags ( whether legal or illegal ) in the parser would result in an
incorrect content model. IMO this should be handled in the layout.

--> layout
Assignee: harishd → attinasi
Component: Parser → Layout
QA Contact: moied → petersen
The content model should indeed contain the invalid content, and the content
model could really quickly tell layout if we need to apply style to an invalid
element or not (invalid elements are implemented with their own C++ class), but
there's currently no good API for finding out if the element was a valid HTML
element or not, let me know if you need such an API.
Futuring; we really should wait on this until we can validate.
Summary: Document with illegal element renders CSS style assosciated with it → Document with illegal element renders CSS style associated with it
Target Milestone: --- → Future

Comment 9

17 years ago
adding the additional element decalration is not the issue here, teh issue is 
validating the document against the referenced DTD. Per the HTML spec, unknown 
elements should be ignored, but the content should be displayed. From what I 
understand out of the comments in this bug, our problem is that we are not 
validating against the DTD. Is that a correct understanding?
Priority: -- → P3
Whiteboard: [bae:20011211]
that's correct, yes.
Note that in IE the "foo" DOM node _is_ present.

Can IE style that node?

That is, is the only issue that IE doesn't apply inline style to user-defined
elements?

AS for validating, I doubt it's going to happen for the HTML parser.

Comment 12

13 years ago
IE does not style custom elements.

I think this should be WONTFIX. I like it that it is possible to style custom
elements in text/html and it does not harm anyone either.
Assignee: attinasi → nobody
QA Contact: chrispetersen → layout
You need to log in before you can comment on or make changes to this bug.