[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 19/36: Bug 1786521 - Fix AppearanceValueAffectsFrames. r=TYLin, a=RyanVM



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to annotated tag FIREFOX_102_4_0esr_BUILD1
in repository tor-browser.

commit 3e6532cd0aac527f6dd03661b50c8c011ffcd37b
Author: Emilio Cobos Álvarez <emilio@xxxxxxxxx>
AuthorDate: Mon Sep 12 17:30:16 2022 +0000

    Bug 1786521 - Fix AppearanceValueAffectsFrames. r=TYLin, a=RyanVM
    
    We had zero tests for this, and when I implemented the optimization to
    avoid reframing in most cases I apparently swapped the arguments ;_;
    
    Fix <input type=search> which suffered from the same issue, but we don't
    ship by default.
    
    Differential Revision: https://phabricator.services.mozilla.com/D155394
---
 .../forms/input/number/appearance-textfield-dynamic.html |  7 +++++++
 .../forms/input/number/appearance-textfield.html         |  2 ++
 layout/reftests/forms/input/number/reftest.list          |  3 +++
 layout/reftests/forms/input/number/text.html             |  2 ++
 .../forms/input/search/appearance-textfield-dynamic.html |  7 +++++++
 .../forms/input/search/appearance-textfield.html         |  2 ++
 layout/reftests/forms/input/search/reftest.list          |  3 +++
 layout/reftests/forms/input/search/text.html             |  2 ++
 layout/style/nsStyleStruct.cpp                           | 16 ++++++++--------
 9 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/layout/reftests/forms/input/number/appearance-textfield-dynamic.html b/layout/reftests/forms/input/number/appearance-textfield-dynamic.html
new file mode 100644
index 000000000000..813add54e428
--- /dev/null
+++ b/layout/reftests/forms/input/number/appearance-textfield-dynamic.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<input type=number>
+<script>
+  let input = document.querySelector("input");
+  input.getBoundingClientRect();
+  input.style.appearance = "textfield";
+</script>
diff --git a/layout/reftests/forms/input/number/appearance-textfield.html b/layout/reftests/forms/input/number/appearance-textfield.html
new file mode 100644
index 000000000000..8ab3fdc67fe1
--- /dev/null
+++ b/layout/reftests/forms/input/number/appearance-textfield.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<input type=number style="appearance: textfield">
diff --git a/layout/reftests/forms/input/number/reftest.list b/layout/reftests/forms/input/number/reftest.list
index c5b6f139ad39..30e4dcc7585b 100644
--- a/layout/reftests/forms/input/number/reftest.list
+++ b/layout/reftests/forms/input/number/reftest.list
@@ -62,6 +62,9 @@ fuzzy(0-128,0-4) == number-reframe-anon-text-field.html number-reframe-anon-text
 != padding-001.html padding-001-notref.html
 == padding-002.html padding-002-ref.html
 
+== appearance-textfield.html text.html
+== appearance-textfield-dynamic.html appearance-textfield.html
+
 fuzzy-if(winWidget&&!nativeThemePref,0-35,0-17) fuzzy-if(!nativeThemePref,0-14,0-4) == clipped-text.html clipped-text-ref.html
 
 fails-if(useDrawSnapshot) needs-focus != caret-right.html caret-right-notref.html
diff --git a/layout/reftests/forms/input/number/text.html b/layout/reftests/forms/input/number/text.html
new file mode 100644
index 000000000000..a46c54a7b7b5
--- /dev/null
+++ b/layout/reftests/forms/input/number/text.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<input type=text>
diff --git a/layout/reftests/forms/input/search/appearance-textfield-dynamic.html b/layout/reftests/forms/input/search/appearance-textfield-dynamic.html
new file mode 100644
index 000000000000..db17afd707ea
--- /dev/null
+++ b/layout/reftests/forms/input/search/appearance-textfield-dynamic.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<input type=search>
+<script>
+  let input = document.querySelector("input");
+  input.getBoundingClientRect();
+  input.style.appearance = "textfield";
+</script>
diff --git a/layout/reftests/forms/input/search/appearance-textfield.html b/layout/reftests/forms/input/search/appearance-textfield.html
new file mode 100644
index 000000000000..24ce084dae40
--- /dev/null
+++ b/layout/reftests/forms/input/search/appearance-textfield.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<input type=search style="appearance: textfield">
diff --git a/layout/reftests/forms/input/search/reftest.list b/layout/reftests/forms/input/search/reftest.list
index c422365434c0..9fd0a13c49eb 100644
--- a/layout/reftests/forms/input/search/reftest.list
+++ b/layout/reftests/forms/input/search/reftest.list
@@ -3,3 +3,6 @@
 != 3.html ref.html
 pref(layout.forms.input-type-search.enabled,true) == search-basic.html ref.html
 pref(layout.forms.input-type-search.enabled,true) != search-with-value.html text-with-value.html
+
+== appearance-textfield.html text.html
+== appearance-textfield-dynamic.html appearance-textfield.html
diff --git a/layout/reftests/forms/input/search/text.html b/layout/reftests/forms/input/search/text.html
new file mode 100644
index 000000000000..a46c54a7b7b5
--- /dev/null
+++ b/layout/reftests/forms/input/search/text.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<input type=text>
diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp
index 667e1b273ad5..1f62fc4d9b2a 100644
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2358,16 +2358,16 @@ static bool ScrollbarGenerationChanged(const nsStyleDisplay& aOld,
          changed(aOld.mOverflowY, aNew.mOverflowY);
 }
 
-static bool AppearanceValueAffectsFrames(StyleAppearance aDefaultAppearance,
-                                         StyleAppearance aAppearance) {
+static bool AppearanceValueAffectsFrames(StyleAppearance aAppearance,
+                                         StyleAppearance aDefaultAppearance) {
   switch (aAppearance) {
     case StyleAppearance::Textfield:
-      // This is for <input type=number> where we allow authors to specify a
-      // |-moz-appearance:textfield| to get a control without a spinner. (The
-      // spinner is present for |-moz-appearance:number-input| but also other
-      // values such as 'none'.) We need to reframe since this affects the
-      // spinbox creation in nsNumberControlFrame::CreateAnonymousContent.
-      return aDefaultAppearance == StyleAppearance::NumberInput;
+      // This is for <input type=number/search> where we allow authors to
+      // specify a |-moz-appearance:textfield| to get a control without buttons.
+      // We need to reframe since this affects the spinbox creation in
+      // nsNumber/SearchControlFrame::CreateAnonymousContent.
+      return aDefaultAppearance == StyleAppearance::NumberInput ||
+             aDefaultAppearance == StyleAppearance::Searchfield;
     case StyleAppearance::Menulist:
       // This affects the menulist button creation.
       return aDefaultAppearance == StyleAppearance::Menulist;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits