зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1140579
- Make <legend>s have a legend frame when nearest ancestor frame is a fieldset frame. r=roc
IOW, drop the requirement that the parent *content* is a <fieldset>, thus allowing a <legend> to become the fieldset legend also when it's wrapped in one or more nodes that are styled with display:contents.
This commit is contained in:
Родитель
4c74b7ca6b
Коммит
b1a684cc86
|
@ -3471,8 +3471,6 @@ nsCSSFrameConstructor::FindHTMLData(Element* aElement,
|
|||
if (aTag == nsGkAtoms::legend &&
|
||||
(!aParentFrame ||
|
||||
!IsFrameForFieldSet(aParentFrame, aParentFrame->GetType()) ||
|
||||
!aElement->GetParent() ||
|
||||
!aElement->GetParent()->IsHTMLElement(nsGkAtoms::fieldset) ||
|
||||
aStyleContext->StyleDisplay()->IsFloatingStyle() ||
|
||||
aStyleContext->StyleDisplay()->IsAbsolutelyPositionedStyle())) {
|
||||
// <legend> is only special inside fieldset, check both the frame tree
|
||||
|
|
|
@ -14,6 +14,7 @@ legend { border: 1px solid; }
|
|||
.before::before { content:"::before"; }
|
||||
.nb legend.static { border: 1px solid; }
|
||||
.nb legend { border-style:none; }
|
||||
.p0 legend { padding:0; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -23,17 +24,17 @@ legend { border: 1px solid; }
|
|||
<fieldset><div class="test contents before"></div></fieldset>
|
||||
<fieldset><div class="test contents before after"></div></fieldset>
|
||||
<fieldset><legend class="test contents"></legend></fieldset>
|
||||
<fieldset><div class="contents nb"><legend class="test contents"></legend></div></fieldset>
|
||||
<fieldset><legend class="test contents" style="padding:0"></legend></fieldset>
|
||||
<fieldset><legend class="contents"><div class="test contents"></div></legend></fieldset>
|
||||
<fieldset class="test2"></fieldset>
|
||||
<fieldset class="test2 after"></fieldset>
|
||||
<fieldset class="test2"><legend class="static"></legend></fieldset>
|
||||
<fieldset class="test2"><legend class="static contents"></legend></fieldset>
|
||||
<fieldset class="test2"><div class="contents"><legend class="static"></legend></div></fieldset>
|
||||
<fieldset><div class="test2 contents nb"></div></fieldset>
|
||||
<fieldset><div class="test3 contents"></div></fieldset>
|
||||
<fieldset><div class="test2 contents nb"><legend class="static"></legend></div></fieldset>
|
||||
<fieldset><div class="test3 contents"><legend class="static"></legend></div></fieldset>
|
||||
<fieldset class="test2"><legend class="static" style="padding:0"></legend></fieldset>
|
||||
<fieldset class="test2 p0"></fieldset>
|
||||
<fieldset class="test2 p0"></fieldset>
|
||||
<fieldset class="test2 p0"><legend class="static"></legend></fieldset>
|
||||
<fieldset class="test2 p0"><legend class="static"></legend></fieldset>
|
||||
<script>
|
||||
document.body.offsetHeight;
|
||||
var tests = document.querySelectorAll('.test');
|
||||
|
|
Загрузка…
Ссылка в новой задаче