Closed Bug 270599 Opened 20 years ago Closed 20 years ago

Problem using selectors for tables with custom tags ancestors

Categories

(Core :: DOM: HTML Parser, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 193784

People

(Reporter: flg, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.5) Gecko/20041108 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.5) Gecko/20041108 Firefox/1.0

Dunno if there is some obscure reason for this to be a standard behavior but I
can't use the descendant selector on a tr tag with a custom ancestor, as in :

  my_custom_tag tr { color: red; }

though it works with a standard tag like div, as in :

  div tr { color: red; }

Reproducible: Always
Steps to Reproduce:
The selector works, but the <my_custom_tag> is closed when the <table> tag
starts. You can easily check that for yourself using the dom inspector. 
I think that is intended behavior.
Yes, I've observed that in the DOM inspector yet I have no clue about why the 
tag is automatically closed before the closing tag itself... Could you please 
point me to the standard/reco that leads to that behavior? Thanks in advance!
Well, that's the problem. If I would know of such a thing, I would have closed
the bug and marked it INVALID, but I haven't found any. 
I only found this (but that doesn't mention this topic):
http://www.w3.org/TR/html401/appendix/notes.html#h-B.1
So it may be that browsers may decide themselves what they should do in this case.
HTML Parser, not CSS, and probably invalid.
Assignee: dbaron → parser
Component: Style System (CSS) → HTML: Parser
QA Contact: ian → mrbkap
I understand.

However it feels really weird to me that a tag enclosing another tag should not
be translated to a parent->child relationship within the DOM.
I could perhaps conceive that in HTML but what about the DOM in this document :
 
http://www.taovillage.fr/playground/automatic_closing_of_custom_tag_before_table.html

Shouldn't the enclosing tag, even if it's unknown, and as far as it *is* present
in the DOM tree, be treated as an XML element?
Component: HTML: Parser → Style System (CSS)
QA Contact: mrbkap → ian
Component: Style System (CSS) → HTML: Parser
QA Contact: ian → mrbkap
You can workaround this problem by using XHTML.

*** This bug has been marked as a duplicate of 193784 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.