Bug 1312770 - Slightly increase loading priority for images that need size information for layout. r=tnikkel

MozReview-Commit-ID: 3SHpPXyIdVB

--HG--
extra : rebase_source : 55c06dd175a957d7e976f7e03869784320e73d67
This commit is contained in:
Shih-Chiang Chien 2017-03-27 15:53:49 +08:00
Родитель 7eb27c99ad
Коммит 980860cb2a
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -285,7 +285,14 @@ nsImageFrame::Init(nsIContent* aContent,
getter_AddRefs(currentRequest)); getter_AddRefs(currentRequest));
if (currentRequest) { if (currentRequest) {
currentRequest->BoostPriority(imgIRequest::CATEGORY_FRAME_INIT); uint32_t categoryToBoostPriority = imgIRequest::CATEGORY_FRAME_INIT;
// Increase load priority further if intrinsic size might be important for layout.
if (!HaveSpecifiedSize(StylePosition())) {
categoryToBoostPriority |= imgIRequest::CATEGORY_SIZE_QUERY;
}
currentRequest->BoostPriority(categoryToBoostPriority);
} }
} }