Fix segfault when hyphenating text in main process (#3388)
This commit is contained in:
parent
78fe68164f
commit
8d825f641a
4 changed files with 31 additions and 0 deletions
|
@ -213,15 +213,21 @@ cd "$app_dir"
|
||||||
# Copy 'browser' files from Firefox
|
# Copy 'browser' files from Firefox
|
||||||
#
|
#
|
||||||
# omni.ja is left uncompressed within the Firefox application files by fetch_xulrunner
|
# omni.ja is left uncompressed within the Firefox application files by fetch_xulrunner
|
||||||
|
#
|
||||||
|
# TEMP: Also extract .hyf hyphenation files from the outer (still compressed) omni.ja
|
||||||
|
# This works around https://bugzilla.mozilla.org/show_bug.cgi?id=1772900
|
||||||
set +e
|
set +e
|
||||||
if [ $BUILD_MAC == 1 ]; then
|
if [ $BUILD_MAC == 1 ]; then
|
||||||
cp -Rp "$MAC_RUNTIME_PATH"/Contents/Resources/browser/omni "$app_dir"
|
cp -Rp "$MAC_RUNTIME_PATH"/Contents/Resources/browser/omni "$app_dir"
|
||||||
|
unzip -qj "$MAC_RUNTIME_PATH"/Contents/Resources/omni.ja "hyphenation/*" -d "$app_dir"/hyphenation/
|
||||||
elif [ $BUILD_WIN == 1 ]; then
|
elif [ $BUILD_WIN == 1 ]; then
|
||||||
# Non-arch-specific files, so just use 64-bit version
|
# Non-arch-specific files, so just use 64-bit version
|
||||||
cp -Rp "${WIN_RUNTIME_PATH_PREFIX}win-x64"/browser/omni "$app_dir"
|
cp -Rp "${WIN_RUNTIME_PATH_PREFIX}win-x64"/browser/omni "$app_dir"
|
||||||
|
unzip -qj "${WIN_RUNTIME_PATH_PREFIX}win-x64"/omni.ja "hyphenation/*" -d "$app_dir"/hyphenation/
|
||||||
elif [ $BUILD_LINUX == 1 ]; then
|
elif [ $BUILD_LINUX == 1 ]; then
|
||||||
# Non-arch-specific files, so just use 64-bit version
|
# Non-arch-specific files, so just use 64-bit version
|
||||||
cp -Rp "${LINUX_RUNTIME_PATH_PREFIX}x86_64"/browser/omni "$app_dir"
|
cp -Rp "${LINUX_RUNTIME_PATH_PREFIX}x86_64"/browser/omni "$app_dir"
|
||||||
|
unzip -qj "${LINUX_RUNTIME_PATH_PREFIX}x86_64"/omni.ja "hyphenation/*" -d "$app_dir"/hyphenation/
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
cd $omni_dir
|
cd $omni_dir
|
||||||
|
|
10
test/content/hyphenationTest.xhtml
Normal file
10
test/content/hyphenationTest.xhtml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
<browser remote="false" />
|
||||||
|
<script>
|
||||||
|
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
document.querySelector('browser').loadURI('chrome://zotero-unit/content/hyphenationTestContent.html', {
|
||||||
|
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</window>
|
7
test/content/hyphenationTestContent.html
Normal file
7
test/content/hyphenationTestContent.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de-DE">
|
||||||
|
|
||||||
|
<div style="hyphens: auto">
|
||||||
|
Am 15. Juli 2017 wäre Walter Benjamin (1892-1940) 125 Jahre alt
|
||||||
|
geworden. Ottmar Fuchs erschließt einige Grundzüge seines Denkens.
|
||||||
|
</div>
|
8
test/tests/hyphenationTest.js
Normal file
8
test/tests/hyphenationTest.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
describe("Hyphenation", function () {
|
||||||
|
it("should not cause a segfault", async function () {
|
||||||
|
// Files in test/tests/data/ (resources://) can't be parsed as XUL/XHTML, so the data for this test is in
|
||||||
|
// test/content/ (chrome://), which can
|
||||||
|
window.openDialog('chrome://zotero-unit/content/hyphenationTest.xhtml', 'test', 'chrome');
|
||||||
|
await Zotero.Promise.delay(200);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue