Avoid unnecessary CSS updates
This commit is contained in:
parent
651ed5247b
commit
b6703d1189
@ -113,14 +113,19 @@ window._qutebrowser.stylesheet = (function() {
|
|||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (css_content === css) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
css_content = css;
|
||||||
|
|
||||||
if (style_elem) {
|
if (style_elem) {
|
||||||
style_elem.textContent = css;
|
style_elem.textContent = css;
|
||||||
// The browser seems to rewrite the document in same-origin frames
|
// The browser seems to rewrite the document in same-origin frames
|
||||||
// without notifying the mutation observer. Ensure that the
|
// without notifying the mutation observer. Ensure that the
|
||||||
// stylesheet is in the current document.
|
// stylesheet is in the current document.
|
||||||
watch_root();
|
watch_root();
|
||||||
} else {
|
|
||||||
css_content = css;
|
|
||||||
}
|
}
|
||||||
// Propagate the new CSS to all child frames.
|
// Propagate the new CSS to all child frames.
|
||||||
// FIXME:qtwebengine This does not work for cross-origin frames.
|
// FIXME:qtwebengine This does not work for cross-origin frames.
|
||||||
|
Loading…
Reference in New Issue
Block a user