mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
dc9cb449b1
This removes the awkward hack to recompute the layout transform at paint time, and makes it possible for path sizes to be computed during layout. For example, it's possible to use relative units in SVG shapes (e.g. <rect>), which can be resolved during layout, but would be hard to resolve again during painting.
13 lines
593 B
HTML
13 lines
593 B
HTML
<link rel="match" href="reference/simple-svg-mask-ref.html" />
|
|
<svg width="120" viewBox="-10 -10 120 120">
|
|
<defs>
|
|
<mask id="myMask" maskUnits="userSpaceOnUse">
|
|
<!-- Everything under a white pixel will be visible -->
|
|
<rect x="0" y="0" width="100" height="100" fill="white" />
|
|
<!-- Everything under a black pixel will be invisible -->
|
|
<rect x="0" y="0" width="50" height="100" fill="black" />
|
|
</mask>
|
|
</defs>
|
|
<rect x="-10" y="-10" width="120" height="120" fill="blue" />
|
|
<rect x="10" y="10" width="80" height="80" fill="red" mask="url(#myMask)" />
|
|
</svg>
|