forked from mirrors/gecko-dev
Gijs for front-end bits, layout for the new CSS properties and the removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y changes. As discussed in the bug, the main tricky part here is handling a11y correctly. For <deck>, that's trivial (just use `visibility: hidden` to hide the panels visually, while removing the unselected panels from the a11y tree). For <tabpanels> however we need to do something special. We do want to hide stuff visually, but we want to preserve the contents in the a11y tree. For that, the easiest fix is introducing a new privileged CSS property (-moz-subtree-hidden-only-visually), which takes care of not painting the frame, but marks stuff offscreen in the accessibility tree. This is not intended to be a property used widely. Other than that, the changes are relatively straight-forward, though some of the accessible/mac changes I could get a sanity-check on. Differential Revision: https://phabricator.services.mozilla.com/D157875
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
// This is loaded into chrome windows with the subscript loader. Wrap in
|
|
// a block to prevent accidentally leaking globals onto `window`.
|
|
{
|
|
class MozDropmarker extends MozXULElement {
|
|
constructor() {
|
|
super();
|
|
let shadowRoot = this.attachShadow({ mode: "open" });
|
|
let stylesheet = document.createElement("link");
|
|
stylesheet.rel = "stylesheet";
|
|
stylesheet.href = "chrome://global/skin/dropmarker.css";
|
|
|
|
let image = document.createXULElement("image");
|
|
image.part = "icon";
|
|
shadowRoot.append(stylesheet, image);
|
|
}
|
|
}
|
|
|
|
customElements.define("dropmarker", MozDropmarker);
|
|
|
|
class MozCommandSet extends MozXULElement {
|
|
connectedCallback() {
|
|
if (this.getAttribute("commandupdater") === "true") {
|
|
const events = this.getAttribute("events") || "*";
|
|
const targets = this.getAttribute("targets") || "*";
|
|
document.commandDispatcher.addCommandUpdater(this, events, targets);
|
|
}
|
|
}
|
|
|
|
disconnectedCallback() {
|
|
if (this.getAttribute("commandupdater") === "true") {
|
|
document.commandDispatcher.removeCommandUpdater(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
customElements.define("commandset", MozCommandSet);
|
|
}
|