Bug 1471095. Don't do extra work we don't need to in ReparentWrappersInSubtree. r=smaug

This commit is contained in:
Boris Zbarsky 2018-06-28 23:36:46 -04:00
Родитель 1a89c712a8
Коммит fcb00cb36f
2 изменённых файлов: 5 добавлений и 12 удалений

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

@ -1313,18 +1313,6 @@ ReparentWrappersInSubtree(nsIContent* aRoot)
JSContext* cx = jsapi.cx();
nsIGlobalObject* docGlobal = aRoot->OwnerDoc()->GetScopeObject();
if (NS_WARN_IF(!docGlobal)) {
return NS_ERROR_UNEXPECTED;
}
JS::Rooted<JSObject*> rootedGlobal(cx, docGlobal->GetGlobalJSObject());
if (NS_WARN_IF(!rootedGlobal)) {
return NS_ERROR_UNEXPECTED;
}
rootedGlobal = xpc::GetXBLScope(cx, rootedGlobal);
ErrorResult rv;
JS::Rooted<JSObject*> reflector(cx);
for (nsIContent* cur = aRoot; cur; cur = cur->GetNextNode(aRoot)) {

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

@ -1916,6 +1916,11 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat
CreateGeneratedContent(aState, aParentContent, pseudoComputedStyle,
contentIndex);
if (content) {
// We don't strictly have to set NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE
// here; it would get set under AppendChildTo. But AppendChildTo might
// think that we're going from not being anonymous to being anonymous and
// do some extra work; setting the flag here avoids that.
content->SetFlags(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE);
container->AppendChildTo(content, false);
if (content->IsElement()) {
// If we created any children elements, Servo needs to traverse them, but