#if BUILDFLAG(IS_EFL)
out->force_enable_zoom = data.force_enable_zoom();
out->link_effect_enabled = data.link_effect_enabled();
+ out->uses_encoding_detector = data.uses_encoding_detector();
+ out->atk_enabled = data.atk_enabled();
#endif
#if BUILDFLAG(IS_TIZEN)
out->max_refresh_rate = data.max_refresh_rate();
#endif
-#if BUILDFLAG(IS_EFL)
- out->atk_enabled = data.atk_enabled();
-#endif
#if BUILDFLAG(IS_ANDROID)
out->font_scale_factor = data.font_scale_factor();
out->device_scale_adjustment = data.device_scale_adjustment();
bool text_zoom_enabled = false;
bool selection_magnifier_enabled = false;
bool long_press_enabled = false;
+ bool uses_encoding_detector = true;
#endif
bool double_tap_to_zoom_enabled;
static bool force_enable_zoom(const blink::web_pref::WebPreferences& r) {
return r.force_enable_zoom;
}
+
+ static bool uses_encoding_detector(const blink::web_pref::WebPreferences& r) {
+ return r.uses_encoding_detector;
+ }
#endif
#if BUILDFLAG(IS_TIZEN)
[EnableIf=is_efl]
bool force_enable_zoom;
+ [EnableIf=is_efl]
+ bool uses_encoding_detector;
+
// Representation of the Web App Manifest scope if any.
url.mojom.Url web_app_scope;
#if BUILDFLAG(IS_EFL)
virtual void SetTizenVersion(unsigned, unsigned, unsigned) = 0;
virtual bool TizenCompatibilityModeEnabled() const = 0;
-#endif
-
-#if BUILDFLAG(IS_EFL)
virtual void SetLinkEffectEnabled(bool) = 0;
virtual bool LinkEffectEnabled() const = 0;
+ virtual void SetUsesEncodingDetector(bool) = 0;
+ virtual bool UsesEncodingDetector() const = 0;
#endif
#if defined(TIZEN_ATK_SUPPORT)
bool WebSettingsImpl::TizenCompatibilityModeEnabled() const {
return settings_->TizenCompatibilityModeEnabled();
}
+
+void WebSettingsImpl::SetUsesEncodingDetector(bool uses_encoding_detector) {
+ settings_->SetUsesEncodingDetector(uses_encoding_detector);
+}
+
+bool WebSettingsImpl::UsesEncodingDetector() const {
+ return settings_->GetUsesEncodingDetector();
+}
#endif
#if defined(TIZEN_ATK_SUPPORT)
void SetLinkEffectEnabled(bool) override;
bool LinkEffectEnabled() const override;
bool TizenCompatibilityModeEnabled() const override;
+ void SetUsesEncodingDetector(bool) override;
+ bool UsesEncodingDetector() const override;
#endif
#if defined(TIZEN_ATK_SUPPORT)
prefs.tizen_version_release);
web_view_impl->SetIgnoreViewportTagScaleLimits(prefs.force_enable_zoom);
settings->SetLoadWithOverviewMode(prefs.shrinks_viewport_contents_to_fit);
+ settings->SetUsesEncodingDetector(prefs.uses_encoding_detector);
#endif
#if BUILDFLAG(IS_TIZEN)
},
{
+ name: "usesEncodingDetector",
+ initial: false,
+ },
+
+ {
name: "presentationRequiresUserGesture",
initial: true,
},
TextResourceDecoderOptions::kJSONContent, default_encoding));
use_hint_encoding = false;
} else {
- WTF::TextEncoding hint_encoding;
- if (use_hint_encoding &&
- parent_frame->GetDocument()->EncodingWasDetectedHeuristically())
- hint_encoding = parent_frame->GetDocument()->Encoding();
- decoder = std::make_unique<TextResourceDecoder>(
- TextResourceDecoderOptions::CreateWithAutoDetection(
- DetermineContentType(mime_type), default_encoding, hint_encoding,
- url));
+#if BUILDFLAG(IS_EFL)
+ if (!encoding_from_domain.IsValid() &&
+ !frame->GetSettings()->GetUsesEncodingDetector()) {
+ decoder =
+ std::make_unique<TextResourceDecoder>(TextResourceDecoderOptions(
+ DetermineContentType(mime_type), default_encoding));
+ } else {
+#endif
+ WTF::TextEncoding hint_encoding;
+ if (use_hint_encoding &&
+ parent_frame->GetDocument()->EncodingWasDetectedHeuristically())
+ hint_encoding = parent_frame->GetDocument()->Encoding();
+ decoder = std::make_unique<TextResourceDecoder>(
+ TextResourceDecoderOptions::CreateWithAutoDetection(
+ DetermineContentType(mime_type), default_encoding, hint_encoding,
+ url));
+#if BUILDFLAG(IS_EFL)
+ }
+#endif
}
} else {
decoder = std::make_unique<TextResourceDecoder>(TextResourceDecoderOptions(
}
void Ewk_Settings::setDefaultTextEncoding(const char* encoding) {
+ m_preferences.uses_encoding_detector = !(encoding && *encoding);
if (encoding)
m_preferences.default_encoding = encoding;
}
auto& runtime = NativeWebRuntime::GetInstance();
prefs->default_encoding = runtime.GetEncodingType();
-#if !defined(WRT_JS_BRINGUP)
prefs->uses_encoding_detector = false;
+#if !defined(WRT_JS_BRINGUP)
if (IsWearableProfile() &&
WRTNativeWindow::GetWindowShape() == WRTNativeWindow::Shape::SQUARE) {
prefs->mirror_blur_enabled = true;