WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
13240
World of Warcraft site fails because it expects an implicit <tbody> as the first child of a <table>
https://bugs.webkit.org/show_bug.cgi?id=13240
Summary
World of Warcraft site fails because it expects an implicit <tbody> as the fi...
Darin Adler
Reported
2007-03-30 22:52:07 PDT
I ran into a problem on a World of Warcraft page:
http://www.worldofwarcraft.com/info/basics/factions/hellfire/hellfire.xml
It turned out to be some code that assumes that a <table> gets a <tbody> automatically created. For this markup: <table><tr></tr></table> IE creates a <tbody> element in the DOM. Firefox does not do this. The page doesn't work with Firefox either. I'm not sure what we should do about this difference in behavior.
Attachments
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2007-03-30 22:54:03 PDT
Same thing with just a plain empty table: <table></table>. IE supplies a <tbody>.
Darin Adler
Comment 2
2007-03-30 23:21:19 PDT
Further, if there's whitespace at the start of the table, the <tbody> replaces it instead of being added after it. So the <tbody> is the first child of the table. That's what the code on the website depends on. It gets the table and then calls childNodes[0].appendChild to add a row to the table. This relies on the table body being node 0. But the markup has whitespace, something like this: <table> <tr></tr> </table> IE adds the <tbody> and seems to discard the whitespace! I'm not sure what we can do to be compatible with a site like this.
Darin Adler
Comment 3
2007-03-30 23:24:08 PDT
Strangely, there is code to create implicit tbody elements in the HTML parser that looks like dead code to me. For example, HTMLTableElement::addChild says "The creation of <tbody> elements relies on the 'childAllowed' check", which seems to imply that some types of children, perhaps <tr> elements for example, would return false from childAllowed and then trigger the code in HTMLParser::handleError. But there's no implementation of childAllowed that prevents such elements from getting added! So I think the HTML parser code is never reached. But even if that code to create implicit tbody elements runs, it doesn't put the body *before* the whitespace; so it doesn't make the World of Warcraft site work.
Darin Adler
Comment 4
2007-03-30 23:27:18 PDT
Somehow, this site works in Firefox even though my reductions of the problem don't!
Alexey Proskuryakov
Comment 5
2007-03-30 23:39:39 PDT
Using Hixie's live DOM viewer <
http://software.hixie.ch/utilities/js/live-dom-viewer/
>, I see TBODY being created in WebKit - the behavior seems to fully match Firefox.
Darin Adler
Comment 6
2007-03-31 00:03:35 PDT
OK, I guess I was reading the code wrong. The <tbody> does get created, but the site's code expects it to be the first child of the <table>, but instead we have whitespace as the first child. Why does this work in Firefox?
Darin Adler
Comment 7
2007-03-31 00:08:57 PDT
Works fine if we spoof as Firefox. So that explains why they're not failing the same way we are.
Robert Blaut
Comment 8
2008-02-09 14:21:35 PST
(In reply to
comment #7
)
> Works fine if we spoof as Firefox. So that explains why they're not failing the > same way we are. >
So it's Evangelism bug. I checked the site using
r30090
and the site looks good for me. Not broken layout so it should be considered ad FIXED
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug