Polish code for r189579.
[WebKit-https.git] / Source / WebCore / dom / Document.h
index 88d3466e67aeef6696327952cc2c59869ad64cd7..74ceaa96bc92f47817cebb5f3cf9390a19a77d69 100644 (file)
@@ -47,6 +47,7 @@
 #include "ScriptExecutionContext.h"
 #include "StringWithDirection.h"
 #include "StyleResolveTree.h"
 #include "ScriptExecutionContext.h"
 #include "StringWithDirection.h"
 #include "StyleResolveTree.h"
+#include "TextResourceDecoder.h"
 #include "Timer.h"
 #include "TreeScope.h"
 #include "UserActionElementSet.h"
 #include "Timer.h"
 #include "TreeScope.h"
 #include "UserActionElementSet.h"
@@ -401,9 +402,10 @@ public:
     String defaultCharset() const;
 
     String charset() const { return Document::encoding(); }
     String defaultCharset() const;
 
     String charset() const { return Document::encoding(); }
-    String characterSetForBindings() const;
+    String characterSetWithUTF8Fallback() const;
+    TextEncoding textEncoding() const;
 
 
-    AtomicString encoding() const;
+    AtomicString encoding() const { return textEncoding().domName(); }
 
     void setCharset(const String&);
 
 
     void setCharset(const String&);
 
@@ -1750,6 +1752,13 @@ inline void Document::notifyRemovePendingSheetIfNeeded()
         didRemoveAllPendingStylesheet();
 }
 
         didRemoveAllPendingStylesheet();
 }
 
+inline TextEncoding Document::textEncoding() const
+{
+    if (auto* decoder = this->decoder())
+        return decoder->encoding();
+    return TextEncoding();
+}
+
 #if ENABLE(TEMPLATE_ELEMENT)
 inline const Document* Document::templateDocument() const
 {
 #if ENABLE(TEMPLATE_ELEMENT)
 inline const Document* Document::templateDocument() const
 {