Bug 1221112: When checking for ::before/::after while sorting flex items by DOM order, dig past placeholder to out-of-flow frame. r=mats
This commit is contained in:
32
layout/generic/crashtests/1221112-1.html
Normal file
32
layout/generic/crashtests/1221112-1.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
|
||||
/* Just for easier visualization: */
|
||||
width: 600px;
|
||||
justify-content: space-around;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.flexContainer:before {
|
||||
position:absolute;
|
||||
content:'before';
|
||||
}
|
||||
.flexContainer:after {
|
||||
position:absolute;
|
||||
content:'after'
|
||||
}
|
||||
|
||||
.ordered-item {
|
||||
position:relative;
|
||||
order:5;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="ordered-item">ItemWithOrderSet
|
||||
<!-- It's important that this remain unclosed, for some reason. -->
|
||||
27
layout/generic/crashtests/1221112-2.html
Normal file
27
layout/generic/crashtests/1221112-2.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.flexContainer {
|
||||
display: flex;
|
||||
|
||||
/* Just for easier visualization: */
|
||||
width: 600px;
|
||||
justify-content: space-around;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.flexContainer:before {
|
||||
position:absolute;
|
||||
content:'before';
|
||||
}
|
||||
.flexContainer:after {
|
||||
position:absolute;
|
||||
content:'after'
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flexContainer">
|
||||
<div class="ordered-item">NormalFlexItem
|
||||
<!-- It's important that this remain unclosed, for some reason. -->
|
||||
@@ -585,6 +585,8 @@ load 1157011.html
|
||||
load 1169420-1.html
|
||||
load 1169420-2.html
|
||||
load 1183431.html
|
||||
load 1221112-1.html
|
||||
load 1221112-2.html
|
||||
load first-letter-638937-1.html
|
||||
load first-letter-638937-2.html
|
||||
pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) asserts(1-100) load font-inflation-762332.html # bug 762332
|
||||
|
||||
@@ -987,8 +987,11 @@ IsOrderLEQWithDOMFallback(nsIFrame* aFrame1,
|
||||
// recognize generated content as being an actual sibling of other nodes.
|
||||
// We know where ::before and ::after nodes *effectively* insert in the DOM
|
||||
// tree, though (at the beginning & end), so we can just special-case them.
|
||||
nsIAtom* pseudo1 = aFrame1->StyleContext()->GetPseudo();
|
||||
nsIAtom* pseudo2 = aFrame2->StyleContext()->GetPseudo();
|
||||
nsIAtom* pseudo1 =
|
||||
nsPlaceholderFrame::GetRealFrameFor(aFrame1)->StyleContext()->GetPseudo();
|
||||
nsIAtom* pseudo2 =
|
||||
nsPlaceholderFrame::GetRealFrameFor(aFrame2)->StyleContext()->GetPseudo();
|
||||
|
||||
if (pseudo1 == nsCSSPseudoElements::before ||
|
||||
pseudo2 == nsCSSPseudoElements::after) {
|
||||
// frame1 is ::before and/or frame2 is ::after => frame1 is LEQ frame2.
|
||||
|
||||
Reference in New Issue
Block a user