Bug 1560460 - Build display items for an outside ::marker before child content to get the correct paint order. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D35553

--HG--
extra : rebase_source : d58d4bbede2252f010e7528cab0bacfff4932efb
This commit is contained in:
Mats Palmgren 2019-06-21 05:20:51 +02:00
Родитель d2e89cd600
Коммит af1b0f2a42
3 изменённых файлов: 73 добавлений и 5 удалений

Просмотреть файл

@ -6762,6 +6762,11 @@ void nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aBuilder->MarkFramesForDisplayList(this, mFloats); aBuilder->MarkFramesForDisplayList(this, mFloats);
if (HasOutsideMarker()) {
// Display outside ::marker manually.
BuildDisplayListForChild(aBuilder, GetOutsideMarker(), aLists);
}
// Prepare for text-overflow processing. // Prepare for text-overflow processing.
Maybe<TextOverflow> textOverflow = Maybe<TextOverflow> textOverflow =
TextOverflow::WillProcessLines(aBuilder, this); TextOverflow::WillProcessLines(aBuilder, this);
@ -6853,11 +6858,6 @@ void nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aLists.Content()->AppendToTop(&textOverflow->GetMarkers()); aLists.Content()->AppendToTop(&textOverflow->GetMarkers());
} }
if (HasOutsideMarker()) {
// Display outside ::marker manually.
BuildDisplayListForChild(aBuilder, GetOutsideMarker(), aLists);
}
#ifdef DEBUG #ifdef DEBUG
if (gLamePaintMetrics) { if (gLamePaintMetrics) {
PRTime end = PR_Now(); PRTime end = PR_Now();

Просмотреть файл

@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>CSS Pseduo: painting order of outside ::marker box</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.org">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
li {
list-style-type: none;
margin-left: 100px;
text-indent: -100px;
font: 20px/1 Ahem;
}
x { color: grey; }
</style>
</head>
<body>
<pre>There should be no red areas.<pre>
<ol><li><x>XXXXXXXX</x></ol>
<ol><li><x>XXXXXXXX</x></ol>
<ol><li><x>XXXXXXXX</x></ol>
<ol><li><x>XXXXXXXX</x></ol>
</body>
</html>

Просмотреть файл

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
<meta charset="utf-8">
<title>CSS Pseduo: painting order of outside ::marker box</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.org">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#marker-pseudo">
<link rel="match" href="outside-marker-paint-order-ref.html">
<style>
li {
margin-left: 100px;
text-indent: -100px;
font: 20px/1 Ahem;
color: red;
}
x { color: grey; }
.before::before { content: "XXXXXXXX"; color: grey; }
.after::after { content: "XXXXXXXX"; color: grey; }
.both::before,.both::after {content: "XXXX"; color: grey; }
</style>
</head>
<body>
<pre>There should be no red areas.<pre>
<ol><li><x>XXXXXXXX</x></ol>
<ol><li class="before"></ol>
<ol><li class="after"></ol>
<ol><li class="both"></ol>
</body>
</html>