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

This commit is contained in:
shindli 2019-02-26 12:20:22 +02:00
commit c780ef516c
22 changed files with 391 additions and 109 deletions

View File

@ -502,10 +502,10 @@
background-repeat: repeat-x; background-repeat: repeat-x;
} }
/* Add a translucent color (current text color at .2 alpha) on top of multiselected tabs */ /* Add a translucent color on top of multiselected tabs */
.tab-background[multiselected=true]:not([selected=true]) > .tab-background-inner { .tab-background[multiselected=true]:not([selected=true]) > .tab-background-inner {
background: currentColor; background: currentColor;
opacity: .2; opacity: .1;
} }
.tab-line[multiselected], .tab-line[multiselected],

View File

@ -0,0 +1,67 @@
# Running Tests with real USB connected devices for the new about:debugging
This document explains how to test with real USB connected devices.
## Tests overview
The tests that use a real device are located in `devtools/client/aboutdebugging-new/test/browser/`and the name of tests starts with `browser_aboutdebugging_real`. These are normal mochitest, but we need to setup the environment before starting tests.
## Setup environment
### Real device side
1. Enable USB debugging on your device
2. Launch Firefox
3. Enable USB debugging on your Firefox
4. Connect to your PC via USB
You can refer to https://developer.mozilla.org/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE#Setting_up_the_Android_device.
### PC side
Setup the real device information to evaluate the validity in tests.
1. Copy a sample file which is located at `devtools/client/aboutdebugging-new/test/browser/real/usb-runtimes-sample.json` and rename it for example to `devtools/client/aboutdebugging-new/test/browser/real/local-usb-runtimes.json`.
2. Edit the file.
This is a JSON file like below, write your real device information in here. This example indicates that there should be one USB device and should be displayed `Pixel 2` as device name and `Firefox Nightly` as short name on the sidebar of about:debugging. Regarding the other information, please see `Detail of config file` section of this document.
```
[
{
"sidebarInfo": {
"deviceName": "Pixel 2",
"shortName": "Firefox Nightly"
},
...
},
...
]
```
## Test
Normally, although we do test `./mach mochitest <path>`, to load the real device information created, specify the path as `USB_RUNTIME` environment variable, then do test.
For example, if the name of the saved file is `devtools/client/aboutdebugging-new/test/browser/real/local-usb-runtimes.json`, run all real device test with a command like the one below:
```
USB_RUNTIMES=devtools/client/aboutdebugging-new/test/browser/real/local-usb-runtimes.json ./mach mochitest devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_real
```
If there is no `USB_RUNTIMES` environment variable, the tests will not run. This is also to avoid to run on try-server and so on.
## Detail of config file
```
[
{
"sidebarInfo": {
"deviceName": "Pixel 2", // This should display as device name on the sidebar.
"shortName": "Firefox Nightly" // This should display as short name on the sidebar.
},
"runtimeDetails": {
"info": {
"name": "Mozilla Nightly", // This should display on the runtime info of runtime page.
"version": "64.0a1" // This should display on the runtime info of runtime page.
}
}
}
// Of course, you can append additional USB devices. Some tests can do with multiple devices.
]
```

View File

@ -11,6 +11,7 @@ support-files =
helper-addons.js helper-addons.js
helper-collapsibilities.js helper-collapsibilities.js
helper-mocks.js helper-mocks.js
helper-real-usb.js
helper-serviceworker.js helper-serviceworker.js
helper-telemetry.js helper-telemetry.js
mocks/* mocks/*
@ -62,6 +63,8 @@ skip-if = (os == "win" && ccov) # Bug 1521349
[browser_aboutdebugging_navigate.js] [browser_aboutdebugging_navigate.js]
[browser_aboutdebugging_persist_connection.js] [browser_aboutdebugging_persist_connection.js]
[browser_aboutdebugging_profiler_dialog.js] [browser_aboutdebugging_profiler_dialog.js]
[browser_aboutdebugging_real_usb_runtime_page_runtime_info.js]
[browser_aboutdebugging_real_usb_sidebar.js]
[browser_aboutdebugging_routes.js] [browser_aboutdebugging_routes.js]
[browser_aboutdebugging_runtime_compatibility_warning.js] [browser_aboutdebugging_runtime_compatibility_warning.js]
[browser_aboutdebugging_runtime_remote_runtime_buttons.js] [browser_aboutdebugging_runtime_remote_runtime_buttons.js]

View File

@ -0,0 +1,47 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from helper-real-usb.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-real-usb.js", this);
// Test that runtime info of USB runtime appears on main pane.
// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md
add_task(async function() {
if (!isAvailable()) {
ok(true, "Real usb runtime test is not available");
return;
}
const { document, tab } = await openAboutDebuggingWithADB();
const expectedRuntime = await getExpectedRuntime();
const { runtimeDetails, sidebarInfo } = expectedRuntime;
info("Connect a USB runtime");
await Promise.race([
connectToRuntime(sidebarInfo.deviceName, document),
/* eslint-disable mozilla/no-arbitrary-setTimeout */
new Promise(resolve => setTimeout(() => {
ok(false,
"Failed to connect, did you disable the connection prompt for this runtime?");
resolve();
}, 5000)),
/* eslint-enable mozilla/no-arbitrary-setTimeout */
]);
info("Select a USB runtime");
await selectRuntime(sidebarInfo.deviceName, runtimeDetails.info.name, document);
info("Check that runtime info is properly displayed");
const runtimeInfo = document.querySelector(".js-runtime-info");
ok(runtimeInfo, "Runtime info is displayed");
const runtimeInfoText = runtimeInfo.textContent;
ok(runtimeInfoText.includes(runtimeDetails.info.name),
"Runtime info shows the correct runtime name: " + runtimeInfoText);
ok(runtimeInfoText.includes(runtimeDetails.info.version),
"Runtime info shows the correct version number: " + runtimeInfoText);
await removeTab(tab);
});

View File

@ -0,0 +1,29 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from helper-real-usb.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-real-usb.js", this);
// Test that USB runtimes appear from the sidebar.
// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md
add_task(async function() {
if (!isAvailable()) {
ok(true, "Real usb runtime test is not available");
return;
}
const { document, tab } = await openAboutDebuggingWithADB();
for (const { sidebarInfo } of await getExpectedRuntimeAll()) {
const { deviceName, shortName } = sidebarInfo;
await waitUntil(() => findSidebarItemByText(deviceName, document));
const usbRuntimeSidebarItem = findSidebarItemByText(deviceName, document);
ok(usbRuntimeSidebarItem.textContent.includes(shortName),
"The device name and short name of the usb runtime are visible in sidebar item " +
`[${usbRuntimeSidebarItem.textContent}]`);
}
await removeTab(tab);
});

View File

@ -0,0 +1,51 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from helper-adb.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this);
async function getExpectedRuntime() {
const runtimes = await getExpectedRuntimeAll();
return runtimes[0];
}
/* exported getExpectedRuntime */
async function getExpectedRuntimeAll() {
const runtimesPath = _getExpectedRuntimesPath();
const currentPath = env.get("PWD");
const path = `${currentPath}/${runtimesPath}`;
info(`Load ${ path }`);
const buffer = await OS.File.read(path);
const data = new TextDecoder().decode(buffer);
return JSON.parse(data);
}
/* exported getExpectedRuntimeAll */
function isAvailable() {
return !!_getExpectedRuntimesPath();
}
/* exported isAvailable */
async function openAboutDebuggingWithADB() {
const { document, tab, window } = await openAboutDebugging();
await pushPref("devtools.remote.adb.extensionURL",
CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi");
await checkAdbNotRunning();
const { adbAddon } = require("devtools/shared/adb/adb-addon");
adbAddon.install("internal");
const usbStatusElement = document.querySelector(".js-sidebar-usb-status");
await waitUntil(() => usbStatusElement.textContent.includes("USB devices enabled"));
await waitForAdbStart();
return { document, tab, window };
}
/* exported openAboutDebuggingWithADB */
function _getExpectedRuntimesPath() {
const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
return env.get("USB_RUNTIMES");
}

View File

@ -0,0 +1,14 @@
[
{
"sidebarInfo": {
"deviceName": "Pixel 2",
"shortName": "Firefox Nightly"
},
"runtimeDetails": {
"info": {
"name": "Mozilla Nightly",
"version": "64.0a1"
}
}
}
]

View File

@ -9,6 +9,6 @@ self.addEventListener("activate", event => {
}); });
self.addEventListener("fetch", event => { self.addEventListener("fetch", event => {
const response = new Response("Service worker response"); const response = new Response("Service worker response", { statusText: "OK" });
event.respondWith(response); event.respondWith(response);
}); });

View File

@ -473,6 +473,8 @@ static RefPtr<const webgl::LinkedProgramInfo> QueryProgramInfo(
{ {
const auto& fragShader = prog->FragShader(); const auto& fragShader = prog->FragShader();
MOZ_RELEASE_ASSERT(fragShader);
MOZ_RELEASE_ASSERT(fragShader->Validator());
const auto& handle = fragShader->Validator()->Handle(); const auto& handle = fragShader->Validator()->Handle();
const auto version = sh::GetShaderVersion(handle); const auto version = sh::GetShaderVersion(handle);

View File

@ -213,6 +213,7 @@ namespace webgl {
const ShBuiltInResources& resources, ShCompileOptions compileOptions) { const ShBuiltInResources& resources, ShCompileOptions compileOptions) {
ShHandle handle = ShHandle handle =
sh::ConstructCompiler(shaderType, spec, outputLanguage, &resources); sh::ConstructCompiler(shaderType, spec, outputLanguage, &resources);
MOZ_RELEASE_ASSERT(handle);
if (!handle) return nullptr; if (!handle) return nullptr;
return new ShaderValidator(handle, compileOptions, return new ShaderValidator(handle, compileOptions,

View File

@ -4,7 +4,7 @@ function testDefaultCtor() {
ok(res.headers instanceof Headers, "Response should have non-null Headers object"); ok(res.headers instanceof Headers, "Response should have non-null Headers object");
is(res.url, "", "URL should be empty string"); is(res.url, "", "URL should be empty string");
is(res.status, 200, "Default status is 200"); is(res.status, 200, "Default status is 200");
is(res.statusText, "OK", "Default statusText is OK"); is(res.statusText, "", "Default statusText is an empty string");
} }
function testClone() { function testClone() {

View File

@ -44,7 +44,7 @@ partial interface Response {
dictionary ResponseInit { dictionary ResponseInit {
unsigned short status = 200; unsigned short status = 200;
ByteString statusText = "OK"; ByteString statusText = "";
HeadersInit headers; HeadersInit headers;
}; };

View File

@ -5,7 +5,7 @@
use api::{BorderRadius, BorderSide, BorderStyle, ColorF, ColorU, DeviceRect, DeviceSize}; use api::{BorderRadius, BorderSide, BorderStyle, ColorF, ColorU, DeviceRect, DeviceSize};
use api::{LayoutSideOffsets, LayoutSizeAu, LayoutPrimitiveInfo, LayoutToDeviceScale}; use api::{LayoutSideOffsets, LayoutSizeAu, LayoutPrimitiveInfo, LayoutToDeviceScale};
use api::{DeviceVector2D, DevicePoint, LayoutRect, LayoutSize, DeviceIntSize}; use api::{DeviceVector2D, DevicePoint, LayoutRect, LayoutSize, DeviceIntSize};
use api::{AuHelpers, LayoutPoint, LayoutPointAu, RepeatMode, TexelRect, LayoutVector2D}; use api::{AuHelpers, LayoutPoint, LayoutPointAu, RepeatMode, TexelRect};
use api::NormalBorder as ApiNormalBorder; use api::NormalBorder as ApiNormalBorder;
use ellipse::Ellipse; use ellipse::Ellipse;
use euclid::vec2; use euclid::vec2;
@ -216,7 +216,6 @@ impl<'a> DisplayListFlattener<'a> {
border: &ApiNormalBorder, border: &ApiNormalBorder,
widths: LayoutSideOffsets, widths: LayoutSideOffsets,
clip_and_scroll: ScrollNodeAndClipChain, clip_and_scroll: ScrollNodeAndClipChain,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
let mut border = *border; let mut border = *border;
ensure_no_corner_overlap(&mut border.radius, info.rect.size); ensure_no_corner_overlap(&mut border.radius, info.rect.size);
@ -229,7 +228,6 @@ impl<'a> DisplayListFlattener<'a> {
border: border.into(), border: border.into(),
widths: widths.to_au(), widths: widths.to_au(),
}, },
reference_frame_relative_offset,
); );
} }
} }

View File

@ -77,7 +77,6 @@ impl<'a> DisplayListFlattener<'a> {
spread_radius: f32, spread_radius: f32,
border_radius: BorderRadius, border_radius: BorderRadius,
clip_mode: BoxShadowClipMode, clip_mode: BoxShadowClipMode,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
if color.a == 0.0 { if color.a == 0.0 {
return; return;
@ -167,7 +166,6 @@ impl<'a> DisplayListFlattener<'a> {
PrimitiveKeyKind::Rectangle { PrimitiveKeyKind::Rectangle {
color: color.into(), color: color.into(),
}, },
reference_frame_relative_offset,
); );
} else { } else {
// Normal path for box-shadows with a valid blur radius. // Normal path for box-shadows with a valid blur radius.
@ -257,7 +255,6 @@ impl<'a> DisplayListFlattener<'a> {
&prim_info, &prim_info,
extra_clips, extra_clips,
prim, prim,
reference_frame_relative_offset,
); );
} }
} }

View File

@ -60,6 +60,78 @@ impl ClipNode {
} }
} }
/// The offset stack for a given reference frame.
struct ReferenceFrameState {
/// A stack of current offsets from the current reference frame scope.
offsets: Vec<LayoutVector2D>,
}
/// Maps from stacking context layout coordinates into reference frame
/// relative coordinates.
struct ReferenceFrameMapper {
/// A stack of reference frame scopes.
frames: Vec<ReferenceFrameState>,
}
impl ReferenceFrameMapper {
fn new() -> Self {
ReferenceFrameMapper {
frames: vec![
ReferenceFrameState {
offsets: vec![
LayoutVector2D::zero(),
],
}
],
}
}
/// Push a new scope. This resets the current offset to zero, and is
/// used when a new reference frame or iframe is pushed.
fn push_scope(&mut self) {
self.frames.push(ReferenceFrameState {
offsets: vec![
LayoutVector2D::zero(),
],
});
}
/// Pop a reference frame scope off the stack.
fn pop_scope(&mut self) {
self.frames.pop().unwrap();
}
/// Push a new offset for the current scope. This is used when
/// a new stacking context is pushed.
fn push_offset(&mut self, offset: LayoutVector2D) {
let frame = self.frames.last_mut().unwrap();
let current_offset = *frame.offsets.last().unwrap();
frame.offsets.push(current_offset + offset);
}
/// Pop a local stacking context offset from the current scope.
fn pop_offset(&mut self) {
let frame = self.frames.last_mut().unwrap();
frame.offsets.pop().unwrap();
}
/// Retrieve the current offset to allow converting a stacking context
/// relative coordinate to be relative to the owing reference frame.
/// TODO(gw): We could perhaps have separate coordinate spaces for this,
/// however that's going to either mean a lot of changes to
/// public API code, or a lot of changes to internal code.
/// Before doing that, we should revisit how Gecko would
/// prefer to provide coordinates.
/// TODO(gw): For now, this includes only the reference frame relative
/// offset. Soon, we will expand this to include the initial
/// scroll offsets that are now available on scroll nodes. This
/// will allow normalizing the coordinates even between display
/// lists where APZ has scrolled the content.
fn current_offset(&self) -> LayoutVector2D {
*self.frames.last().unwrap().offsets.last().unwrap()
}
}
/// A data structure that keeps track of mapping between API Ids for clips/spatials and the indices /// A data structure that keeps track of mapping between API Ids for clips/spatials and the indices
/// used internally in the ClipScrollTree to avoid having to do HashMap lookups. NodeIdToIndexMapper /// used internally in the ClipScrollTree to avoid having to do HashMap lookups. NodeIdToIndexMapper
/// is responsible for mapping both ClipId to ClipChainIndex and SpatialId to SpatialNodeIndex. /// is responsible for mapping both ClipId to ClipChainIndex and SpatialId to SpatialNodeIndex.
@ -147,6 +219,9 @@ pub struct DisplayListFlattener<'a> {
/// The root picture index for this flattener. This is the picture /// The root picture index for this flattener. This is the picture
/// to start the culling phase from. /// to start the culling phase from.
pub root_pic_index: PictureIndex, pub root_pic_index: PictureIndex,
/// Helper struct to map stacking context coords <-> reference frame coords.
rf_mapper: ReferenceFrameMapper,
} }
impl<'a> DisplayListFlattener<'a> { impl<'a> DisplayListFlattener<'a> {
@ -184,6 +259,7 @@ impl<'a> DisplayListFlattener<'a> {
clip_store: ClipStore::new(), clip_store: ClipStore::new(),
interners, interners,
root_pic_index: PictureIndex(0), root_pic_index: PictureIndex(0),
rf_mapper: ReferenceFrameMapper::new(),
}; };
flattener.push_root( flattener.push_root(
@ -217,7 +293,6 @@ impl<'a> DisplayListFlattener<'a> {
flattener.flatten_items( flattener.flatten_items(
&mut root_pipeline.display_list.iter(), &mut root_pipeline.display_list.iter(),
root_pipeline.pipeline_id, root_pipeline.pipeline_id,
LayoutVector2D::zero(),
true, true,
); );
@ -469,7 +544,6 @@ impl<'a> DisplayListFlattener<'a> {
&mut self, &mut self,
traversal: &mut BuiltDisplayListIter<'a>, traversal: &mut BuiltDisplayListIter<'a>,
pipeline_id: PipelineId, pipeline_id: PipelineId,
reference_frame_relative_offset: LayoutVector2D,
apply_pipeline_clip: bool, apply_pipeline_clip: bool,
) { ) {
loop { loop {
@ -488,7 +562,6 @@ impl<'a> DisplayListFlattener<'a> {
self.flatten_item( self.flatten_item(
item, item,
pipeline_id, pipeline_id,
reference_frame_relative_offset,
apply_pipeline_clip, apply_pipeline_clip,
) )
}; };
@ -506,9 +579,9 @@ impl<'a> DisplayListFlattener<'a> {
item: &DisplayItemRef, item: &DisplayItemRef,
info: &StickyFrameDisplayItem, info: &StickyFrameDisplayItem,
parent_node_index: SpatialNodeIndex, parent_node_index: SpatialNodeIndex,
reference_frame_relative_offset: &LayoutVector2D,
) { ) {
let frame_rect = item.rect().translate(reference_frame_relative_offset); let current_offset = self.rf_mapper.current_offset();
let frame_rect = item.rect().translate(&current_offset);
let sticky_frame_info = StickyFrameInfo::new( let sticky_frame_info = StickyFrameInfo::new(
frame_rect, frame_rect,
info.margins, info.margins,
@ -531,14 +604,14 @@ impl<'a> DisplayListFlattener<'a> {
info: &ScrollFrameDisplayItem, info: &ScrollFrameDisplayItem,
parent_node_index: SpatialNodeIndex, parent_node_index: SpatialNodeIndex,
pipeline_id: PipelineId, pipeline_id: PipelineId,
reference_frame_relative_offset: &LayoutVector2D,
) { ) {
let complex_clips = self.get_complex_clips(pipeline_id, item.complex_clip().0); let complex_clips = self.get_complex_clips(pipeline_id, item.complex_clip().0);
let current_offset = self.rf_mapper.current_offset();
let clip_region = ClipRegion::create_for_clip_node( let clip_region = ClipRegion::create_for_clip_node(
*item.clip_rect(), *item.clip_rect(),
complex_clips, complex_clips,
info.image_mask, info.image_mask,
reference_frame_relative_offset, &current_offset,
); );
// Just use clip rectangle as the frame rect for this scroll frame. // Just use clip rectangle as the frame rect for this scroll frame.
// This is useful when calculating scroll extents for the // This is useful when calculating scroll extents for the
@ -568,9 +641,9 @@ impl<'a> DisplayListFlattener<'a> {
parent_spatial_node: SpatialNodeIndex, parent_spatial_node: SpatialNodeIndex,
origin: LayoutPoint, origin: LayoutPoint,
reference_frame: &ReferenceFrame, reference_frame: &ReferenceFrame,
reference_frame_relative_offset: LayoutVector2D,
apply_pipeline_clip: bool, apply_pipeline_clip: bool,
) { ) {
let current_offset = self.rf_mapper.current_offset();
self.push_reference_frame( self.push_reference_frame(
reference_frame.id, reference_frame.id,
Some(parent_spatial_node), Some(parent_spatial_node),
@ -578,10 +651,16 @@ impl<'a> DisplayListFlattener<'a> {
reference_frame.transform_style, reference_frame.transform_style,
reference_frame.transform, reference_frame.transform,
reference_frame.kind, reference_frame.kind,
reference_frame_relative_offset + origin.to_vector(), current_offset + origin.to_vector(),
); );
self.flatten_items(traversal, pipeline_id, LayoutVector2D::zero(), apply_pipeline_clip); self.rf_mapper.push_scope();
self.flatten_items(
traversal,
pipeline_id,
apply_pipeline_clip,
);
self.rf_mapper.pop_scope();
} }
@ -594,7 +673,6 @@ impl<'a> DisplayListFlattener<'a> {
origin: LayoutPoint, origin: LayoutPoint,
filters: ItemRange<FilterOp>, filters: ItemRange<FilterOp>,
filter_datas: &[TempFilterData], filter_datas: &[TempFilterData],
reference_frame_relative_offset: &LayoutVector2D,
is_backface_visible: bool, is_backface_visible: bool,
apply_pipeline_clip: bool, apply_pipeline_clip: bool,
) { ) {
@ -649,12 +727,13 @@ impl<'a> DisplayListFlattener<'a> {
debug_assert!(found_root); debug_assert!(found_root);
} }
self.rf_mapper.push_offset(origin.to_vector());
self.flatten_items( self.flatten_items(
traversal, traversal,
pipeline_id, pipeline_id,
*reference_frame_relative_offset + origin.to_vector(),
apply_pipeline_clip && clip_chain_id == ClipChainId::NONE, apply_pipeline_clip && clip_chain_id == ClipChainId::NONE,
); );
self.rf_mapper.pop_offset();
self.pop_stacking_context(); self.pop_stacking_context();
} }
@ -664,7 +743,6 @@ impl<'a> DisplayListFlattener<'a> {
item: &DisplayItemRef, item: &DisplayItemRef,
info: &IframeDisplayItem, info: &IframeDisplayItem,
spatial_node_index: SpatialNodeIndex, spatial_node_index: SpatialNodeIndex,
reference_frame_relative_offset: &LayoutVector2D,
) { ) {
let iframe_pipeline_id = info.pipeline_id; let iframe_pipeline_id = info.pipeline_id;
let pipeline = match self.scene.pipelines.get(&iframe_pipeline_id) { let pipeline = match self.scene.pipelines.get(&iframe_pipeline_id) {
@ -675,18 +753,19 @@ impl<'a> DisplayListFlattener<'a> {
}, },
}; };
let current_offset = self.rf_mapper.current_offset();
let clip_chain_index = self.add_clip_node( let clip_chain_index = self.add_clip_node(
ClipId::root(iframe_pipeline_id), ClipId::root(iframe_pipeline_id),
item.space_and_clip_info(), item.space_and_clip_info(),
ClipRegion::create_for_clip_node_with_local_clip( ClipRegion::create_for_clip_node_with_local_clip(
item.clip_rect(), item.clip_rect(),
reference_frame_relative_offset, &current_offset,
), ),
); );
self.pipeline_clip_chain_stack.push(clip_chain_index); self.pipeline_clip_chain_stack.push(clip_chain_index);
let bounds = item.rect(); let bounds = item.rect();
let origin = *reference_frame_relative_offset + bounds.origin.to_vector(); let origin = current_offset + bounds.origin.to_vector();
let spatial_node_index = self.push_reference_frame( let spatial_node_index = self.push_reference_frame(
SpatialId::root_reference_frame(iframe_pipeline_id), SpatialId::root_reference_frame(iframe_pipeline_id),
Some(spatial_node_index), Some(spatial_node_index),
@ -709,12 +788,13 @@ impl<'a> DisplayListFlattener<'a> {
ScrollFrameKind::PipelineRoot, ScrollFrameKind::PipelineRoot,
); );
self.rf_mapper.push_scope();
self.flatten_items( self.flatten_items(
&mut pipeline.display_list.iter(), &mut pipeline.display_list.iter(),
pipeline.pipeline_id, pipeline.pipeline_id,
LayoutVector2D::zero(),
true, true,
); );
self.rf_mapper.pop_scope();
self.pipeline_clip_chain_stack.pop(); self.pipeline_clip_chain_stack.pop();
} }
@ -723,7 +803,6 @@ impl<'a> DisplayListFlattener<'a> {
&'b mut self, &'b mut self,
item: DisplayItemRef<'a, 'b>, item: DisplayItemRef<'a, 'b>,
pipeline_id: PipelineId, pipeline_id: PipelineId,
reference_frame_relative_offset: LayoutVector2D,
apply_pipeline_clip: bool, apply_pipeline_clip: bool,
) -> Option<BuiltDisplayListIter<'a>> { ) -> Option<BuiltDisplayListIter<'a>> {
let space_and_clip = item.space_and_clip_info(); let space_and_clip = item.space_and_clip_info();
@ -737,7 +816,9 @@ impl<'a> DisplayListFlattener<'a> {
ClipChainId::INVALID ClipChainId::INVALID
}, },
); );
let prim_info = item.get_layout_primitive_info(&reference_frame_relative_offset); let prim_info = item.get_layout_primitive_info(
&self.rf_mapper.current_offset(),
);
match *item.item() { match *item.item() {
SpecificDisplayItem::Image(ref info) => { SpecificDisplayItem::Image(ref info) => {
@ -751,7 +832,6 @@ impl<'a> DisplayListFlattener<'a> {
info.image_rendering, info.image_rendering,
info.alpha_type, info.alpha_type,
info.color, info.color,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::YuvImage(ref info) => { SpecificDisplayItem::YuvImage(ref info) => {
@ -762,13 +842,11 @@ impl<'a> DisplayListFlattener<'a> {
info.color_depth, info.color_depth,
info.color_space, info.color_space,
info.image_rendering, info.image_rendering,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::Text(ref text_info) => { SpecificDisplayItem::Text(ref text_info) => {
self.add_text( self.add_text(
clip_and_scroll, clip_and_scroll,
reference_frame_relative_offset,
&prim_info, &prim_info,
&text_info.font_key, &text_info.font_key,
&text_info.color, &text_info.color,
@ -782,14 +860,12 @@ impl<'a> DisplayListFlattener<'a> {
clip_and_scroll, clip_and_scroll,
&prim_info, &prim_info,
info.color, info.color,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::ClearRectangle => { SpecificDisplayItem::ClearRectangle => {
self.add_clear_rectangle( self.add_clear_rectangle(
clip_and_scroll, clip_and_scroll,
&prim_info, &prim_info,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::Line(ref info) => { SpecificDisplayItem::Line(ref info) => {
@ -800,7 +876,6 @@ impl<'a> DisplayListFlattener<'a> {
info.orientation, info.orientation,
info.color, info.color,
info.style, info.style,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::Gradient(ref info) => { SpecificDisplayItem::Gradient(ref info) => {
@ -820,7 +895,6 @@ impl<'a> DisplayListFlattener<'a> {
&prim_info, &prim_info,
Vec::new(), Vec::new(),
prim_key_kind, prim_key_kind,
reference_frame_relative_offset,
); );
} }
} }
@ -843,13 +917,13 @@ impl<'a> DisplayListFlattener<'a> {
&prim_info, &prim_info,
Vec::new(), Vec::new(),
prim_key_kind, prim_key_kind,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::BoxShadow(ref box_shadow_info) => { SpecificDisplayItem::BoxShadow(ref box_shadow_info) => {
let current_offset = self.rf_mapper.current_offset();
let bounds = box_shadow_info let bounds = box_shadow_info
.box_bounds .box_bounds
.translate(&reference_frame_relative_offset); .translate(&current_offset);
let mut prim_info = prim_info.clone(); let mut prim_info = prim_info.clone();
prim_info.rect = bounds; prim_info.rect = bounds;
self.add_box_shadow( self.add_box_shadow(
@ -861,7 +935,6 @@ impl<'a> DisplayListFlattener<'a> {
box_shadow_info.spread_radius, box_shadow_info.spread_radius,
box_shadow_info.border_radius, box_shadow_info.border_radius,
box_shadow_info.clip_mode, box_shadow_info.clip_mode,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::Border(ref info) => { SpecificDisplayItem::Border(ref info) => {
@ -871,7 +944,6 @@ impl<'a> DisplayListFlattener<'a> {
info, info,
item.gradient_stops(), item.gradient_stops(),
pipeline_id, pipeline_id,
reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::PushStackingContext(ref info) => { SpecificDisplayItem::PushStackingContext(ref info) => {
@ -884,7 +956,6 @@ impl<'a> DisplayListFlattener<'a> {
item.rect().origin, item.rect().origin,
item.filters(), item.filters(),
item.filter_datas(), item.filter_datas(),
&reference_frame_relative_offset,
prim_info.is_backface_visible, prim_info.is_backface_visible,
apply_pipeline_clip, apply_pipeline_clip,
); );
@ -898,7 +969,6 @@ impl<'a> DisplayListFlattener<'a> {
clip_and_scroll.spatial_node_index, clip_and_scroll.spatial_node_index,
item.rect().origin, item.rect().origin,
&info.reference_frame, &info.reference_frame,
reference_frame_relative_offset,
apply_pipeline_clip, apply_pipeline_clip,
); );
return Some(subtraversal); return Some(subtraversal);
@ -908,16 +978,16 @@ impl<'a> DisplayListFlattener<'a> {
&item, &item,
info, info,
clip_and_scroll.spatial_node_index, clip_and_scroll.spatial_node_index,
&reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::Clip(ref info) => { SpecificDisplayItem::Clip(ref info) => {
let current_offset = self.rf_mapper.current_offset();
let complex_clips = self.get_complex_clips(pipeline_id, item.complex_clip().0); let complex_clips = self.get_complex_clips(pipeline_id, item.complex_clip().0);
let clip_region = ClipRegion::create_for_clip_node( let clip_region = ClipRegion::create_for_clip_node(
*item.clip_rect(), *item.clip_rect(),
complex_clips, complex_clips,
info.image_mask, info.image_mask,
&reference_frame_relative_offset, &current_offset,
); );
self.add_clip_node(info.id, space_and_clip, clip_region); self.add_clip_node(info.id, space_and_clip, clip_region);
} }
@ -996,7 +1066,6 @@ impl<'a> DisplayListFlattener<'a> {
info, info,
clip_and_scroll.spatial_node_index, clip_and_scroll.spatial_node_index,
pipeline_id, pipeline_id,
&reference_frame_relative_offset,
); );
} }
SpecificDisplayItem::StickyFrame(ref info) => { SpecificDisplayItem::StickyFrame(ref info) => {
@ -1004,7 +1073,6 @@ impl<'a> DisplayListFlattener<'a> {
&item, &item,
info, info,
clip_and_scroll.spatial_node_index, clip_and_scroll.spatial_node_index,
&reference_frame_relative_offset,
); );
} }
@ -1021,13 +1089,14 @@ impl<'a> DisplayListFlattener<'a> {
self.push_shadow(shadow, clip_and_scroll); self.push_shadow(shadow, clip_and_scroll);
} }
SpecificDisplayItem::PopAllShadows => { SpecificDisplayItem::PopAllShadows => {
self.pop_all_shadows(reference_frame_relative_offset); self.pop_all_shadows();
} }
SpecificDisplayItem::PushCacheMarker(_marker) => { SpecificDisplayItem::PushCacheMarker(_marker) => {
} }
SpecificDisplayItem::PopCacheMarker => { SpecificDisplayItem::PopCacheMarker => {
} }
} }
None None
} }
@ -1076,7 +1145,6 @@ impl<'a> DisplayListFlattener<'a> {
clip_chain_id: ClipChainId, clip_chain_id: ClipChainId,
spatial_node_index: SpatialNodeIndex, spatial_node_index: SpatialNodeIndex,
prim: P, prim: P,
reference_frame_relative_offset: LayoutVector2D,
) -> PrimitiveInstance ) -> PrimitiveInstance
where where
P: Internable<InternData=PrimitiveSceneData>, P: Internable<InternData=PrimitiveSceneData>,
@ -1096,10 +1164,12 @@ impl<'a> DisplayListFlattener<'a> {
} }
}); });
let current_offset = self.rf_mapper.current_offset();
let instance_kind = prim_key.as_instance_kind( let instance_kind = prim_key.as_instance_kind(
prim_data_handle, prim_data_handle,
&mut self.prim_store, &mut self.prim_store,
reference_frame_relative_offset, current_offset,
); );
PrimitiveInstance::new( PrimitiveInstance::new(
@ -1155,7 +1225,6 @@ impl<'a> DisplayListFlattener<'a> {
info: &LayoutPrimitiveInfo, info: &LayoutPrimitiveInfo,
clip_items: Vec<(LayoutPoint, ClipItemKey)>, clip_items: Vec<(LayoutPoint, ClipItemKey)>,
prim: P, prim: P,
reference_frame_relative_offset: LayoutVector2D,
) )
where where
P: Internable<InternData = PrimitiveSceneData> + IsVisible, P: Internable<InternData = PrimitiveSceneData> + IsVisible,
@ -1173,7 +1242,6 @@ impl<'a> DisplayListFlattener<'a> {
clip_chain_id, clip_chain_id,
clip_and_scroll, clip_and_scroll,
prim, prim,
reference_frame_relative_offset,
); );
} }
} }
@ -1184,7 +1252,6 @@ impl<'a> DisplayListFlattener<'a> {
info: &LayoutPrimitiveInfo, info: &LayoutPrimitiveInfo,
clip_items: Vec<(LayoutPoint, ClipItemKey)>, clip_items: Vec<(LayoutPoint, ClipItemKey)>,
prim: P, prim: P,
reference_frame_relative_offset: LayoutVector2D,
) )
where where
P: Internable<InternData = PrimitiveSceneData> + IsVisible, P: Internable<InternData = PrimitiveSceneData> + IsVisible,
@ -1200,7 +1267,6 @@ impl<'a> DisplayListFlattener<'a> {
info, info,
clip_items, clip_items,
prim, prim,
reference_frame_relative_offset,
); );
} else { } else {
debug_assert!(clip_items.is_empty(), "No per-prim clips expected for shadowed primitives"); debug_assert!(clip_items.is_empty(), "No per-prim clips expected for shadowed primitives");
@ -1221,7 +1287,6 @@ impl<'a> DisplayListFlattener<'a> {
clip_chain_id: ClipChainId, clip_chain_id: ClipChainId,
clip_and_scroll: ScrollNodeAndClipChain, clip_and_scroll: ScrollNodeAndClipChain,
prim: P, prim: P,
reference_frame_relative_offset: LayoutVector2D,
) )
where where
P: Internable<InternData = PrimitiveSceneData>, P: Internable<InternData = PrimitiveSceneData>,
@ -1233,7 +1298,6 @@ impl<'a> DisplayListFlattener<'a> {
clip_chain_id, clip_chain_id,
clip_and_scroll.spatial_node_index, clip_and_scroll.spatial_node_index,
prim, prim,
reference_frame_relative_offset,
); );
self.register_chase_primitive_by_rect( self.register_chase_primitive_by_rect(
&info.rect, &info.rect,
@ -1865,7 +1929,6 @@ impl<'a> DisplayListFlattener<'a> {
pub fn pop_all_shadows( pub fn pop_all_shadows(
&mut self, &mut self,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
assert!(!self.pending_shadow_items.is_empty(), "popped shadows, but none were present"); assert!(!self.pending_shadow_items.is_empty(), "popped shadows, but none were present");
@ -1919,7 +1982,6 @@ impl<'a> DisplayListFlattener<'a> {
&pending_shadow, &pending_shadow,
pending_image, pending_image,
&mut prims, &mut prims,
reference_frame_relative_offset,
) )
} }
ShadowItem::LineDecoration(ref pending_line_dec) => { ShadowItem::LineDecoration(ref pending_line_dec) => {
@ -1927,7 +1989,6 @@ impl<'a> DisplayListFlattener<'a> {
&pending_shadow, &pending_shadow,
pending_line_dec, pending_line_dec,
&mut prims, &mut prims,
reference_frame_relative_offset,
) )
} }
ShadowItem::NormalBorder(ref pending_border) => { ShadowItem::NormalBorder(ref pending_border) => {
@ -1935,7 +1996,6 @@ impl<'a> DisplayListFlattener<'a> {
&pending_shadow, &pending_shadow,
pending_border, pending_border,
&mut prims, &mut prims,
reference_frame_relative_offset,
) )
} }
ShadowItem::Primitive(ref pending_primitive) => { ShadowItem::Primitive(ref pending_primitive) => {
@ -1943,7 +2003,6 @@ impl<'a> DisplayListFlattener<'a> {
&pending_shadow, &pending_shadow,
pending_primitive, pending_primitive,
&mut prims, &mut prims,
reference_frame_relative_offset,
) )
} }
ShadowItem::TextRun(ref pending_text_run) => { ShadowItem::TextRun(ref pending_text_run) => {
@ -1951,7 +2010,6 @@ impl<'a> DisplayListFlattener<'a> {
&pending_shadow, &pending_shadow,
pending_text_run, pending_text_run,
&mut prims, &mut prims,
reference_frame_relative_offset,
) )
} }
_ => {} _ => {}
@ -2031,31 +2089,26 @@ impl<'a> DisplayListFlattener<'a> {
ShadowItem::Image(pending_image) => { ShadowItem::Image(pending_image) => {
self.add_shadow_prim_to_draw_list( self.add_shadow_prim_to_draw_list(
pending_image, pending_image,
reference_frame_relative_offset,
) )
}, },
ShadowItem::LineDecoration(pending_line_dec) => { ShadowItem::LineDecoration(pending_line_dec) => {
self.add_shadow_prim_to_draw_list( self.add_shadow_prim_to_draw_list(
pending_line_dec, pending_line_dec,
reference_frame_relative_offset,
) )
}, },
ShadowItem::NormalBorder(pending_border) => { ShadowItem::NormalBorder(pending_border) => {
self.add_shadow_prim_to_draw_list( self.add_shadow_prim_to_draw_list(
pending_border, pending_border,
reference_frame_relative_offset,
) )
}, },
ShadowItem::Primitive(pending_primitive) => { ShadowItem::Primitive(pending_primitive) => {
self.add_shadow_prim_to_draw_list( self.add_shadow_prim_to_draw_list(
pending_primitive, pending_primitive,
reference_frame_relative_offset,
) )
}, },
ShadowItem::TextRun(pending_text_run) => { ShadowItem::TextRun(pending_text_run) => {
self.add_shadow_prim_to_draw_list( self.add_shadow_prim_to_draw_list(
pending_text_run, pending_text_run,
reference_frame_relative_offset,
) )
}, },
} }
@ -2070,7 +2123,6 @@ impl<'a> DisplayListFlattener<'a> {
pending_shadow: &PendingShadow, pending_shadow: &PendingShadow,
pending_primitive: &PendingPrimitive<P>, pending_primitive: &PendingPrimitive<P>,
prims: &mut Vec<PrimitiveInstance>, prims: &mut Vec<PrimitiveInstance>,
reference_frame_relative_offset: LayoutVector2D,
) )
where where
P: Internable<InternData=PrimitiveSceneData> + CreateShadow, P: Internable<InternData=PrimitiveSceneData> + CreateShadow,
@ -2090,7 +2142,6 @@ impl<'a> DisplayListFlattener<'a> {
pending_primitive.prim.create_shadow( pending_primitive.prim.create_shadow(
&pending_shadow.shadow, &pending_shadow.shadow,
), ),
reference_frame_relative_offset,
); );
// Add the new primitive to the shadow picture. // Add the new primitive to the shadow picture.
@ -2100,7 +2151,6 @@ impl<'a> DisplayListFlattener<'a> {
fn add_shadow_prim_to_draw_list<P>( fn add_shadow_prim_to_draw_list<P>(
&mut self, &mut self,
pending_primitive: PendingPrimitive<P>, pending_primitive: PendingPrimitive<P>,
reference_frame_relative_offset: LayoutVector2D,
) where ) where
P: Internable<InternData = PrimitiveSceneData> + IsVisible, P: Internable<InternData = PrimitiveSceneData> + IsVisible,
P::Source: AsInstanceKind<Handle<P::Marker>> + InternDebug, P::Source: AsInstanceKind<Handle<P::Marker>> + InternDebug,
@ -2114,7 +2164,6 @@ impl<'a> DisplayListFlattener<'a> {
pending_primitive.clip_and_scroll.clip_chain_id, pending_primitive.clip_and_scroll.clip_chain_id,
pending_primitive.clip_and_scroll, pending_primitive.clip_and_scroll,
pending_primitive.prim, pending_primitive.prim,
reference_frame_relative_offset,
); );
} }
} }
@ -2144,7 +2193,6 @@ impl<'a> DisplayListFlattener<'a> {
clip_and_scroll: ScrollNodeAndClipChain, clip_and_scroll: ScrollNodeAndClipChain,
info: &LayoutPrimitiveInfo, info: &LayoutPrimitiveInfo,
color: ColorF, color: ColorF,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
if color.a == 0.0 { if color.a == 0.0 {
// Don't add transparent rectangles to the draw list, but do consider them for hit // Don't add transparent rectangles to the draw list, but do consider them for hit
@ -2160,7 +2208,6 @@ impl<'a> DisplayListFlattener<'a> {
PrimitiveKeyKind::Rectangle { PrimitiveKeyKind::Rectangle {
color: color.into(), color: color.into(),
}, },
reference_frame_relative_offset,
); );
} }
@ -2168,14 +2215,12 @@ impl<'a> DisplayListFlattener<'a> {
&mut self, &mut self,
clip_and_scroll: ScrollNodeAndClipChain, clip_and_scroll: ScrollNodeAndClipChain,
info: &LayoutPrimitiveInfo, info: &LayoutPrimitiveInfo,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
self.add_primitive( self.add_primitive(
clip_and_scroll, clip_and_scroll,
info, info,
Vec::new(), Vec::new(),
PrimitiveKeyKind::Clear, PrimitiveKeyKind::Clear,
reference_frame_relative_offset,
); );
} }
@ -2187,7 +2232,6 @@ impl<'a> DisplayListFlattener<'a> {
orientation: LineOrientation, orientation: LineOrientation,
color: ColorF, color: ColorF,
style: LineStyle, style: LineStyle,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
// For line decorations, we can construct the render task cache key // For line decorations, we can construct the render task cache key
// here during scene building, since it doesn't depend on device // here during scene building, since it doesn't depend on device
@ -2249,7 +2293,6 @@ impl<'a> DisplayListFlattener<'a> {
cache_key, cache_key,
color: color.into(), color: color.into(),
}, },
reference_frame_relative_offset,
); );
} }
@ -2260,7 +2303,6 @@ impl<'a> DisplayListFlattener<'a> {
border_item: &BorderDisplayItem, border_item: &BorderDisplayItem,
gradient_stops: ItemRange<GradientStop>, gradient_stops: ItemRange<GradientStop>,
pipeline_id: PipelineId, pipeline_id: PipelineId,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
match border_item.details { match border_item.details {
BorderDetails::NinePatch(ref border) => { BorderDetails::NinePatch(ref border) => {
@ -2291,7 +2333,6 @@ impl<'a> DisplayListFlattener<'a> {
info, info,
Vec::new(), Vec::new(),
prim, prim,
reference_frame_relative_offset,
); );
} }
NinePatchBorderSource::Gradient(gradient) => { NinePatchBorderSource::Gradient(gradient) => {
@ -2315,7 +2356,6 @@ impl<'a> DisplayListFlattener<'a> {
info, info,
Vec::new(), Vec::new(),
prim, prim,
reference_frame_relative_offset,
); );
} }
NinePatchBorderSource::RadialGradient(gradient) => { NinePatchBorderSource::RadialGradient(gradient) => {
@ -2338,7 +2378,6 @@ impl<'a> DisplayListFlattener<'a> {
info, info,
Vec::new(), Vec::new(),
prim, prim,
reference_frame_relative_offset,
); );
} }
}; };
@ -2349,7 +2388,6 @@ impl<'a> DisplayListFlattener<'a> {
border, border,
border_item.widths, border_item.widths,
clip_and_scroll, clip_and_scroll,
reference_frame_relative_offset,
); );
} }
} }
@ -2469,7 +2507,6 @@ impl<'a> DisplayListFlattener<'a> {
pub fn add_text( pub fn add_text(
&mut self, &mut self,
clip_and_scroll: ScrollNodeAndClipChain, clip_and_scroll: ScrollNodeAndClipChain,
offset: LayoutVector2D,
prim_info: &LayoutPrimitiveInfo, prim_info: &LayoutPrimitiveInfo,
font_instance_key: &FontInstanceKey, font_instance_key: &FontInstanceKey,
text_color: &ColorF, text_color: &ColorF,
@ -2477,6 +2514,8 @@ impl<'a> DisplayListFlattener<'a> {
glyph_options: Option<GlyphOptions>, glyph_options: Option<GlyphOptions>,
pipeline_id: PipelineId, pipeline_id: PipelineId,
) { ) {
let offset = self.rf_mapper.current_offset();
let text_run = { let text_run = {
let instance_map = self.font_instances.read().unwrap(); let instance_map = self.font_instances.read().unwrap();
let font_instance = match instance_map.get(font_instance_key) { let font_instance = match instance_map.get(font_instance_key) {
@ -2542,7 +2581,6 @@ impl<'a> DisplayListFlattener<'a> {
prim_info, prim_info,
Vec::new(), Vec::new(),
text_run, text_run,
offset,
); );
} }
@ -2557,7 +2595,6 @@ impl<'a> DisplayListFlattener<'a> {
image_rendering: ImageRendering, image_rendering: ImageRendering,
alpha_type: AlphaType, alpha_type: AlphaType,
color: ColorF, color: ColorF,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
let mut prim_rect = info.rect; let mut prim_rect = info.rect;
simplify_repeated_primitive(&stretch_size, &mut tile_spacing, &mut prim_rect); simplify_repeated_primitive(&stretch_size, &mut tile_spacing, &mut prim_rect);
@ -2592,7 +2629,6 @@ impl<'a> DisplayListFlattener<'a> {
image_rendering, image_rendering,
alpha_type, alpha_type,
}, },
reference_frame_relative_offset,
); );
} }
@ -2604,7 +2640,6 @@ impl<'a> DisplayListFlattener<'a> {
color_depth: ColorDepth, color_depth: ColorDepth,
color_space: YuvColorSpace, color_space: YuvColorSpace,
image_rendering: ImageRendering, image_rendering: ImageRendering,
reference_frame_relative_offset: LayoutVector2D,
) { ) {
let format = yuv_data.get_format(); let format = yuv_data.get_format();
let yuv_key = match yuv_data { let yuv_key = match yuv_data {
@ -2624,7 +2659,6 @@ impl<'a> DisplayListFlattener<'a> {
color_space, color_space,
image_rendering, image_rendering,
}, },
reference_frame_relative_offset,
); );
} }

View File

@ -6861,6 +6861,12 @@ GeneralParser<ParseHandler, Unit>::classDefinition(
} }
if (propType == PropertyType::Field) { if (propType == PropertyType::Field) {
// TODO(khyperia): Delete the two lines below once fields are fully
// supported in the backend. We can't fail in BytecodeCompiler because of
// lazy parsing.
errorAt(propNameOffset, JSMSG_FIELDS_NOT_SUPPORTED);
return null();
if (isStatic) { if (isStatic) {
errorAt(propNameOffset, JSMSG_BAD_METHOD_DEF); errorAt(propNameOffset, JSMSG_BAD_METHOD_DEF);
return null(); return null();
@ -6893,11 +6899,7 @@ GeneralParser<ParseHandler, Unit>::classDefinition(
return null(); return null();
} }
// TODO(khyperia): Change the below to `continue;` once fields are continue;
// fully supported in the backend. We can't fail in BytecodeCompiler
// because of lazy parsing.
errorAt(propNameOffset, JSMSG_FIELDS_NOT_SUPPORTED);
return null();
} }
if (propType != PropertyType::Getter && propType != PropertyType::Setter && if (propType != PropertyType::Getter && propType != PropertyType::Setter &&

View File

@ -8460,16 +8460,17 @@ JS_FN_HELP("parseBin", BinParse, 1, 0,
JS_FN_HELP("newGlobal", NewGlobal, 1, 0, JS_FN_HELP("newGlobal", NewGlobal, 1, 0,
"newGlobal([options])", "newGlobal([options])",
" Return a new global object in a new realm. If options\n" " Return a new global object/realm. The new global is created in the\n"
" is given, it may have any of the following properties:\n" " 'newGlobal' function object's compartment and zone, unless the\n"
"\n" " '--more-compartments' command-line flag was given, in which case new\n"
" sameZoneAs: The compartment will be in the same zone as the given\n" " globals get a fresh compartment and zone. If options is given, it may\n"
" object (defaults to a new zone).\n" " have any of the following properties:\n"
" sameCompartmentAs: The global will be in the same compartment and\n" " sameCompartmentAs: If an object, the global will be in the same\n"
" zone as the given object (defaults to the current compartment,\n" " compartment and zone as the given object.\n"
" unless the --more-compartments option is used).\n" " sameZoneAs: The global will be in a new compartment in the same zone\n"
" as the given object.\n"
" newCompartment: If true, the global will always be created in a new\n" " newCompartment: If true, the global will always be created in a new\n"
" compartment, even without --more-compartments.\n" " compartment and zone.\n"
" cloneSingletons: If true, always clone the objects baked into\n" " cloneSingletons: If true, always clone the objects baked into\n"
" scripts, even if it's a top-level script that will only run once\n" " scripts, even if it's a top-level script that will only run once\n"
" (defaults to using them directly in scripts that will only run\n" " (defaults to using them directly in scripts that will only run\n"

View File

@ -610,7 +610,25 @@ nsresult nsZipArchive::BuildFileList(PRFileDesc *aFd) {
#elif defined(XP_UNIX) #elif defined(XP_UNIX)
madvise(const_cast<uint8_t *>(startp), readaheadLength, MADV_WILLNEED); madvise(const_cast<uint8_t *>(startp), readaheadLength, MADV_WILLNEED);
#elif defined(XP_WIN) #elif defined(XP_WIN)
if (aFd) { static auto prefetchVirtualMemory =
reinterpret_cast<BOOL (*)(HANDLE, ULONG_PTR, PVOID, ULONG)>(
GetProcAddress(GetModuleHandle(L"kernel32.dll"),
"PrefetchVirtualMemory"));
if (prefetchVirtualMemory) {
// Normally, we'd use WIN32_MEMORY_RANGE_ENTRY, but that requires
// a different _WIN32_WINNT value before including windows.h, but
// that causes complications with unified sources. It's a simple
// enough struct anyways.
struct {
PVOID VirtualAddress;
SIZE_T NumberOfBytes;
} entry;
entry.VirtualAddress = const_cast<uint8_t *>(startp);
entry.NumberOfBytes = readaheadLength;
prefetchVirtualMemory(GetCurrentProcess(), 1, &entry, 0);
readaheadLength = 0;
}
if (readaheadLength && aFd) {
HANDLE hFile = (HANDLE)PR_FileDesc2NativeHandle(aFd); HANDLE hFile = (HANDLE)PR_FileDesc2NativeHandle(aFd);
mozilla::ReadAhead(hFile, 0, readaheadLength); mozilla::ReadAhead(hFile, 0, readaheadLength);
} }

View File

@ -0,0 +1,23 @@
// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
"use strict";
// Attempts to verify a certificate for a time a few weeks into the future in
// the hopes of avoiding mass test failures when the certificates all expire.
// If this test fails, the certificates probably need to be regenerated.
// See bug 1525191.
add_task(async function() {
do_get_profile();
let certDB = Cc["@mozilla.org/security/x509certdb;1"]
.getService(Ci.nsIX509CertDB);
addCertFromFile(certDB, "bad_certs/test-ca.pem", "CTu,,");
let threeWeeksFromNowInSeconds = (Date.now() / 1000) +
(3 * 7 * 24 * 60 * 60);
let ee = constructCertFromFile("bad_certs/default-ee.pem");
await checkCertErrorGenericAtTime(certDB, ee, PRErrorCodeSuccess,
certificateUsageSSLServer,
threeWeeksFromNowInSeconds, false,
"test.example.com");
});

View File

@ -53,6 +53,8 @@ run-sequentially = hardcoded ports
[test_cert_dbKey.js] [test_cert_dbKey.js]
[test_cert_eku.js] [test_cert_eku.js]
[test_cert_embedded_null.js] [test_cert_embedded_null.js]
[test_cert_expiration_canary.js]
run-if = nightly_build
[test_cert_keyUsage.js] [test_cert_keyUsage.js]
[test_cert_isBuiltInRoot.js] [test_cert_isBuiltInRoot.js]
[test_cert_isBuiltInRoot_reload.js] [test_cert_isBuiltInRoot_reload.js]

View File

@ -35,6 +35,3 @@
[Cloned responses should provide the same data] [Cloned responses should provide the same data]
expected: FAIL expected: FAIL
[Check Response's clone with default values, without body]
expected: FAIL

View File

@ -1,4 +0,0 @@
[response-init-001.html]
[Check default value for statusText attribute]
expected: FAIL