Reviewed by Darin Adler.
[WebKit-https.git] / WebCore / khtml / khtml_part.cpp
index f64787300313960ec619f3922c91b48c7670e11d..160a0869a4bddd2af5d5ff26d85183758127924f 100644 (file)
@@ -7,6 +7,7 @@
  *                     2000 Stefan Schimanski <1Stein@gmx.de>
  *                     2001 George Staikos <staikos@kde.org>
  * Copyright (C) 2004 Apple Computer, Inc.
+ * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -944,12 +945,9 @@ void KHTMLPart::write( const char *str, int len )
         if (!d->m_encoding.isNull())
             d->m_decoder->setEncoding(d->m_encoding.latin1(),
                 d->m_haveEncoding ? Decoder::UserChosenEncoding : Decoder::EncodingFromHTTPHeader);
-        else {
-            // Inherit the default encoding from the parent frame if there is one.
-            const char *defaultEncoding = (parentPart() && parentPart()->d->m_decoder)
-                ? parentPart()->d->m_decoder->encoding() : settings()->encoding().latin1();
-            d->m_decoder->setEncoding(defaultEncoding, Decoder::DefaultEncoding);
-        }
+        else
+            d->m_decoder->setEncoding(settings()->encoding().latin1(), Decoder::DefaultEncoding);
+
         if (d->m_doc)
             d->m_doc->setDecoder(d->m_decoder.get());
     }