From cd214fc2d822ae832c036793f2f308f275d2fbb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 28 Dec 2023 17:45:50 +0000 Subject: [PATCH] Bug 1871745 - Keep exposing chrome-only properties on CSS2Properties. r=peterv So that chrome code can keep setting -moz-user-focus via script, for example. Differential Revision: https://phabricator.services.mozilla.com/D197295 --- browser/base/content/browser.js | 11 +++---- dom/bindings/Configuration.py | 3 +- dom/bindings/GenerateCSS2PropertiesWebIDL.py | 8 +++-- ...est_non_content_accessible_properties.html | 29 ++++++++++++------- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 5df35dbe0205..2564903ff817 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -10051,13 +10051,10 @@ var FirefoxViewHandler = { this.button?.setAttribute("aria-pressed", selected); this._recordViewIfTabSelected(); this._onTabForegrounded(); - if (e.target == this.tab) { - // If Fx View is opened, add temporary style to make first available tab focusable - gBrowser.visibleTabs[0].style["-moz-user-focus"] = "normal"; - } else { - // When Fx View is closed, remove temporary -moz-user-focus style from first available tab - gBrowser.visibleTabs[0].style.removeProperty("-moz-user-focus"); - } + // If Fx View is opened, add temporary style to make first available tab focusable + // When Fx View is closed, remove temporary -moz-user-focus style from first available tab + gBrowser.visibleTabs[0].style.MozUserFocus = + e.target == this.tab ? "normal" : ""; break; case "TabClose": this.tab = null; diff --git a/dom/bindings/Configuration.py b/dom/bindings/Configuration.py index f336eca154cc..266a8db34a0e 100644 --- a/dom/bindings/Configuration.py +++ b/dom/bindings/Configuration.py @@ -382,11 +382,12 @@ class Configuration(DescriptorProvider): def filterExtendedAttributes(extendedAttributes): # These are the extended attributes that we allow to have - # different values among all atributes that use the same + # different values among all attributes that use the same # template. ignoredAttributes = { "BindingTemplate", "BindingAlias", + "ChromeOnly", "Pure", "Pref", "Func", diff --git a/dom/bindings/GenerateCSS2PropertiesWebIDL.py b/dom/bindings/GenerateCSS2PropertiesWebIDL.py index b6178110956d..e087af931f7d 100644 --- a/dom/bindings/GenerateCSS2PropertiesWebIDL.py +++ b/dom/bindings/GenerateCSS2PropertiesWebIDL.py @@ -23,9 +23,6 @@ def generate(output, idlFilename, dataFile): propsData = runpy.run_path(dataFile)["data"] props = "" for p in propsData.values(): - if "Internal" in p.flags: - continue - # Skip properties which aren't valid in style rules. if "Style" not in p.rules: continue @@ -46,6 +43,7 @@ def generate(output, idlFilename, dataFile): ] if p.pref != "": + assert "Internal" not in p.flags # BackdropFilter is a special case where we want WebIDL to check # a function instead of checking the pref directly. if p.method == "BackdropFilter": @@ -54,6 +52,10 @@ def generate(output, idlFilename, dataFile): # see bug 1861828, 1865332, 1860424, 1864970, 1865332, 1869119. elif p.method not in ["MozTransform", "MozTransformOrigin"]: extendedAttrs.append('Pref="%s"' % p.pref) + elif "EnabledInUASheetsAndChrome" in p.flags: + extendedAttrs.append("ChromeOnly") + elif "Internal" in p.flags: + continue def add_extra_accessors(p): prop = p.method diff --git a/layout/style/test/test_non_content_accessible_properties.html b/layout/style/test/test_non_content_accessible_properties.html index f24fd0fa792d..220ddf2d2629 100644 --- a/layout/style/test/test_non_content_accessible_properties.html +++ b/layout/style/test/test_non_content_accessible_properties.html @@ -4,26 +4,30 @@