diff options
Diffstat (limited to 'WebKit/chromium/src/WebPageSerializerImpl.cpp')
| -rw-r--r-- | WebKit/chromium/src/WebPageSerializerImpl.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/WebKit/chromium/src/WebPageSerializerImpl.cpp b/WebKit/chromium/src/WebPageSerializerImpl.cpp index d5b2b7f..885ee25 100644 --- a/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -170,7 +170,7 @@ String WebPageSerializerImpl::preActionBeforeSerializeOpenTag( // Get encoding info. String xmlEncoding = param->doc->xmlEncoding(); if (xmlEncoding.isEmpty()) - xmlEncoding = param->doc->frame()->loader()->encoding(); + xmlEncoding = param->doc->frame()->loader()->writer()->encoding(); if (xmlEncoding.isEmpty()) xmlEncoding = UTF8Encoding().name(); result.append("<?xml version=\""); @@ -306,7 +306,7 @@ void WebPageSerializerImpl::openTagToString(const Element* element, if (needSkip) return; // Add open tag - result += "<" + element->nodeName(); + result += "<" + element->nodeName().lower(); // Go through all attributes and serialize them. const NamedNodeMap *attrMap = element->attributes(true); if (attrMap) { @@ -374,18 +374,17 @@ void WebPageSerializerImpl::endTagToString(const Element* element, // Write end tag when element has child/children. if (element->hasChildNodes() || param->hasAddedContentsBeforeEnd) { result += "</"; - result += element->nodeName(); + result += element->nodeName().lower(); result += ">"; } else { // Check whether we have to write end tag for empty element. if (param->isHTMLDocument) { result += ">"; - const HTMLElement* htmlElement = - static_cast<const HTMLElement*>(element); - if (htmlElement->endTagRequirement() == TagStatusRequired) { + // FIXME: This code is horribly wrong. WebPageSerializerImpl must die. + if (!static_cast<const HTMLElement*>(element)->ieForbidsInsertHTML()) { // We need to write end tag when it is required. result += "</"; - result += element->nodeName(); + result += element->nodeName().lower(); result += ">"; } } else { @@ -510,11 +509,11 @@ bool WebPageSerializerImpl::serialize() const KURL& currentFrameURL = currentFrame->frame()->loader()->url(); // Check whether we have done this document. - if (m_localLinks.contains(currentFrameURL.string())) { + if (currentFrameURL.isValid() && m_localLinks.contains(currentFrameURL.string())) { // A new document, we will serialize it. didSerialization = true; // Get target encoding for current document. - String encoding = currentFrame->frame()->loader()->encoding(); + String encoding = currentFrame->frame()->loader()->writer()->encoding(); // Create the text encoding object with target encoding. TextEncoding textEncoding(encoding); // Construct serialize parameter for late processing document. |
