Merge mozilla-central to autoland. a=merge CLOSED TREE

This commit is contained in:
Oana Pop Rus 2019-01-22 11:47:46 +02:00
Родитель efe01e7465 6c784c93cf
Коммит 6401add91f
5 изменённых файлов: 54 добавлений и 10 удалений

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

@ -5100,8 +5100,8 @@ class TabProgressListener {
// and the subframes.
let topLevel = aWebProgress.isTopLevel;
let isSameDocument = !!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT);
if (topLevel) {
let isSameDocument = !!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT);
let isReload = !!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_RELOAD);
let isErrorPage = !!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE);
@ -5199,10 +5199,12 @@ class TabProgressListener {
if (!this.mBlank) {
this._callProgressListeners("onLocationChange",
[aWebProgress, aRequest, aLocation, aFlags]);
// Include the true final argument to indicate that this event is
// simulated (instead of being observed by the webProgressListener).
this._callProgressListeners("onContentBlockingEvent",
[aWebProgress, null, 0, true]);
if (topLevel && !isSameDocument) {
// Include the true final argument to indicate that this event is
// simulated (instead of being observed by the webProgressListener).
this._callProgressListeners("onContentBlockingEvent",
[aWebProgress, null, 0, true]);
}
}
if (topLevel) {

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

@ -237,7 +237,7 @@
#include "mozilla/Encoding.h"
#include "nsXULElement.h"
#include "mozilla/RecordReplay.h"
#include "nsThreadManager.h"
#include "nsIBidiKeyboard.h"
#if defined(XP_WIN)
@ -10435,6 +10435,20 @@ static bool JSONCreator(const char16_t* aBuf, uint32_t aLen, void* aData) {
return true;
}
/* static */
bool nsContentUtils::HighPriorityEventPendingForTopLevelDocumentBeforeContentfulPaint(
Document* aDocument) {
if (!aDocument) {
return false;
}
Document* topLevel = aDocument->GetTopLevelContentDocument();
return topLevel && topLevel->GetShell() &&
topLevel->GetShell()->GetPresContext() &&
!topLevel->GetShell()->GetPresContext()->HadContentfulPaint() &&
nsThreadManager::MainThreadHasPendingHighPriorityEvents();
}
/* static */ bool nsContentUtils::IsURIInPrefList(nsIURI* aURI,
const char* aPrefName) {
MOZ_ASSERT(aPrefName);

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

@ -3304,6 +3304,14 @@ class nsContentUtils {
static bool StringifyJSON(JSContext* aCx, JS::MutableHandle<JS::Value> vp,
nsAString& aOutStr);
/**
* Returns true if the top level ancestor content document of aDocument hasn't
* yet had the first contentful paint and there is a high priority event
* pending in the main thread.
*/
static bool HighPriorityEventPendingForTopLevelDocumentBeforeContentfulPaint(
Document* aDocument);
private:
static bool InitializeEventTable();

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

@ -2013,7 +2013,7 @@ WebRenderCommandBuilder::GenerateFallbackData(
// e.g.: nsDisplayBoxShadowInner uses mPaintRect in Paint() and mPaintRect is
// computed in nsDisplayBoxShadowInner::ComputeVisibility().
nsRegion visibleRegion(paintBounds);
aItem->SetPaintRect(paintBounds);
aItem->SetPaintRect(aItem->GetBuildingRect().Intersect(paintBounds));
aItem->ComputeVisibility(aDisplayListBuilder, &visibleRegion);
const int32_t appUnitsPerDevPixel =
@ -2032,9 +2032,25 @@ WebRenderCommandBuilder::GenerateFallbackData(
gfx::FuzzyEqual(scale.height, oldScale.height, 1e-6f);
LayoutDeviceToLayerScale2D layerScale(scale.width, scale.height);
auto scaledBounds = bounds * layerScale;
auto dtRect = RoundedOut(scaledBounds);
auto trans =
ViewAs<LayerPixel>(aSc.GetSnappingSurfaceTransform().GetTranslation());
auto snappedTrans = LayerIntPoint::Floor(trans);
LayerPoint residualOffset = trans - snappedTrans;
auto dtRect = LayerIntRect::FromUnknownRect(
ScaleToOutsidePixelsOffset(paintBounds, scale.width, scale.height,
appUnitsPerDevPixel, residualOffset));
auto dtSize = dtRect.Size();
auto visibleRect = LayerIntRect::FromUnknownRect(
ScaleToOutsidePixelsOffset(
aItem->GetBuildingRect(), scale.width,
scale.height, appUnitsPerDevPixel, residualOffset))
.Intersect(dtRect);
// visibleRect is relative to the blob origin so adjust for that
visibleRect -= dtRect.TopLeft();
if (dtSize.IsEmpty()) {
return nullptr;
}
@ -2142,6 +2158,10 @@ WebRenderCommandBuilder::GenerateFallbackData(
return nullptr;
}
}
aResources.SetBlobImageVisibleArea(
fallbackData->GetBlobImageKey().value(),
ViewAs<ImagePixel>(visibleRect,
PixelCastJustification::LayerIsImage));
} else {
fallbackData->CreateImageClientIfNeeded();
RefPtr<ImageClient> imageClient = fallbackData->GetImageClient();

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

@ -159,7 +159,7 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
for var in ('UNICODE', '_UNICODE', 'NS_NO_XPCOM',
'_CRT_RAND_S', 'CHROMIUM_SANDBOX_BUILD'):
DEFINES[var] = True
if CONFIG['CC_TYPE'] != 'gcc':
if CONFIG['CC_TYPE'] not in ('gcc', 'clang'):
DEFINES['SANDBOX_EXPORTS'] = True
LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']