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:
Daniel Holbert
2015-11-04 07:48:59 -08:00
parent 20b16d25e5
commit 1949c99437
4 changed files with 66 additions and 2 deletions

View 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. -->

View 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. -->

View File

@@ -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

View File

@@ -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.