mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
SVGLineElement::get_path() produces a path based on x1, y1, x2, and y2 attributes. During layout, this path is copied into paintables. If any of these attributes change after layout, the path stored in the paintable becomes stale. Fix by calling set_needs_layout_update() when a geometry attribute changes so the path is recomputed.
22 lines
696 B
HTML
22 lines
696 B
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<link rel="match" href="../expected/svg-line-dynamic-attribute-update-ref.html">
|
|
<svg width="200" height="200">
|
|
<line id="line" x1="0" y1="0" x2="10" y2="10" stroke="black" stroke-width="2"/>
|
|
</svg>
|
|
<script>
|
|
window.onload = () => {
|
|
requestAnimationFrame(() => {
|
|
requestAnimationFrame(() => {
|
|
const line = document.getElementById("line");
|
|
line.setAttribute("x1", "10");
|
|
line.setAttribute("y1", "10");
|
|
line.setAttribute("x2", "190");
|
|
line.setAttribute("y2", "190");
|
|
document.documentElement.classList.remove("reftest-wait");
|
|
});
|
|
});
|
|
};
|
|
</script>
|
|
</html>
|