mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 407861 - Bolding the found text in autocomplete breaks ligatures. r=gavin, a1.9b5=beltzner, b-ff3=beltzner
This commit is contained in:
parent
4f17380fd1
commit
2036ee572a
@ -1273,6 +1273,23 @@
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_needsAlternateEmphasis">
|
||||
<parameter name="aText"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
for (let i = aText.length; --i >= 0; ) {
|
||||
let charCode = aText.charCodeAt(i);
|
||||
// Arabic, Syriac, Indic languages are likely to have ligatures
|
||||
// that are broken when using the main emphasis styling
|
||||
if (0x0600 <= charCode && charCode <= 0x109F)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_setUpDescription">
|
||||
<parameter name="aDescriptionElement"/>
|
||||
<parameter name="aText"/>
|
||||
@ -1287,6 +1304,10 @@
|
||||
let tokens = this._getSearchTokens(search);
|
||||
let indices = this._getBoundaryIndices(aText, tokens);
|
||||
|
||||
// If we're searching for something that needs alternate emphasis,
|
||||
// we'll need to check the text that we match
|
||||
let checkAlt = this._needsAlternateEmphasis(search);
|
||||
|
||||
let next;
|
||||
let start = 0;
|
||||
let len = indices.length;
|
||||
@ -1300,7 +1321,8 @@
|
||||
// Emphasize the text for even indices
|
||||
let span = aDescriptionElement.appendChild(
|
||||
document.createElementNS("http://www.w3.org/1999/xhtml", "span"));
|
||||
span.className = "ac-emphasize-text";
|
||||
span.className = checkAlt && this._needsAlternateEmphasis(text) ?
|
||||
"ac-emphasize-alt" : "ac-emphasize-text";
|
||||
span.textContent = text;
|
||||
} else {
|
||||
// Otherwise, it's plain text
|
||||
|
@ -174,13 +174,20 @@ treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html|*.ac-emphasize-text {
|
||||
.ac-normal-text > html|span {
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html|span.ac-emphasize-text {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
html|span.ac-emphasize-alt {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ac-title, .ac-url {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -161,13 +161,20 @@ treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html|*.ac-emphasize-text {
|
||||
.ac-normal-text > html|span {
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html|span.ac-emphasize-text {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
html|span.ac-emphasize-alt {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ac-title, .ac-url {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
@ -162,13 +162,20 @@ treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html|*.ac-emphasize-text {
|
||||
.ac-normal-text > html|span {
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html|span.ac-emphasize-text {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
html|span.ac-emphasize-alt {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.ac-title, .ac-url {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user