Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 770524fd52e9b5655e3be6c233914a6481137d15..e01a4a46f0749f5d103fbb777574384414e1f83e 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -1128,7 +1128,7 @@ String Document::defaultCharset() const |
| { |
| if (Settings* settings = this->settings()) |
| return settings->defaultTextEncodingName(); |
|
philipj_slow
2015/06/15 15:31:38
Is it possible that defaultTextEncodingName() is a
Habib Virji
2015/06/15 16:14:55
Yes it is null string, with your below code snippe
|
| - return String(); |
| + return String("UTF-8"); |
|
philipj_slow
2015/06/15 15:31:38
It seems a bit strange return "UTF-8" here if that
Habib Virji
2015/06/15 16:14:55
|document.implementation.createHTMLDocument('').de
philipj_slow
2015/06/16 22:05:57
This case is tricky, I'm unsure what to do. It's s
|
| } |
| void Document::setContentLanguage(const AtomicString& language) |
| @@ -4216,8 +4216,11 @@ void Document::setEncodingData(const DocumentEncodingData& newData) |
| String correctlyDecodedTitle = codec->decode(originalBytes.data(), originalBytes.length(), DataEOF); |
| m_titleElement->setTextContent(correctlyDecodedTitle); |
| } |
| - |
| - m_encodingData = newData; |
| + if (!newData.encoding().name()) { |
| + m_encodingData = DocumentEncodingData(); |
|
philipj_slow
2015/06/15 15:31:38
Is this code path reachable? Is there a test that
Habib Virji
2015/06/15 16:14:55
With the change in DocumentEncoderData it should n
philipj_slow
2015/06/16 22:05:57
OK, so would an ASSERT(newData.encoding().isValid(
|
| + } else { |
| + m_encodingData = newData; |
| + } |
| // FIXME: Should be removed as part of https://code.google.com/p/chromium/issues/detail?id=319643 |
| bool shouldUseVisualOrdering = m_encodingData.encoding().usesVisualOrdering(); |