Commit 5c611c4d authored by darin's avatar darin

Reviewed by Maciej.

	- fixed 3147036 -- words separated only by newlines are getting rammed together on XML page
	- fixed 3147032 -- preformatted text is missing much whitespace on XML page

        * khtml/xml/xml_tokenizer.cpp: (XMLHandler::characters): Don't try to strip whitespace at all,
	because it needs to be in the DOM.

	- add support for more MIME types

        * khtml/khtml_part.cpp: (KHTMLPart::begin): Add "application/xml" and "application/xhtml+xml".


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 69012bc6
2003-01-14 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3147036 -- words separated only by newlines are getting rammed together on XML page
- fixed 3147032 -- preformatted text is missing much whitespace on XML page
* khtml/xml/xml_tokenizer.cpp: (XMLHandler::characters): Don't try to strip whitespace at all,
because it needs to be in the DOM.
- add support for more MIME types
* khtml/khtml_part.cpp: (KHTMLPart::begin): Add "application/xml" and "application/xhtml+xml".
2003-01-14 David Hyatt <hyatt@apple.com>
Make FOUC work with XML.
......
2003-01-14 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3147036 -- words separated only by newlines are getting rammed together on XML page
- fixed 3147032 -- preformatted text is missing much whitespace on XML page
* khtml/xml/xml_tokenizer.cpp: (XMLHandler::characters): Don't try to strip whitespace at all,
because it needs to be in the DOM.
- add support for more MIME types
* khtml/khtml_part.cpp: (KHTMLPart::begin): Add "application/xml" and "application/xhtml+xml".
2003-01-14 David Hyatt <hyatt@apple.com>
Make FOUC work with XML.
......
......@@ -1366,7 +1366,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
#endif
// ### not sure if XHTML documents served as text/xml should use DocumentImpl or HTMLDocumentImpl
if (args.serviceType == "text/xml")
if (args.serviceType == "text/xml" || args.serviceType == "application/xml" || args.serviceType == "application/xhtml+xml")
d->m_doc = DOMImplementationImpl::instance()->createDocument( d->m_view );
else
d->m_doc = DOMImplementationImpl::instance()->createHTMLDocument( d->m_view );
......
......@@ -151,29 +151,14 @@ bool XMLHandler::endCDATA()
bool XMLHandler::characters( const QString& ch )
{
if (ch.stripWhiteSpace().isEmpty())
return true;
if (m_currentNode->nodeType() == Node::TEXT_NODE ||
m_currentNode->nodeType() == Node::CDATA_SECTION_NODE ||
enterText()) {
unsigned short parentId = m_currentNode->parentNode() ? m_currentNode->parentNode()->id() : 0;
if (parentId == ID_SCRIPT || parentId == ID_STYLE || parentId == ID_XMP || parentId == ID_TEXTAREA) {
// ### hack.. preserve whitespace for script, style, xmp and textarea... is this the correct
// way of doing this?
int exceptioncode = 0;
static_cast<TextImpl*>(m_currentNode)->appendData(ch,exceptioncode);
if (exceptioncode)
return false;
}
else {
// for all others, simplify the whitespace
int exceptioncode = 0;
static_cast<TextImpl*>(m_currentNode)->appendData(ch.simplifyWhiteSpace(),exceptioncode);
if (exceptioncode)
return false;
}
int exceptioncode = 0;
static_cast<TextImpl*>(m_currentNode)->appendData(ch,exceptioncode);
if (exceptioncode)
return false;
return true;
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment