mirror of
https://github.com/zotero/zotero.git
synced 2026-09-28 01:31:40 +00:00
fx140: Work around grid layout bug in item box
And don't use hiddenDOMWindow, since it's no longer available on all platforms.
This commit is contained in:
parent
4ecac12cc6
commit
e52b1993f4
2 changed files with 19 additions and 9 deletions
|
|
@ -60,18 +60,11 @@
|
|||
];
|
||||
|
||||
static get _textMeasurementSpan() {
|
||||
// Create our hidden span in the hiddenDOMWindow, because any calls to
|
||||
// getBoundingClientRect(), offsetWidth, scrollWidth, etc. on an element
|
||||
// in this document from sizeToContent() will, bizarrely, cause things
|
||||
// in the metadata table to overlap
|
||||
// TEMP: fx140: Use document
|
||||
// TODO: Check if this bug is still present and restore hiddenDOMWindow if necessary
|
||||
let doc = document; // Services.appShell.hiddenDOMWindow.document;
|
||||
let span = doc.createElement('span');
|
||||
let span = document.createElement('span');
|
||||
span.style.position = 'absolute';
|
||||
span.style.visibility = 'hidden';
|
||||
span.style.whiteSpace = 'pre';
|
||||
doc.documentElement.append(span);
|
||||
document.documentElement.append(span);
|
||||
|
||||
window.addEventListener('unload', () => {
|
||||
span.remove();
|
||||
|
|
|
|||
|
|
@ -417,6 +417,23 @@
|
|||
|
||||
if (this._isAlreadyRendered()) return;
|
||||
|
||||
try {
|
||||
// Firefox's grid layout implementation has a bug that causes rows
|
||||
// to overlap due to bad layout invalidation after some synchronous
|
||||
// modifications of the DOM, like the ones made by editable-text's
|
||||
// _getContentWidth() method.
|
||||
// Build our table as a normal block element and then revert to
|
||||
// grid layout at the end to force a single layout recalculation
|
||||
// after everything is stable.
|
||||
this._infoTable.style.display = 'block';
|
||||
this._renderInternal();
|
||||
}
|
||||
finally {
|
||||
this._infoTable.style.display = '';
|
||||
}
|
||||
}
|
||||
|
||||
_renderInternal() {
|
||||
this._saveFieldFocus();
|
||||
|
||||
delete this._linkMenu.dataset.link;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue