[M120 Migration][TCT] Fix viewport user-scalable web-tct issue(behavior test) 56/306656/3
authorManjeet <manjeet.1@partner.samsung.com>
Sat, 24 Feb 2024 20:45:22 +0000 (02:15 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 29 Feb 2024 12:16:34 +0000 (12:16 +0000)
Value changing of |user-scalable| property of view point meta tag is not applied
instantly. Due to this, zooming gesture is not working even if |user-scalable|
is changed to |true|. To apply this change instantly, changed to make layout
after updating |user-scalable| property.

Reference:
https://review.tizen.org/gerrit/288621

Change-Id: Id9ac0b4180cdea4ba9668fd9abb414cb3964d2d4
Signed-off-by: Manjeet <manjeet.1@partner.samsung.com>
third_party/blink/renderer/core/exported/web_view_impl.cc

index 43095f2..e50ecae 100644 (file)
@@ -2998,6 +2998,14 @@ void WebViewImpl::UpdatePageDefinedViewportConstraints(
 
   float old_initial_scale =
       GetPageScaleConstraintsSet().PageDefinedConstraints().initial_scale;
+
+#if BUILDFLAG(IS_TIZEN)
+  float old_min_scale =
+      GetPageScaleConstraintsSet().PageDefinedConstraints().minimum_scale;
+  float old_max_scale =
+      GetPageScaleConstraintsSet().PageDefinedConstraints().maximum_scale;
+#endif
+
   GetPageScaleConstraintsSet().UpdatePageDefinedConstraints(description,
                                                             default_min_width);
 
@@ -3021,11 +3029,26 @@ void WebViewImpl::UpdatePageDefinedViewportConstraints(
       SettingsImpl()->ViewportMetaNonUserScalableQuirk());
   float new_initial_scale =
       GetPageScaleConstraintsSet().PageDefinedConstraints().initial_scale;
+#if BUILDFLAG(IS_TIZEN)
+  float new_min_scale =
+      GetPageScaleConstraintsSet().PageDefinedConstraints().minimum_scale;
+  float new_max_scale =
+      GetPageScaleConstraintsSet().PageDefinedConstraints().maximum_scale;
+#endif
+
   if (old_initial_scale != new_initial_scale && new_initial_scale != -1) {
     GetPageScaleConstraintsSet().SetNeedsReset(true);
     if (MainFrameImpl() && MainFrameImpl()->GetFrameView())
       MainFrameImpl()->GetFrameView()->SetNeedsLayout();
   }
+#if BUILDFLAG(IS_TIZEN)
+  else if (old_min_scale != -1 &&
+           (old_min_scale != new_min_scale || old_max_scale != new_max_scale)) {
+    if (MainFrameImpl() && MainFrameImpl()->GetFrameView()) {
+      MainFrameImpl()->GetFrameView()->SetNeedsLayout();
+    }
+  }
+#endif
 
   if (does_composite_) {
     MainFrameImpl()->FrameWidgetImpl()->UpdateViewportDescription(description);