Bug 1374235: style: Remove the for reconstruction traversals. r=bholley

One less hack, a few more to go.

MozReview-Commit-ID: 6katL1EGn2U
This commit is contained in:
Emilio Cobos Álvarez
2017-08-31 21:21:49 +02:00
parent d9a2fae508
commit f5e5f14adc
5 changed files with 4 additions and 89 deletions

View File

@@ -7597,22 +7597,6 @@ nsCSSFrameConstructor::StyleNewChildRange(nsIContent* aStartChild,
}
}
void
nsCSSFrameConstructor::StyleChildRangeForReconstruct(nsIContent* aStartChild,
nsIContent* aEndChild)
{
ServoStyleSet* styleSet = mPresShell->StyleSet()->AsServo();
// We take a parallelism hit here, since we don't have a great API to pass
// a range of elements to style to Servo.
for (nsIContent* child = aStartChild; child != aEndChild;
child = child->GetNextSibling()) {
if (child->IsElement()) {
styleSet->StyleSubtreeForReconstruct(child->AsElement());
}
}
}
void
nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
nsIContent* aFirstNewContent,
@@ -7702,12 +7686,8 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
// We couldn't construct lazily. Make Servo eagerly traverse the new content.
if (aContainer->IsStyledByServo()) {
if (aForReconstruction) {
StyleChildRangeForReconstruct(aFirstNewContent, nullptr);
} else {
StyleNewChildRange(aFirstNewContent, nullptr);
}
if (isNewlyAddedContentForServo) {
StyleNewChildRange(aFirstNewContent, nullptr);
}
if (isNewShadowTreeContent) {
@@ -8191,12 +8171,8 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
}
// We couldn't construct lazily. Make Servo eagerly traverse the new content.
if (aContainer->IsStyledByServo()) {
if (aForReconstruction) {
StyleChildRangeForReconstruct(aStartChild, aEndChild);
} else {
StyleNewChildRange(aStartChild, aEndChild);
}
if (isNewlyAddedContentForServo) {
StyleNewChildRange(aStartChild, aEndChild);
}
if (isNewShadowTreeContent) {