Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Unified Diff: Source/core/dom/Document.cpp

Issue 141143007: Revert of Revert "Moved text decoding to the parser thread" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentEncodingData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 73f20e044eff49f9a207fc7fc9b2a43e45470128..86d8fbb723896ee7e4913703bde30a8e8528073a 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -109,7 +109,6 @@
#include "core/events/ScopedEventQueue.h"
#include "core/events/ThreadLocalEventNames.h"
#include "core/fetch/ResourceFetcher.h"
-#include "core/fetch/TextResourceDecoder.h"
#include "core/frame/ContentSecurityPolicy.h"
#include "core/frame/DOMWindow.h"
#include "core/frame/Frame.h"
@@ -140,6 +139,7 @@
#include "core/html/parser/HTMLDocumentParser.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/html/parser/NestingLevelIncrementer.h"
+#include "core/html/parser/TextResourceDecoder.h"
#include "core/inspector/InspectorCounters.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/ScriptCallStack.h"
@@ -1144,7 +1144,7 @@ void Document::setCharset(const String& charset)
if (!encoding.isValid())
return;
DocumentEncodingData newEncodingData = m_encodingData;
- newEncodingData.encoding = encoding;
+ newEncodingData.setEncoding(encoding);
setEncodingData(newEncodingData);
}
@@ -2146,15 +2146,6 @@ AXObjectCache* Document::axObjectCache() const
return topDocument->m_axObjectCache.get();
}
-void Document::setVisuallyOrdered()
-{
- m_visuallyOrdered = true;
- // FIXME: How is possible to not have a renderer here?
- if (renderView())
- renderView()->style()->setRTLOrdering(VisualOrder);
- setNeedsStyleRecalc();
-}
-
PassRefPtr<DocumentParser> Document::createParser()
{
if (isHTMLDocument()) {
@@ -4043,18 +4034,28 @@ void Document::setEncodingData(const DocumentEncodingData& newData)
// document's title so that the user doesn't see an incorrectly decoded title
// in the title bar.
if (m_titleElement
- && encoding() != newData.encoding
+ && encoding() != newData.encoding()
&& !m_titleElement->firstElementChild()
&& encoding() == Latin1Encoding()
&& m_titleElement->textContent().containsOnlyLatin1()) {
CString originalBytes = m_titleElement->textContent().latin1();
- OwnPtr<TextCodec> codec = newTextCodec(newData.encoding);
+ OwnPtr<TextCodec> codec = newTextCodec(newData.encoding());
String correctlyDecodedTitle = codec->decode(originalBytes.data(), originalBytes.length(), true);
m_titleElement->setTextContent(correctlyDecodedTitle);
}
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();
+ if (shouldUseVisualOrdering != m_visuallyOrdered) {
+ m_visuallyOrdered = shouldUseVisualOrdering;
+ // FIXME: How is possible to not have a renderer here?
+ if (renderView())
+ renderView()->style()->setRTLOrdering(m_visuallyOrdered ? VisualOrder : LogicalOrder);
+ setNeedsStyleRecalc();
+ }
}
KURL Document::completeURL(const String& url) const
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/DocumentEncodingData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698