Merge mozilla-central to mozilla-inbound. CLOSED TREE

--HG--
extra : rebase_source : 64e179a2919be3598bf7e50ccd54eb7d2762b5d8
This commit is contained in:
Csoregi Natalia 2019-01-25 12:13:24 +02:00
commit 9a5ceab720
22 changed files with 196 additions and 40 deletions

View File

@ -160,7 +160,6 @@ skip-if = !e10s || !crashreporter # the tab's process is killed during the test.
[browser_ext_sessions_forgetClosedTab.js]
[browser_ext_sessions_forgetClosedWindow.js]
[browser_ext_sessions_getRecentlyClosed.js]
skip-if = (debug && os == 'linux') # Bug 1377641
[browser_ext_sessions_getRecentlyClosed_private.js]
[browser_ext_sessions_getRecentlyClosed_tabs.js]
[browser_ext_sessions_restore.js]

View File

@ -7,11 +7,11 @@
#include "DOMSVGPoint.h"
#include "DOMSVGPointList.h"
#include "SVGPoint.h"
#include "gfx2DGlue.h"
#include "SVGElement.h"
#include "nsCOMPtr.h"
#include "nsError.h"
#include "SVGPoint.h"
#include "mozilla/dom/SVGElement.h"
#include "mozilla/dom/SVGMatrix.h"
// See the architecture comment in DOMSVGPointList.h.

View File

@ -6,16 +6,16 @@
#include "SVGGeometryElement.h"
#include "nsCOMPtr.h"
#include "DOMSVGPoint.h"
#include "gfxPlatform.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/dom/SVGLengthBinding.h"
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h"
#include "nsComputedDOMStyle.h"
#include "nsSVGUtils.h"
#include "nsSVGLength2.h"
#include "SVGContentUtils.h"
#include "nsSVGUtils.h"
#include "mozilla/dom/SVGLengthBinding.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "mozilla/SVGContentUtils.h"
using namespace mozilla;
using namespace mozilla::gfx;

View File

@ -12,15 +12,15 @@
#include "DOMSVGPathSegList.h"
#include "gfx2DGlue.h"
#include "gfxPlatform.h"
#include "mozilla/dom/SVGPathElementBinding.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsComputedDOMStyle.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsStyleStruct.h"
#include "nsWindowSizes.h"
#include "SVGContentUtils.h"
#include "mozilla/dom/SVGPathElementBinding.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "mozilla/SVGContentUtils.h"
NS_IMPL_NS_NEW_SVG_ELEMENT(Path)

View File

@ -0,0 +1,44 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=200, minimum-scale=1.0, initial-scale=2.0">
<title>Tests that the layout viewport is expanted to the minimum scale size (minimim-scale >= 1.0)</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
<style>
html,body {
overflow-x: hidden;
margin: 0;
}
div {
position: absolute;
}
</style>
</head>
<body>
<div style="width: 200%; height: 200%; background-color: green"></div>
<div style="width: 100%; height: 100%; background-color: blue"></div>
<script type="application/javascript">
async function test(testDriver) {
SpecialPowers.getDOMWindowUtils(window).scrollToVisual(100, 0);
const promiseForVisualViewportScroll = new Promise(resolve => {
window.visualViewport.addEventListener("scroll", () => {
resolve();
}, { once: true });
});
await waitUntilApzStable();
await promiseForVisualViewportScroll;
is(visualViewport.offsetLeft, 100,
"The visual viewport offset should be moved");
}
waitUntilApzStable().then(test).then(subtestDone);
</script>
</body>
</html>

View File

@ -18,6 +18,8 @@
[test_frame_reconstruction.html]
[test_fullscreen.html]
run-if = (os == 'android')
[test_group_minimum_scale_size.html]
run-if = (os == 'android')
[test_group_mouseevents.html]
skip-if = (toolkit == 'android') # mouse events not supported on mobile
[test_group_pointerevents.html]

View File

@ -0,0 +1,62 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="apz_test_utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
const prefs = [
// We need the APZ paint logging information
["apz.test.logging_enabled", true],
// Dropping the touch slop to 0 makes the tests easier to write because
// we can just do a one-pixel drag to get over the pan threshold rather
// than having to hard-code some larger value.
["apz.touch_start_tolerance", "0.0"],
// The subtests in this test do touch-drags to pan the page, but we don't
// want those pans to turn into fling animations, so we increase the
// fling-min threshold velocity to an arbitrarily large value.
["apz.fling_min_velocity_threshold", "10000"],
// The helper_bug1280013's div gets a displayport on scroll, but if the
// test takes too long the displayport can expire before we read the value
// out of the test. So we disable displayport expiry for these tests.
["apz.displayport_expiry_ms", 0],
// Prevent the dynamic toolbar from interfering with main-thread scroll
// offset values.
["browser.chrome.dynamictoolbar", false],
// Explicitly enable pinch-zooming, so this test can run on desktop
// even though zooming isn't enabled by default on desktop yet.
["apz.allow_zooming", true],
// Pinch-zooming currently requires meta viewport support (this requirement
// will eventually be removed).
["dom.meta-viewport.enabled", true],
// Pinch-zooming currently requires container scrolling (this requirement
// will eventually be removed).
["layout.scroll.root-frame-containers", 1],
// Retained displaylists don't work well with container scrolling, so
// they too need to be disabled for now.
["layout.display-list.retain", false],
["layout.display-list.retain.chrome", false],
// We use the Visual Viewport API to tell the visual viewport offset.
["dom.visualviewport.enabled", true],
];
const subtests = [
{ file: "helper_minimum_scale_1_0.html", prefs },
];
if (isApzEnabled()) {
SimpleTest.waitForExplicitFinish();
// Run the actual test in its own window, because it requires that the
// root APZC be scrollable. Mochitest pages themselves often run
// inside an iframe which means we have no control over the root APZC.
window.onload = () => {
runSubtestsSeriallyInFreshWindows(subtests)
.then(SimpleTest.finish, SimpleTest.finish);
};
}
</script>
</head>
<body>
</body>
</html>

View File

@ -1688,13 +1688,8 @@ void WebRenderBridgeParent::CompositeToTarget(VsyncId aId,
if (mSkippedComposite ||
wr::RenderThread::Get()->TooManyPendingFrames(mApi->GetId())) {
// Render thread is busy, try next time.
if (!mSkippedComposite) {
// Only record the vsync id for the first skipped composite,
// since this matches what we do for compressing messages
// in CompositorVsyncScheduler::PostCompositeTask.
mSkippedComposite = true;
mSkippedCompositeId = aId;
}
mSkippedComposite = true;
mSkippedCompositeId = aId;
mPreviousFrameTimeStamp = TimeStamp();
// Record that we skipped presenting a frame for

View File

@ -21,7 +21,7 @@ use hit_test::{HitTestingItem, HitTestingRun};
use image::simplify_repeated_primitive;
use intern::{Handle, Internable, InternDebug};
use internal_types::{FastHashMap, FastHashSet};
use picture::{Picture3DContext, PictureCompositeMode, PicturePrimitive, PrimitiveList, TileCache};
use picture::{Picture3DContext, PictureCompositeMode, PicturePrimitive, PictureOptions, PrimitiveList, TileCache};
use prim_store::{PrimitiveInstance, PrimitiveKeyKind, PrimitiveSceneData};
use prim_store::{PrimitiveInstanceKind, NinePatchDescriptor, PrimitiveStore};
use prim_store::{PrimitiveStoreStats, ScrollNodeAndClipChain, PictureIndex};
@ -392,6 +392,7 @@ impl<'a> DisplayListFlattener<'a> {
LayoutRect::max_rect(),
&self.clip_store,
Some(tile_cache),
PictureOptions::default(),
));
let instance = PrimitiveInstance::new(
@ -1367,6 +1368,7 @@ impl<'a> DisplayListFlattener<'a> {
max_clip,
&self.clip_store,
None,
PictureOptions::default(),
))
);
@ -1414,6 +1416,7 @@ impl<'a> DisplayListFlattener<'a> {
max_clip,
&self.clip_store,
None,
PictureOptions::default(),
))
);
@ -1449,6 +1452,7 @@ impl<'a> DisplayListFlattener<'a> {
max_clip,
&self.clip_store,
None,
PictureOptions::default(),
))
);
@ -1492,6 +1496,7 @@ impl<'a> DisplayListFlattener<'a> {
max_clip,
&self.clip_store,
None,
PictureOptions::default(),
))
);
@ -1810,6 +1815,12 @@ impl<'a> DisplayListFlattener<'a> {
let composite_mode = PictureCompositeMode::Filter(blur_filter);
let composite_mode_key = Some(composite_mode).into();
// Pass through configuration information about whether WR should
// do the bounding rect inflation for text shadows.
let options = PictureOptions {
inflate_if_required: pending_shadow.shadow.should_inflate,
};
// Create the primitive to draw the shadow picture into the scene.
let shadow_pic_index = PictureIndex(self.prim_store.pictures
.alloc()
@ -1828,6 +1839,7 @@ impl<'a> DisplayListFlattener<'a> {
max_clip,
&self.clip_store,
None,
options,
))
);
@ -2600,6 +2612,7 @@ impl FlattenedStackingContext {
LayoutRect::max_rect(),
clip_store,
None,
PictureOptions::default(),
))
);

View File

@ -1909,6 +1909,21 @@ impl PrimitiveList {
}
}
/// Defines configuration options for a given picture primitive.
pub struct PictureOptions {
/// If true, WR should inflate the bounding rect of primitives when
/// using a filter effect that requires inflation.
pub inflate_if_required: bool,
}
impl Default for PictureOptions {
fn default() -> Self {
PictureOptions {
inflate_if_required: true,
}
}
}
pub struct PicturePrimitive {
/// List of primitives, and associated info for this picture.
pub prim_list: PrimitiveList,
@ -1966,6 +1981,9 @@ pub struct PicturePrimitive {
/// If Some(..) the tile cache that is associated with this picture.
pub tile_cache: Option<TileCache>,
/// The config options for this picture.
options: PictureOptions,
}
impl PicturePrimitive {
@ -2041,6 +2059,10 @@ impl PicturePrimitive {
}
}
// TODO(gw): We have the PictureOptions struct available. We
// should move some of the parameter list in this
// method to be part of the PictureOptions, and
// avoid adding new parameters here.
pub fn new_image(
requested_composite_mode: Option<PictureCompositeMode>,
context_3d: Picture3DContext<OrderedPictureChild>,
@ -2053,6 +2075,7 @@ impl PicturePrimitive {
local_clip_rect: LayoutRect,
clip_store: &ClipStore,
tile_cache: Option<TileCache>,
options: PictureOptions,
) -> Self {
// For now, only create a cache descriptor for blur filters (which
// includes text shadows). We can incrementally expand this to
@ -2094,6 +2117,7 @@ impl PicturePrimitive {
local_clip_rect,
gpu_location: GpuCacheHandle::new(),
tile_cache,
options,
}
}
@ -2399,9 +2423,15 @@ impl PicturePrimitive {
let inflation_factor = match composite_mode {
PictureCompositeMode::Filter(FilterOp::Blur(blur_radius)) => {
// The amount of extra space needed for primitives inside
// this picture to ensure the visibility check is correct.
BLUR_SAMPLE_SCALE * blur_radius
// Only inflate if the caller hasn't already inflated
// the bounding rects for this filter.
if self.options.inflate_if_required {
// The amount of extra space needed for primitives inside
// this picture to ensure the visibility check is correct.
BLUR_SAMPLE_SCALE * blur_radius
} else {
0.0
}
}
_ => {
0.0
@ -2535,7 +2565,9 @@ impl PicturePrimitive {
// Inflate the local bounding rect if required by the filter effect.
let inflation_size = match self.raster_config {
Some(RasterConfig { composite_mode: PictureCompositeMode::Filter(FilterOp::Blur(blur_radius)), .. }) |
Some(RasterConfig { surface_index, composite_mode: PictureCompositeMode::Filter(FilterOp::Blur(_)), .. }) => {
Some(state.surfaces[surface_index.0].inflation_factor)
}
Some(RasterConfig { composite_mode: PictureCompositeMode::Filter(FilterOp::DropShadow(_, blur_radius, _)), .. }) => {
Some((blur_radius * BLUR_SAMPLE_SCALE).ceil())
}
@ -2670,7 +2702,8 @@ impl PicturePrimitive {
}
PictureCompositeMode::Filter(FilterOp::Blur(blur_radius)) => {
let blur_std_deviation = blur_radius * frame_context.device_pixel_scale.0;
let blur_range = (blur_std_deviation * BLUR_SAMPLE_SCALE).ceil() as i32;
let inflation_factor = surfaces[raster_config.surface_index.0].inflation_factor;
let inflation_factor = (inflation_factor * frame_context.device_pixel_scale.0).ceil() as i32;
// The clipped field is the part of the picture that is visible
// on screen. The unclipped field is the screen-space rect of
@ -2681,7 +2714,7 @@ impl PicturePrimitive {
// then intersect with the total screen rect, to minimize the
// allocation size.
let device_rect = clipped
.inflate(blur_range, blur_range)
.inflate(inflation_factor, inflation_factor)
.intersection(&unclipped.to_i32())
.unwrap();

View File

@ -461,6 +461,7 @@ pub struct Shadow {
pub offset: LayoutVector2D,
pub color: ColorF,
pub blur_radius: f32,
pub should_inflate: bool,
}
#[repr(u8)]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -839,6 +839,7 @@ impl<'a> RawtestHarness<'a> {
offset: LayoutVector2D::new(1.0, 1.0),
blur_radius: 1.0,
color: ColorF::new(0.0, 0.0, 0.0, 1.0),
should_inflate: true,
},
);
builder.push_line(
@ -910,6 +911,7 @@ impl<'a> RawtestHarness<'a> {
offset: LayoutVector2D::new(1.0, 1.0),
blur_radius: 1.0,
color: shadow_color,
should_inflate: true,
},
);
builder.push_line(

View File

@ -1582,6 +1582,7 @@ impl YamlFrameReader {
blur_radius,
offset,
color,
should_inflate: true,
},
);
}

View File

@ -5941,6 +5941,10 @@ void nsLayoutUtils::DrawUniDirString(const char16_t* aString, uint32_t aLength,
if (auto* textDrawer = aContext->GetTextDrawer()) {
wr::Shadow wrShadow;
// Gecko already inflates the bounding rect of text shadows,
// so tell WR not to inflate again.
wrShadow.should_inflate = false;
wrShadow.offset = {
presCtx->AppUnitsToFloatDevPixels(shadowDetails->mXOffset),
presCtx->AppUnitsToFloatDevPixels(shadowDetails->mYOffset)};

View File

@ -5511,13 +5511,6 @@ void ScrollFrameHelper::UpdateMinimumScaleSize(
}
nsViewportInfo viewportInfo = doc->GetViewportInfo(displaySize);
// FIXME: Bug 1520081 - Drop this check. We should use the minimum-scale size
// even if the minimum-scale size is greater than 1.0.
if (viewportInfo.GetMinZoom() >=
pc->CSSToDevPixelScale() * LayoutDeviceToScreenScale(1.0f)) {
return;
}
nsSize maximumPossibleSize =
CSSSize::ToAppUnits(ScreenSize(displaySize) / viewportInfo.GetMinZoom());

View File

@ -6129,6 +6129,10 @@ void nsTextFrame::PaintOneShadow(const PaintShadowParams& aParams,
if (auto* textDrawer = aParams.context->GetTextDrawer()) {
wr::Shadow wrShadow;
// Gecko already inflates the bounding rect of text shadows,
// so tell WR not to inflate again.
wrShadow.should_inflate = false;
wrShadow.offset = {
PresContext()->AppUnitsToFloatDevPixels(aShadowDetails->mXOffset),
PresContext()->AppUnitsToFloatDevPixels(aShadowDetails->mYOffset)};

View File

@ -14,7 +14,7 @@ fuzzy-if(webrender,0-3,0-825) == quirks-decorations.html quirks-decorations-ref.
== standards-decorations.html standards-decorations-ref.html
== standards-line-height.html standards-line-height-ref.html
fuzzy-if(skiaContent,0-1,0-4200) fuzzy-if(webrender,0-47,0-6) == selection.html selection-ref.html
fuzzy-if(webrender,0-5,0-509) == marker-shadow.html marker-shadow-ref.html
fuzzy-if(webrender,0-8,0-509) == marker-shadow.html marker-shadow-ref.html
fuzzy-if(webrender,0-3,0-25) == aligned-baseline.html aligned-baseline-ref.html
skip-if(Android) fuzzy-if(skiaContent,0-1,0-5) == clipped-elements.html clipped-elements-ref.html
== theme-overflow.html theme-overflow-ref.html

View File

@ -21,7 +21,11 @@ AddonTestUtils.init(this);
// Allow for unsigned addons.
AddonTestUtils.overrideCertDB();
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "42", "42");
// Ensure that the background page is automatically started after using
// promiseStartupManager.
Services.prefs.setBoolPref("extensions.webextensions.background-delayed-startup", false);
function background() {
let onInstalledDetails = null;
@ -169,7 +173,7 @@ add_task(async function test_should_fire_on_addon_update() {
add_task(async function test_should_fire_on_browser_update() {
const EXTENSION_ID = "test_runtime_on_installed_browser_update@tests.mozilla.org";
await promiseStartupManager();
await promiseStartupManager("1");
let extension = ExtensionTestUtils.loadExtension({
useAddonManager: "permanent",
@ -193,8 +197,8 @@ add_task(async function test_should_fire_on_browser_update() {
onInstalledReason: "install",
});
// Restart the browser.
await promiseRestartManager("1");
await extension.awaitStartup();
await expectEvents(extension, {

View File

@ -93,7 +93,6 @@ skip-if = os == "android" && debug
[test_ext_runtime_getPlatformInfo.js]
[test_ext_runtime_id.js]
[test_ext_runtime_onInstalled_and_onStartup.js]
skip-if = true # bug 1315829
[test_ext_runtime_sendMessage.js]
[test_ext_runtime_sendMessage_errors.js]
[test_ext_runtime_sendMessage_no_receiver.js]

View File

@ -802,7 +802,7 @@ var AddonTestUtils = {
// Wait for all add-ons to finish starting up before resolving.
const {XPIProvider} = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm", null);
await Promise.all(Array.from(XPIProvider.activeAddons,
await Promise.all(Array.from(XPIProvider.activeAddons.values(),
addon => addon.startupPromise));
},