Skip to content

Commit 16d86e5

Browse files
committedSep 12, 2018
Don't ignore block margins on the legend
Fixes #3929.
1 parent fbd3219 commit 16d86e5

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed
 

‎source

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112351,8 +112351,9 @@ legend[align=right i] {
112351112351
<li><p>The element is expected to be positioned in the inline direction as is normal for
112352112352
blocks (e.g., taking into account margins and the 'justify-self' property).</p></li>
112353112353

112354-
<li><p>The used value of the element's margins in the block-flow direction are expected to be
112355-
zero.</p></li>
112354+
<li><p>The element's margins in the block-flow direction are expected to not collapse with the
112355+
margins of the 'fieldset' or the margins of descendants of the <span>anonymous fieldset content
112356+
box</span>.</p></li>
112356112357

112357112358
<li><p>The element is expected to be positioned in the block-flow direction such that its border
112358112359
box is centered over the border on the block-start side of the 'fieldset'.</p></li>
@@ -112422,7 +112423,7 @@ legend[align=right i] {
112422112423

112423112424
<div class="note">
112424112425
<figure>
112425-
<svg viewBox="0 0 400 200" width="400" height="200">
112426+
<svg viewBox="0 0 400 270" width="480" height="324">
112426112427
<title>Fieldset layout model</title>
112427112428

112428112429
<defs>
@@ -112437,43 +112438,58 @@ legend[align=right i] {
112437112438
</defs>
112438112439

112439112440
<!-- outer outline -->
112440-
<rect stroke-dasharray="6" stroke-width="1" stroke="black" width="304" height="104" x="48"
112441+
<rect stroke-dasharray="6" stroke-width="1" stroke="black" width="304" height="176" x="48"
112441112442
y="48" fill="none"/>
112442112443

112443112444
<line marker-end="url(#arrow-blue)" x1="200" x2="200" y1="48" y2="20" stroke-width="2"
112444112445
stroke="blue"/>
112445-
<line marker-end="url(#arrow-blue)" x1="48" x2="20" y1="100" y2="100" stroke-width="2"
112446+
<line marker-end="url(#arrow-blue)" x1="48" x2="20" y1="136" y2="136" stroke-width="2"
112446112447
stroke="blue"/>
112447-
<line marker-end="url(#arrow-blue)" x1="352" x2="380" y1="100" y2="100" stroke-width="2"
112448+
<line marker-end="url(#arrow-blue)" x1="352" x2="380" y1="136" y2="136" stroke-width="2"
112448112449
stroke="blue"/>
112449-
<line marker-end="url(#arrow-blue)" x1="200" x2="200" y1="152" y2="180" stroke-width="2"
112450+
<line marker-end="url(#arrow-blue)" x1="200" x2="200" y1="224" y2="250" stroke-width="2"
112450112451
stroke="blue"/>
112451112452
<text x="210" y="35" font-size="12" font-family="sans-serif" font-style="normal"
112452112453
fill="blue">fieldset's margin</text>
112453112454

112454112455
<!-- fieldset -->
112455-
<rect stroke-width="2" stroke="blue" width="300" height="75" x="50" y="75" fill="white"/>
112456+
<rect stroke-width="2" stroke="blue" width="300" height="116.5" x="50" y="105" fill="white"/>
112456112457

112457112458
<!-- rendered legend -->
112458-
<rect stroke-width="2" stroke="red" width="85" height="50" x="75" y="50" fill="white"/>
112459-
<text x="95" y="75" dominant-baseline="central" fill="red" font-family="serif"
112459+
<rect stroke-width="2" stroke="red" width="85" height="60" x="100" y="75" fill="white"/>
112460+
<text x="120" y="105" dominant-baseline="central" fill="red" font-family="serif"
112460112461
font-style="normal">legend</text>
112461112462

112462-
<line marker-end="url(#arrow-red)" x1="160" x2="340" y1="65" y2="65" stroke-width="2"
112463+
<!-- legend padding -->
112464+
<rect x="110" y="85" width="65" height="40" fill="none" stroke="#eee" stroke-width="18"/>
112465+
<text x="133" y="88" font-size="12" font-family="sans-serif" font-style="normal"
112466+
fill="gray">padding</text>
112467+
112468+
<line marker-end="url(#arrow-red)" x1="185" x2="325" y1="90" y2="90" stroke-width="2"
112463112469
stroke="red"/>
112464-
<text x="210" y="60" font-size="12" font-family="sans-serif" font-style="normal"
112470+
<text x="210" y="85" font-size="12" font-family="sans-serif" font-style="normal"
112465112471
fill="red">legend's margin</text>
112466112472

112467-
<line marker-end="url(#arrow-red)" x1="75" x2="60" y1="65" y2="65" stroke-width="2"
112473+
<line marker-end="url(#arrow-red)" x1="100" x2="75" y1="90" y2="90" stroke-width="2"
112474+
stroke="red"/>
112475+
<line marker-end="url(#arrow-red)" x1="143" x2="143" y1="75" y2="60" stroke-width="2"
112476+
stroke="red"/>
112477+
<line marker-end="url(#arrow-red)" x1="143" x2="143" y1="135" y2="150" stroke-width="2"
112468112478
stroke="red"/>
112469112479

112480+
<!-- fieldset padding -->
112481+
<rect x="60" y="171" width="280" height="40" fill="none" stroke="#eee" stroke-width="18"/>
112482+
<text x="297" y="174" font-size="12" font-family="sans-serif" font-style="normal"
112483+
fill="gray">padding</text>
112484+
112470112485
<!-- anonymous fieldset content box outline -->
112471-
<rect stroke-dasharray="6" stroke-width="1" stroke="black" width="296" height="46" x="52"
112472-
y="102" fill="none"/>
112473-
<text x="170" y="116" font-size="12" font-family="sans-serif" font-style="normal">anonymous
112486+
<rect stroke-dasharray="6" stroke-width="1" stroke="black" width="296" height="58" x="52"
112487+
y="161" fill="none"/>
112488+
<text x="170" y="156" font-size="12" font-family="sans-serif" font-style="normal">anonymous
112474112489
fieldset content box</text>
112475-
<text x="75" y="125" dominant-baseline="central" fill="blue" font-family="serif"
112490+
<text x="70" y="191" dominant-baseline="central" fill="blue" font-family="serif"
112476112491
font-style="normal">content</text>
112492+
112477112493
</svg>
112478112494

112479112495
<figcaption>The legend is rendered over the top border, and the top border area reserves

0 commit comments

Comments
 (0)