icecat: add release icecat-140.10.1-1gnu1 for ecne

This commit is contained in:
Ark74 2026-05-04 16:58:41 -06:00
parent a5f93cb214
commit ff85d7c623
1256 changed files with 63469 additions and 24141 deletions

View file

@ -47,6 +47,8 @@ export default [
process: true,
global: true,
L10N: true,
// TODO: Add this to the main ESlint globals Bug 2025542
Sanitizer: true,
},
},
rules: {

View file

@ -2,11 +2,12 @@
* 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/>. */
import React, { Component } from "devtools/client/shared/vendor/react";
import { div } from "devtools/client/shared/vendor/react-dom-factories";
import React, {
Component,
createRef,
} from "devtools/client/shared/vendor/react";
import PropTypes from "devtools/client/shared/vendor/react-prop-types";
import { connect } from "devtools/client/shared/vendor/react-redux";
import { basename } from "../utils/path";
import { createLocation } from "../utils/location";
const fuzzyAldrin = require("resource://devtools/client/shared/vendor/fuzzaldrin-plus.js");
@ -59,6 +60,7 @@ export class QuickOpenModal extends Component {
constructor(props) {
super(props);
this.state = { results: null, selectedIndex: 0 };
this.resultListRef = createRef();
}
static get propTypes() {
@ -223,20 +225,14 @@ export class QuickOpenModal extends Component {
if (query == "" && !this.isShortcutQuery()) {
this.showTopSources();
return;
}
if (this.isSymbolSearch()) {
} else if (this.isSymbolSearch()) {
await this.searchSymbols(query);
return;
}
if (this.isShortcutQuery()) {
} else if (this.isShortcutQuery()) {
this.searchShortcuts(query);
return;
} else {
this.searchSources(query);
}
this.searchSources(query);
this.highlightQueryMatches(this.props.query);
} catch (e) {
// Due to throttling this might get scheduled after the component and the
// toolbox are destroyed.
@ -394,23 +390,35 @@ export class QuickOpenModal extends Component {
isSourcesQuery = () => this.props.searchType === "sources";
isSourceSearch = () => this.isSourcesQuery() || this.isGotoSourceQuery();
/* eslint-disable react/no-danger */
renderHighlight(candidateString, query) {
highlightQueryMatches(query) {
const options = {
wrap: {
tagOpen: '<mark class="highlight">',
tagClose: "</mark>",
},
};
const html = fuzzyAldrin.wrap(candidateString, query, options);
return div({
dangerouslySetInnerHTML: {
__html: html,
},
});
if (this.resultListRef.current) {
const domEl = this.resultListRef.current.ref.current;
for (const titleNode of domEl.querySelectorAll(".title")) {
const htmlString = fuzzyAldrin.wrap(
titleNode.innerText,
query,
options
);
// Sanitizer API not supported in ESR 140
// Should remove at ESR 153
if ("Sanitizer" in window) {
const sanitizer = new Sanitizer({
elements: ["mark"],
attributes: ["class"],
});
titleNode.setHTML(htmlString, { sanitizer });
}
}
}
}
highlightMatching = (query, results) => {
renderResults = (query, results) => {
let newQuery = query;
if (newQuery === "") {
return results;
@ -421,11 +429,7 @@ export class QuickOpenModal extends Component {
if (typeof result.title == "string") {
return {
...result,
title: this.renderHighlight(
result.title,
basename(newQuery),
"title"
),
title: result.title,
};
}
return result;
@ -454,7 +458,7 @@ export class QuickOpenModal extends Component {
const { query } = this.props;
const { selectedIndex, results } = this.state;
const items = this.highlightMatching(query, results || []);
const items = this.renderResults(query, results || []);
const expanded = !!items && !!items.length;
return React.createElement(
Modal,
@ -487,7 +491,7 @@ export class QuickOpenModal extends Component {
items,
selected: selectedIndex,
selectItem: this.selectResultItem,
ref: "resultList",
ref: this.resultListRef,
expanded,
...(this.isSourceSearch() ? SIZE_BIG : SIZE_DEFAULT),
})

View file

@ -115,6 +115,9 @@ skip-if = [
["browser_dbg-call-stack.js"]
["browser_dbg-chrome-create.js"]
skip-if = [
"os == 'linux' && os_version == '18.04' && processor == 'x86_64' && asan", # Bug 2030884
]
["browser_dbg-console-async.js"]
@ -286,6 +289,7 @@ skip-if = [
["browser_dbg-javascript-tracer-values-preview.js"]
skip-if = [
"os == 'linux' && os_version == '18.04' && processor == 'x86_64' && opt && a11y_checks", # Bug The tracer tree isn't yet accessible
"os == 'linux' && os_version == '18.04' && processor == 'x86_64' && tsan", # Bug 1959018, Bug 2030884
"os == 'linux' && os_version == '24.04' && processor == 'x86_64' && display == 'x11' && opt && a11y_checks", # Bug The tracer tree isn't yet accessible
]

View file

@ -94,6 +94,18 @@ add_task(async function () {
pressKey(dbg, "Escape");
assertQuickOpenDisabled(dbg);
info("Test that the highlighted result matches match the query");
await quickOpen(dbg, "sw");
await waitForResults(dbg, [
"script-switching-01.js",
"script-switching-02.js",
]);
await assertHighlightMatches(dbg, 1, "sw");
await assertHighlightMatches(dbg, 2, "sw");
EventUtils.sendString("i");
await assertHighlightMatches(dbg, 1, "swi");
pressKey(dbg, "Escape");
info("Testing goto line:column");
assertLine(dbg, 0);
assertColumn(dbg, 1);
@ -170,3 +182,19 @@ async function assertResultIsTab(dbg, index) {
"Result should be a tab"
);
}
async function assertHighlightMatches(dbg, resultIndex, expectedMatchText) {
// Sanitizer API not supported in ESR 140
// Should remove at ESR 153
if ("Sanitizer" in dbg.win) {
const el = await findResultEl(dbg, resultIndex);
const highlight = await waitForElementWithSelector(dbg, "mark.highlight");
ok(el && !!highlight, "The query match is highlighted");
await waitUntil(
() => el.querySelector("mark.highlight").innerText == expectedMatchText
);
ok(true, "The highlighted text matches the query text");
} else {
ok(true, "The text is not highlighted");
}
}