Bug 1927138 - Remove popover prefs. r=webidl,smaug

Differential Revision: https://phabricator.services.mozilla.com/D226956
This commit is contained in:
Emilio Cobos Álvarez
2024-10-27 08:47:00 +00:00
parent 214a85b0bf
commit cf8f016fef
23 changed files with 51 additions and 95 deletions

View File

@@ -16,7 +16,6 @@ support-files = [
"!/accessible/tests/mochitest/moz.png",
]
prefs = [
"dom.element.popover.enabled=true",
"accessibility.ARIAElementReflection.enabled=true"
]

View File

@@ -6,9 +6,5 @@ support-files = [
"!/accessible/tests/mochitest/*.js",
"!/accessible/tests/browser/*.mjs",
]
prefs = [
"dom.element.popover.enabled=true"
]
["browser_computedARIARole.js"]
["browser_minimumRole.js"]

View File

@@ -6,7 +6,6 @@
add_task(async function () {
await pushPref("dom.element.invokers.enabled", true);
await pushPref("dom.element.popover.enabled", true);
await pushPref("dom.events.textevent.enabled", true);
const dbg = await initDebugger(

View File

@@ -135,11 +135,7 @@ const AVAILABLE_BREAKPOINTS = [
{
name: "Control",
items: [
// The condition should be removed when "dom.element.popover.enabled" is removed
generalEvent("control", "beforetoggle", () =>
// Services.prefs isn't available on worker targets
Services.prefs?.getBoolPref("dom.element.popover.enabled")
),
generalEvent("control", "beforetoggle"),
generalEvent("control", "blur"),
generalEvent("control", "change"),
generalEvent("control", "focus"),

View File

@@ -3397,10 +3397,6 @@ nsGenericHTMLElement* nsINode::GetEffectiveInvokeTargetElement() const {
}
nsGenericHTMLElement* nsINode::GetEffectivePopoverTargetElement() const {
if (!StaticPrefs::dom_element_popover_enabled()) {
return nullptr;
}
const auto* formControl =
nsGenericHTMLFormControlElementWithState::FromNode(this);
if (!formControl || formControl->IsDisabled() ||

View File

@@ -1472,8 +1472,7 @@ void EventStateManager::LightDismissOpenPopovers(WidgetEvent* aEvent,
MOZ_ASSERT(aEvent->mMessage == ePointerDown || aEvent->mMessage == ePointerUp,
"Light dismiss must be called for pointer up/down only");
if (!StaticPrefs::dom_element_popover_enabled() || !aEvent->IsTrusted() ||
!aTargetContent) {
if (!aEvent->IsTrusted() || !aTargetContent) {
return;
}

View File

@@ -776,8 +776,7 @@ void nsGenericHTMLElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
SetEventHandler(GetEventNameForAttr(aName), aValue->GetStringValue());
} else if (aNotify && aName == nsGkAtoms::spellcheck) {
SyncEditorsOnSubtree(this);
} else if (aName == nsGkAtoms::popover &&
StaticPrefs::dom_element_popover_enabled()) {
} else if (aName == nsGkAtoms::popover) {
nsContentUtils::AddScriptRunner(
NewRunnableMethod("nsGenericHTMLElement::AfterSetPopoverAttr", this,
&nsGenericHTMLElement::AfterSetPopoverAttr));
@@ -1035,8 +1034,7 @@ bool nsGenericHTMLElement::ParseAttribute(int32_t aNamespaceID,
return aResult.ParseEnumValue(aValue, kDirTable, false);
}
if (aAttribute == nsGkAtoms::popover &&
StaticPrefs::dom_element_popover_enabled()) {
if (aAttribute == nsGkAtoms::popover) {
return aResult.ParseEnumValue(aValue, kPopoverTable, false,
kPopoverTableInvalidValueDefault);
}
@@ -2815,15 +2813,13 @@ bool nsGenericHTMLFormControlElementWithState::ParseAttribute(
int32_t aNamespaceID, nsAtom* aAttribute, const nsAString& aValue,
nsIPrincipal* aMaybeScriptedPrincipal, nsAttrValue& aResult) {
if (aNamespaceID == kNameSpaceID_None) {
if (StaticPrefs::dom_element_popover_enabled()) {
if (aAttribute == nsGkAtoms::popovertargetaction) {
return aResult.ParseEnumValue(aValue, kPopoverTargetActionTable, false,
kPopoverTargetActionDefault);
}
if (aAttribute == nsGkAtoms::popovertarget) {
aResult.ParseAtom(aValue);
return true;
}
if (aAttribute == nsGkAtoms::popovertargetaction) {
return aResult.ParseEnumValue(aValue, kPopoverTargetActionTable, false,
kPopoverTargetActionDefault);
}
if (aAttribute == nsGkAtoms::popovertarget) {
aResult.ParseAtom(aValue);
return true;
}
if (StaticPrefs::dom_element_invokers_enabled()) {

File diff suppressed because one or more lines are too long

View File

@@ -32,7 +32,6 @@ interface mixin GlobalEventHandlers {
attribute EventHandler oncancel;
attribute EventHandler onauxclick;
attribute EventHandler onbeforeinput;
[Pref="dom.element.popover.enabled"]
attribute EventHandler onbeforetoggle;
attribute EventHandler oncanplay;
attribute EventHandler oncanplaythrough;

View File

@@ -12,8 +12,7 @@
* and create derivative works of this document.
*/
[Exposed=Window,
InstrumentedProps=(attributeStyleMap,hidePopover,popover,showPopover,togglePopover)]
[Exposed=Window, InstrumentedProps=(attributeStyleMap)]
interface HTMLElement : Element {
[HTMLConstructor] constructor();
@@ -50,7 +49,7 @@ interface HTMLElement : Element {
attribute DOMString contentEditable;
[Pure]
readonly attribute boolean isContentEditable;
[CEReactions, SetterThrows, Pure, Pref="dom.element.popover.enabled"]
[CEReactions, SetterThrows, Pure]
attribute DOMString? popover;
[CEReactions, SetterThrows, Pure]
attribute boolean spellcheck;
@@ -75,12 +74,9 @@ interface HTMLElement : Element {
[Throws]
ElementInternals attachInternals();
[Throws, Pref="dom.element.popover.enabled"]
undefined showPopover();
[Throws, Pref="dom.element.popover.enabled"]
undefined hidePopover();
[Throws, Pref="dom.element.popover.enabled"]
boolean togglePopover(optional boolean force);
[Throws] undefined showPopover();
[Throws] undefined hidePopover();
[Throws] boolean togglePopover(optional boolean force);
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface

View File

@@ -8,6 +8,6 @@
*/
interface mixin PopoverInvokerElement {
[Pref="dom.element.popover.enabled", CEReactions] attribute Element? popoverTargetElement;
[Pref="dom.element.popover.enabled", CEReactions] attribute DOMString popoverTargetAction;
[CEReactions] attribute Element? popoverTargetElement;
[CEReactions] attribute DOMString popoverTargetAction;
};

View File

@@ -890,37 +890,35 @@ slot {
}
/* Popover UA style, https://html.spec.whatwg.org/#flow-content-3 */
/* stylelint-disable-next-line media-query-no-invalid */
@media (-moz-bool-pref: "dom.element.popover.enabled") {
[popover]:not(:popover-open):not(dialog[open]) {
display:none;
}
dialog:popover-open {
display:block;
}
[popover] {
position: fixed;
inset: 0;
width: fit-content;
height: fit-content;
margin: auto;
border: solid;
padding: 0.25em;
overflow: auto;
color: CanvasText;
background-color: Canvas;
}
:popover-open {
-moz-top-layer: top;
}
:popover-open::backdrop {
position: fixed;
inset: 0;
pointer-events: none !important;
background-color: transparent;
}
[popover]:not(:popover-open):not(dialog[open]) {
display:none;
}
dialog:popover-open {
display:block;
}
[popover] {
position: fixed;
inset: 0;
width: fit-content;
height: fit-content;
margin: auto;
border: solid;
padding: 0.25em;
overflow: auto;
color: CanvasText;
background-color: Canvas;
}
:popover-open {
-moz-top-layer: top;
}
:popover-open::backdrop {
position: fixed;
inset: 0;
pointer-events: none !important;
background-color: transparent;
}

View File

@@ -2457,14 +2457,6 @@
value: false
mirror: always
# Whether the popover attribute implementation is enabled,
# see https://html.spec.whatwg.org/#the-popover-attribute
- name: dom.element.popover.enabled
type: RelaxedAtomicBool
value: true
mirror: always
rust: true
# Whether the blocking attribute implementation is enabled,
# see https://html.spec.whatwg.org/#blocking-attributes
- name: dom.element.blocking.enabled

View File

@@ -154,9 +154,6 @@ impl NonTSPseudoClass {
/// Returns whether the pseudo-class is enabled in content sheets.
#[inline]
fn is_enabled_in_content(&self) -> bool {
if matches!(*self, Self::PopoverOpen) {
return static_prefs::pref!("dom.element.popover.enabled");
}
if matches!(*self, Self::CustomState(_)) {
return static_prefs::pref!("dom.element.customstateset.enabled");
}

View File

@@ -1,3 +1,3 @@
# https://bugzilla.mozilla.org/show_bug.cgi?id=1859702
implementation-status: backlog
prefs: [dom.element.popover.enabled: true, dom.closewatcher.enabled: true]
prefs: [dom.closewatcher.enabled: true]

View File

@@ -1 +1 @@
prefs: [dom.element.popover.enabled: false, layout.css.transition-behavior.enabled: true]
prefs: [layout.css.transition-behavior.enabled: true]

View File

@@ -1 +0,0 @@
prefs: [dom.element.popover.enabled: true]

View File

@@ -1,3 +1,2 @@
lsan-disabled: true
prefs: [dom.element.popover.enabled: true]
leak-threshold: [default:51200]

View File

@@ -1,4 +1,3 @@
max-asserts: 3
prefs: [dom.element.popover.enabled: true]
lsan-allowed: [AddOrChangeProperty, AllocateCellBuffer, AllocateNewAtomNonStaticValidLength, AllocateProtoAndIfaceCache, Call, CallJSNative, CreateInterfaceObjects, CreateInterfacePrototypeObject, EnterJit, GetBackingObject, GetProperty, GetPropertyOperation, GetProtoObjectHandle, InternalCall, JSFunction::delazifySelfHostedLazyFunction, JSRuntime::delazifySelfHostedFunction, MaybeEnterInterpreterTrampoline, NativeInterface2JSObjectAndThrowIfFailed, NewCell, PromiseReactionJob, ProtoAndIfaceCache, RunHandler, SetProperty, Wrap, createWithShape, ensureTable, js::NewAtomCopyNDontDeflateValidLength, js::Nursery::allocateBuffer, js::RegExpObject::createSyntaxChecked, js::frontend::CompilationStencil::delazifySelfHostedFunction, js::jit::MaybeEnterJit, match, maybe_pod_arena_realloc, mozilla::EventDispatcher::Dispatch, mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal, mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal, mozilla::UniquePtr, mozilla::detail::HashTable, mozilla::dom::BrowsingContextGroup::WrapObject, mozilla::dom::BrowsingContextGroup_Binding::CreateInterfaceObjects, mozilla::dom::DOMRectReadOnly_Binding::CreateInterfaceObjects, mozilla::dom::GetPerInterfaceObjectHandle, mozilla::dom::HTMLHtmlElement_Binding::CreateInterfaceObjects, mozilla::dom::JSExecutionContext::InstantiateStencil, mozilla::dom::JSWindowActorChild_Binding::get_windowContext, mozilla::dom::MessageEvent_Binding::CreateInterfaceObjects, mozilla::dom::ScriptLoadHandler::OnStreamComplete, mozilla::net::HttpChannelChild::DoOnStartRequest, nsDSURIContentListener::DoContent, nsDocShell::Embed, nsDocumentViewer::Init, nsDocumentViewer::InitInternal, pod_arena_malloc, setShapeAndAddNewSlot, unknown stack]
leak-threshold: [default:204800, tab:460800]

View File

@@ -1 +0,0 @@
prefs: [dom.element.popover.enabled:true]

View File

@@ -1,2 +1 @@
prefs: [dom.element.popover.enabled: true]
leak-threshold: [default:51200]

View File

@@ -1 +0,0 @@
prefs: [dom.element.popover.enabled: true]

View File

@@ -2429,7 +2429,6 @@ STATIC_ATOMS = [
Atom("onpositionstatechange", "onpositionstatechange"),
Atom("onsupportedkeyschange", "onsupportedkeyschange"),
# Media query prefs for UA sheets.
Atom("dom_element_popover_enabled", "dom.element.popover.enabled"),
Atom("mathml_legacy_mathvariant_attribute_disabled", "mathml.legacy_mathvariant_attribute.disabled"),
Atom("layout_css_always_underline_links", "layout.css.always_underline_links"),
Atom("layout_css_cached_scrollbar_styles_enabled", "layout.css.cached-scrollbar-styles.enabled"),