Bug 1347411 part 1. Make sure to correctly update anon boxes belonging to ::before/::after pseudo-elements. r=heycam

MozReview-Commit-ID: AzF9WdUo1E
This commit is contained in:
Boris Zbarsky 2017-03-15 14:00:42 -04:00
Родитель bdfa7e2a7c
Коммит 2745162ccf
5 изменённых файлов: 37 добавлений и 0 удалений

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

@ -259,6 +259,13 @@ ServoRestyleManager::ProcessPostTraversal(Element* aElement,
MOZ_ASSERT(pseudoContext, "should have taken the ReconstructFrame path above");
pseudoFrame->SetStyleContext(pseudoContext);
if (pseudoFrame->GetStateBits() & NS_FRAME_OWNS_ANON_BOXES) {
// XXX It really would be good to pass the actual changehint for our
// ::before/::after here, but we never computed it!
pseudoFrame->UpdateStyleOfOwnedAnonBoxes(*aStyleSet, aChangeList,
nsChangeHint_Hints_NotHandledForDescendants);
}
// We only care restyling text nodes, since other type of nodes
// (images), are still not supported. If that eventually changes, we
// may have to write more code here... Or not, I don't think too

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

@ -0,0 +1,4 @@
<!DOCTYPE html>
<table cellpadding="0">
<tr><td style="text-indent: 50px">Some text</td></tr>
</table>

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html class="reftest-wait">
<style>
tr::before {
content: "Some text";
display: table-cell;
}
tr.i::before {
text-indent: 50px;
}
</style>
<table cellpadding="0">
<tr></tr>
</table>
<script>
onload = function() {
var tr = document.querySelector("tr");
// Make sure it's laid out
window.w = tr.offsetWidth;
document.querySelector("tr").className = "i";
document.documentElement.className = "";
}
</script>
</html>

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

@ -10,6 +10,7 @@ fails == dynamic-fieldset-01b.html dynamic-fieldset-01b.html
== dynamic-restyle-01.html dynamic-restyle-01.html
== dynamic-table-cell-01a.html dynamic-table-cell-01a.html
== dynamic-table-cell-01b.html dynamic-table-cell-01b.html
== dynamic-table-cell-indent.html dynamic-table-cell-indent.html
== floated-01.html floated-01.html
== images-01.html images-01.html
== positioned-01.html positioned-01.html

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

@ -9,6 +9,7 @@ fuzzy-if(OSX==1010,1,10) == dynamic-fieldset-01b.html dynamic-fieldset-01-ref.ht
fuzzy-if(OSX==1010,1,10) == dynamic-restyle-01.html dynamic-restyle-01-ref.html
fuzzy-if(OSX==1010,1,10) == dynamic-table-cell-01a.html dynamic-table-cell-01-ref.html
fuzzy-if(OSX==1010,1,10) == dynamic-table-cell-01b.html dynamic-table-cell-01-ref.html
== dynamic-table-cell-indent.html dynamic-table-cell-indent-ref.html
fuzzy-if(OSX==1010,1,10) == floated-01.html floated-01-ref.html
fuzzy-if(OSX==1010,1,10) == images-01.html images-01-ref.html
fuzzy-if(OSX==1010,1,10) == positioned-01.html positioned-01-ref.html