Bug 1392892 - Avoid creating a live nsContentList in nsDocument::GetTitleElement(); r=smaug

This commit is contained in:
Ehsan Akhgari 2017-08-27 00:32:18 -04:00
Родитель 75e9304a93
Коммит 731a8f470b
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -7160,8 +7160,12 @@ nsDocument::GetTitleElement()
// We check the HTML namespace even for non-HTML documents, except SVG. This // We check the HTML namespace even for non-HTML documents, except SVG. This
// matches the spec and the behavior of all tested browsers. // matches the spec and the behavior of all tested browsers.
RefPtr<nsContentList> list = // We avoid creating a live nsContentList since we don't need to watch for DOM
NS_GetContentList(this, kNameSpaceID_XHTML, NS_LITERAL_STRING("title")); // tree mutations.
RefPtr<nsContentList> list = new nsContentList(this, kNameSpaceID_XHTML,
nsGkAtoms::title, nsGkAtoms::title,
/* aDeep = */ true,
/* aLiveList = */ false);
nsIContent* first = list->Item(0, false); nsIContent* first = list->Item(0, false);