Bug 35207 - all xhtml documents fail to render when XHTMLMP enabled
Summary: all xhtml documents fail to render when XHTMLMP enabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Critical
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-20 23:16 PST by Charles Wei
Modified: 2010-03-10 13:52 PST (History)
2 users (show)

See Also:


Attachments
fix patch (2.83 KB, patch)
2010-02-21 00:01 PST, Charles Wei
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Wei 2010-02-20 23:16:11 PST
For webkit portings which use XMLTokenizerLibxml2,  When XHTMLMP is enabled, all the XHTML documents fail to render, including all the test cases in LayoutTests/dom/xhtml.
Comment 1 Charles Wei 2010-02-21 00:01:23 PST
Created attachment 49145 [details]
fix patch

When the XHTMLMP is enabled, the author added one member function to class Document to decide if the document is of XHTMLMP type, and they later on in the tokenizer, it validates if the right Doctype is declared for xhtml-mp document.

The right MIME type for XHTMLMP is "application/vnd.wap.xhtml+xml",  while in the new member function isXHTMLMPDocument() of Document,  it returns true for both "application/vnd.wap.xhtml+xml" and "application/xhtml+xml".  In the Tokenizer, it trys to validate that the XHTMLDocument contains the right DTD declaration and public ID ("//WAPFORUM/DTD XHTML Mobile 1.0"),  sure it fails for all the XHTML (non-MP) documents.

Ths fix for this bug is only documents with MIME type "application/wap.vnd.xhtml+xml" will be treated as XHTMLMP documents;   MIME type "application/xhtml+xml" is for XHTML documents.
Comment 2 George Staikos 2010-02-21 07:00:38 PST
Comment on attachment 49145 [details]
fix patch

Why does this touch WML?
Comment 3 Eric Seidel (no email) 2010-02-22 14:28:30 PST
Comment on attachment 49145 [details]
fix patch

Like george, I don't understand why this channges WML.  Not that the change is wrong, it just needs more explanation.

It looks like this was always backwards:
	#if !ENABLE(XHTMLMP)
1256	        || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.0//EN")
1257	#endif
?

Or if that should be enabled for all ports, just remove the #if.
Comment 4 Charles Wei 2010-02-22 23:51:34 PST
Thanks, George,  and Eric, for the review. 

The change for WML is a clean-up of the code.   That piece of code is actually identical for both XHTMLMP, WML and XHTML,  I just cleaned it up by removing the XHTMLMP and WML to remove the redundent code. 


1255    #if !ENABLE(XHTMLMP)
1256            || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.0//EN")
1257    #endif

should only be enabled for XHTMLMP,  while the original code makes it avaiable only if XHTMLMP is disabled,  that is wrong .


I hope this makes it clear and you will re-consider and take the patch . If you have other comments, I would be glad to work on that.
Comment 5 Laszlo Gombos 2010-02-24 19:14:59 PST
It looks to me  that this impacts not only XMLTokenizerLibxml2 but also XMLTokenizerQt.cpp. 

Charles, would you consider making the same changes for the Qt port as well together with this patch ?
Comment 6 WebKit Commit Bot 2010-03-10 13:52:22 PST
Comment on attachment 49145 [details]
fix patch

Clearing flags on attachment: 49145

Committed r55802: <http://trac.webkit.org/changeset/55802>
Comment 7 WebKit Commit Bot 2010-03-10 13:52:26 PST
All reviewed patches have been landed.  Closing bug.