GitLab's annual major release is around the corner. Along with a lot of new and exciting features, there will be a few breaking changes. Learn more here.

Commit 2f5ed6dc authored by S. Zeid's avatar S. Zeid
Browse files

Fix changes to clip-path not taking effect in WebKit

parent 302e7011
......@@ -171,23 +171,34 @@ export default
this.canvas.height = height;
this.canvas.style.width = String(width) + "px";
this.canvas.style.height = String(height) + "px";
if (this._cover) {
this.shadowRoot.querySelector("style.runtime.screen").textContent = `
figure {
justify-content: left;
}
`;
} else {
hostRect = this.getBoundingClientRect();
this.shadowRoot.querySelector("style.runtime.screen").textContent = `
:host(:not([hidden])) {
clip-path: inset(
${(hostRect.height - height) / 2}px
${(hostRect.width - width) / 2}px
);
}
`;
}
this.shadowRoot.querySelector("style.runtime.screen").textContent = `
/* Work around changes to clip-path not taking effect in WebKit */
:host(:not[hidden]) {
opacity: 0.99;
}
`;
setTimeout(() => {
if (this._cover) {
this.shadowRoot.querySelector("style.runtime.screen").textContent = `
:host(:not([hidden])) {
clip-path: none;
}
figure {
justify-content: left;
}
`;
} else {
hostRect = this.getBoundingClientRect();
this.shadowRoot.querySelector("style.runtime.screen").textContent = `
:host(:not([hidden])) {
clip-path: inset(
${(hostRect.height - height) / 2}px
${(hostRect.width - width) / 2}px
);
}
`;
}
}, 1);
}
// Clears the entire canvas.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment