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

This commit is contained in:
Brindusan Cristian 2018-12-18 11:54:05 +02:00
commit 5b64326d97
11 changed files with 273 additions and 213 deletions

View File

@ -15,7 +15,7 @@ allprojects {
topsrcdir = gradle.mozconfig.topsrcdir
topobjdir = gradle.mozconfig.topobjdir
compileSdkVersion = tryInt(mozconfig.substs.ANDROID_COMPILE_SDK_VERSION)
compileSdkVersion = 26
targetSdkVersion = tryInt(mozconfig.substs.ANDROID_TARGET_SDK)
minSdkVersion = tryInt(mozconfig.substs.MOZ_ANDROID_MIN_SDK_VERSION)
manifestPlaceholders = [

View File

@ -117,34 +117,17 @@ case "$target" in
AC_MSG_ERROR([Including platforms/android-* in --with-android-sdk arguments is deprecated. Use --with-android-sdk=$android_sdk_root.])
fi
android_compile_sdk=$1
AC_MSG_CHECKING([for Android SDK platform version $android_compile_sdk])
android_sdk=$android_sdk_root/platforms/android-$android_compile_sdk
if ! test -e "$android_sdk/source.properties" ; then
AC_MSG_ERROR([You must download Android SDK platform version $android_compile_sdk. Try |mach bootstrap|. (Looked for $android_sdk)])
fi
AC_MSG_RESULT([$android_sdk])
android_target_sdk=$2
if test $android_compile_sdk -lt $android_target_sdk ; then
AC_MSG_ERROR([Android compileSdkVersion ($android_compile_sdk) should not be smaller than targetSdkVersion ($android_target_sdk).])
fi
AC_MSG_CHECKING([for Android build-tools])
android_build_tools_base="$android_sdk_root"/build-tools
android_build_tools_version=""
for version in $3; do
android_build_tools="$android_build_tools_base"/$version
if test -d "$android_build_tools" -a -f "$android_build_tools/aapt"; then
android_build_tools_version=$version
if test -d "$android_build_tools" -a -f "$android_build_tools/zipalign"; then
AC_MSG_RESULT([$android_build_tools])
break
fi
done
if test "$android_build_tools_version" = ""; then
version=$(echo $3 | cut -d" " -f1)
AC_MSG_ERROR([You must install the Android build-tools version $version. Try |mach bootstrap|. (Looked for "$android_build_tools_base"/$version)])
fi
MOZ_PATH_PROG(ZIPALIGN, zipalign, :, [$android_build_tools])
if test -z "$ZIPALIGN" -o "$ZIPALIGN" = ":"; then
@ -180,18 +163,12 @@ case "$target" in
AC_MSG_ERROR([The program emulator was not found. Try |mach bootstrap|.])
fi
ANDROID_COMPILE_SDK_VERSION="${android_compile_sdk}"
ANDROID_TARGET_SDK="${android_target_sdk}"
ANDROID_SDK="${android_sdk}"
ANDROID_SDK_ROOT="${android_sdk_root}"
ANDROID_TOOLS="${android_tools}"
ANDROID_BUILD_TOOLS_VERSION="$android_build_tools_version"
AC_SUBST(ANDROID_COMPILE_SDK_VERSION)
AC_SUBST(ANDROID_TARGET_SDK)
AC_SUBST(ANDROID_SDK_ROOT)
AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_TOOLS)
AC_SUBST(ANDROID_BUILD_TOOLS_VERSION)
;;
esac

View File

@ -8,7 +8,7 @@
# Java detection
# ========================================================
option('--with-java-bin-path', nargs=1,
help='Location of Java binaries (java, javac, jar)')
help='Location of Java binaries (java, jarsigner, keytool)')
@depends('--with-java-bin-path')
@ -45,27 +45,8 @@ def check_java_tool(tool):
check_java_tool('java')
check_java_tool('javah')
check_java_tool('jar')
check_java_tool('jarsigner')
check_java_tool('keytool')
javac = check_java_tool('javac')
@depends(javac)
@checking('for javac version')
@imports('subprocess')
def javac_version(javac):
try:
output = subprocess.check_output([javac, '-version'],
stderr=subprocess.STDOUT).rstrip()
version = Version(output.split(' ')[-1])
if version < '1.8':
die('javac 1.8 or higher is required (found %s). '
'Check the JAVA_HOME environment variable.' % version)
return version
except subprocess.CalledProcessError as e:
die('Failed to get javac version: %s', e.output)
# Java Code Coverage

View File

@ -1 +1 @@
4de718f9ea3435c099cabafc02e8b51da539bc62
b0e4a13491f9f780222d3aa374fa8f0c07508e73

View File

@ -22,9 +22,9 @@ use image::simplify_repeated_primitive;
use intern::{Handle, Internable, InternDebug};
use internal_types::{FastHashMap, FastHashSet};
use picture::{Picture3DContext, PictureCompositeMode, PicturePrimitive, PrimitiveList};
use prim_store::{PrimitiveInstance, PrimitiveKeyKind};
use prim_store::{PrimitiveInstance, PrimitiveKeyKind, PictureCompositeKey};
use prim_store::{PrimitiveKey, PrimitiveSceneData, PrimitiveInstanceKind, NinePatchDescriptor};
use prim_store::{PrimitiveDataHandle, PrimitiveStore, PrimitiveStoreStats, LineDecorationCacheKey};
use prim_store::{PrimitiveStore, PrimitiveStoreStats, LineDecorationCacheKey};
use prim_store::{ScrollNodeAndClipChain, PictureIndex, register_prim_chase_id, get_line_decoration_sizes};
use prim_store::gradient::{GradientStopKey, LinearGradient, RadialGradient, RadialGradientParams};
use prim_store::text_run::TextRun;
@ -330,7 +330,9 @@ impl<'a> DisplayListFlattener<'a> {
true,
LayoutSize::zero(),
LayoutRect::max_rect(),
PrimitiveKeyKind::Unused,
PrimitiveKeyKind::Picture {
composite_mode_key: PictureCompositeKey::Identity,
},
);
let primitive_data_handle = self.resources
@ -1236,7 +1238,7 @@ impl<'a> DisplayListFlattener<'a> {
// so that the relative order between them and our current SC is preserved.
let extra_instance = sc.cut_flat_item_sequence(
&mut self.prim_store,
&self.resources,
&mut self.resources,
&self.clip_store,
);
(sc.is_3d(), extra_instance)
@ -1284,30 +1286,12 @@ impl<'a> DisplayListFlattener<'a> {
// clip node doesn't affect the stacking context rect.
let should_isolate = clipping_node.is_some();
let prim_key = PrimitiveKey::new(
is_backface_visible,
LayoutSize::zero(),
LayoutRect::max_rect(),
PrimitiveKeyKind::Unused,
);
let primitive_data_handle = self.resources
.prim_interner
.intern(&prim_key, || {
PrimitiveSceneData {
prim_relative_clip_rect: LayoutRect::max_rect(),
prim_size: LayoutSize::zero(),
is_backface_visible,
}
}
);
// Push the SC onto the stack, so we know how to handle things in
// pop_stacking_context.
self.sc_stack.push(FlattenedStackingContext {
primitives: Vec::new(),
pipeline_id,
primitive_data_handle,
is_backface_visible,
requested_raster_space,
spatial_node_index,
clip_chain_id,
@ -1407,15 +1391,13 @@ impl<'a> DisplayListFlattener<'a> {
// mix-blend-mode and/or 3d rendering context containers.
let mut current_pic_index = leaf_pic_index;
let data_handle = stacking_context.primitive_data_handle;
let mut cur_instance = PrimitiveInstance::new(
LayoutPoint::zero(),
PrimitiveInstanceKind::Picture {
data_handle,
pic_index: leaf_pic_index
},
let mut cur_instance = create_prim_instance(
leaf_pic_index,
leaf_composite_mode.into(),
stacking_context.is_backface_visible,
stacking_context.clip_chain_id,
stacking_context.spatial_node_index,
&mut self.resources,
);
if cur_instance.is_chased() {
@ -1426,7 +1408,7 @@ impl<'a> DisplayListFlattener<'a> {
// a picture with all the *trailing* immediate children elements.
// We append this to the preserve-3D picture set and make a container picture of them.
if let Picture3DContext::In { root_data: Some(mut prims), ancestor_index } = stacking_context.context_3d {
prims.push(cur_instance.clone());
prims.push(cur_instance);
// This is the acttual picture representing our 3D hierarchy root.
current_pic_index = PictureIndex(self.prim_store.pictures
@ -1451,20 +1433,25 @@ impl<'a> DisplayListFlattener<'a> {
))
);
cur_instance.kind = PrimitiveInstanceKind::Picture {
data_handle,
pic_index: current_pic_index
};
cur_instance = create_prim_instance(
current_pic_index,
PictureCompositeKey::Identity,
stacking_context.is_backface_visible,
stacking_context.clip_chain_id,
stacking_context.spatial_node_index,
&mut self.resources,
);
}
// For each filter, create a new image with that composite mode.
for filter in &stacking_context.composite_ops.filters {
let filter = filter.sanitize();
let composite_mode = Some(PictureCompositeMode::Filter(filter));
let filter_pic_index = PictureIndex(self.prim_store.pictures
.alloc()
.init(PicturePrimitive::new_image(
Some(PictureCompositeMode::Filter(filter)),
composite_mode,
Picture3DContext::Out,
stacking_context.pipeline_id,
None,
@ -1481,10 +1468,14 @@ impl<'a> DisplayListFlattener<'a> {
);
current_pic_index = filter_pic_index;
cur_instance.kind = PrimitiveInstanceKind::Picture {
data_handle,
pic_index: current_pic_index
};
cur_instance = create_prim_instance(
current_pic_index,
composite_mode.into(),
stacking_context.is_backface_visible,
stacking_context.clip_chain_id,
stacking_context.spatial_node_index,
&mut self.resources,
);
if cur_instance.is_chased() {
println!("\tis a composite picture for a stacking context with {:?}", filter);
@ -1497,10 +1488,12 @@ impl<'a> DisplayListFlattener<'a> {
// Same for mix-blend-mode.
if let Some(mix_blend_mode) = stacking_context.composite_ops.mix_blend_mode {
let composite_mode = Some(PictureCompositeMode::MixBlend(mix_blend_mode));
let blend_pic_index = PictureIndex(self.prim_store.pictures
.alloc()
.init(PicturePrimitive::new_image(
Some(PictureCompositeMode::MixBlend(mix_blend_mode)),
composite_mode,
Picture3DContext::Out,
stacking_context.pipeline_id,
None,
@ -1517,10 +1510,14 @@ impl<'a> DisplayListFlattener<'a> {
);
current_pic_index = blend_pic_index;
cur_instance.kind = PrimitiveInstanceKind::Picture {
data_handle,
pic_index: blend_pic_index
};
cur_instance = create_prim_instance(
blend_pic_index,
composite_mode.into(),
stacking_context.is_backface_visible,
stacking_context.clip_chain_id,
stacking_context.spatial_node_index,
&mut self.resources,
);
if cur_instance.is_chased() {
println!("\tis a mix-blend picture for a stacking context with {:?}", mix_blend_mode);
@ -1842,12 +1839,14 @@ impl<'a> DisplayListFlattener<'a> {
// detect this and mark the picture to be drawn directly into the
// parent picture, which avoids an intermediate surface and blur.
let blur_filter = FilterOp::Blur(std_deviation).sanitize();
let composite_mode = PictureCompositeMode::Filter(blur_filter);
let composite_mode_key = Some(composite_mode).into();
// Create the primitive to draw the shadow picture into the scene.
let shadow_pic_index = PictureIndex(self.prim_store.pictures
.alloc()
.init(PicturePrimitive::new_image(
Some(PictureCompositeMode::Filter(blur_filter)),
Some(composite_mode),
Picture3DContext::Out,
pipeline_id,
None,
@ -1867,7 +1866,9 @@ impl<'a> DisplayListFlattener<'a> {
true,
LayoutSize::zero(),
LayoutRect::max_rect(),
PrimitiveKeyKind::Unused,
PrimitiveKeyKind::Picture {
composite_mode_key,
},
);
let shadow_prim_data_handle = self.resources
@ -2505,9 +2506,8 @@ struct FlattenedStackingContext {
/// The list of primitive instances added to this stacking context.
primitives: Vec<PrimitiveInstance>,
/// The interned key for all the primitive instances associated with this
/// SC (but not its children);
primitive_data_handle: PrimitiveDataHandle,
/// Whether this stacking context is visible when backfacing
is_backface_visible: bool,
/// Whether or not the caller wants this drawn in
/// screen space (quality) or local space (performance)
@ -2567,7 +2567,7 @@ impl FlattenedStackingContext {
}
// If backface visibility is different
if self.primitive_data_handle.uid() != parent.primitive_data_handle.uid() {
if self.is_backface_visible != parent.is_backface_visible {
return false;
}
@ -2605,7 +2605,7 @@ impl FlattenedStackingContext {
pub fn cut_flat_item_sequence(
&mut self,
prim_store: &mut PrimitiveStore,
resources: &DocumentResources,
resources: &mut DocumentResources,
clip_store: &ClipStore,
) -> Option<PrimitiveInstance> {
if !self.is_3d() || self.primitives.is_empty() {
@ -2638,15 +2638,16 @@ impl FlattenedStackingContext {
))
);
Some(PrimitiveInstance::new(
LayoutPoint::zero(),
PrimitiveInstanceKind::Picture {
data_handle: self.primitive_data_handle,
pic_index
},
let prim_instance = create_prim_instance(
pic_index,
PictureCompositeKey::Identity,
self.is_backface_visible,
self.clip_chain_id,
self.spatial_node_index,
))
resources,
);
Some(prim_instance)
}
}
@ -2683,3 +2684,42 @@ impl From<PendingPrimitive<TextRun>> for ShadowItem {
ShadowItem::TextRun(text_run)
}
}
fn create_prim_instance(
pic_index: PictureIndex,
composite_mode_key: PictureCompositeKey,
is_backface_visible: bool,
clip_chain_id: ClipChainId,
spatial_node_index: SpatialNodeIndex,
resources: &mut DocumentResources,
) -> PrimitiveInstance {
let prim_key = PrimitiveKey::new(
is_backface_visible,
LayoutSize::zero(),
LayoutRect::max_rect(),
PrimitiveKeyKind::Picture {
composite_mode_key,
},
);
let data_handle = resources
.prim_interner
.intern(&prim_key, || {
PrimitiveSceneData {
prim_relative_clip_rect: LayoutRect::max_rect(),
prim_size: LayoutSize::zero(),
is_backface_visible,
}
}
);
PrimitiveInstance::new(
LayoutPoint::zero(),
PrimitiveInstanceKind::Picture {
data_handle,
pic_index,
},
clip_chain_id,
spatial_node_index,
)
}

View File

@ -4,8 +4,8 @@
use api::{AlphaType, BorderRadius, ClipMode, ColorF, PictureRect, ColorU, LayoutVector2D};
use api::{DeviceIntRect, DeviceIntSize, DevicePixelScale, DeviceRect, LayoutSideOffsetsAu};
use api::{FilterOp, ImageKey, ImageRendering, TileOffset, RepeatMode};
use api::{LayoutPoint, LayoutRect, LayoutSideOffsets, LayoutSize};
use api::{FilterOp, ImageKey, ImageRendering, TileOffset, RepeatMode, MixBlendMode};
use api::{LayoutPoint, LayoutRect, LayoutSideOffsets, LayoutSize, PropertyBindingId};
use api::{PremultipliedColorF, PropertyBinding, Shadow, YuvColorSpace, YuvFormat};
use api::{DeviceIntSideOffsets, WorldPixel, BoxShadowClipMode, NormalBorder, WorldRect, LayoutToWorldScale};
use api::{PicturePixel, RasterPixel, ColorDepth, LineStyle, LineOrientation, LayoutSizeAu, AuHelpers};
@ -342,17 +342,122 @@ pub struct PrimitiveSceneData {
pub is_backface_visible: bool,
}
/// Represents a hashable description of how a picture primitive
/// will be composited into its parent.
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
#[derive(Debug, Clone, PartialEq, Hash, Eq)]
pub enum PictureCompositeKey {
// No visual compositing effect
Identity,
// FilterOp
Blur(Au),
Brightness(Au),
Contrast(Au),
Grayscale(Au),
HueRotate(Au),
Invert(Au),
Opacity(Au),
OpacityBinding(PropertyBindingId, Au),
Saturate(Au),
Sepia(Au),
DropShadow(VectorKey, Au, ColorU),
ColorMatrix([Au; 20]),
SrgbToLinear,
LinearToSrgb,
// MixBlendMode
Multiply,
Screen,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
}
impl From<Option<PictureCompositeMode>> for PictureCompositeKey {
fn from(mode: Option<PictureCompositeMode>) -> Self {
match mode {
Some(PictureCompositeMode::MixBlend(mode)) => {
match mode {
MixBlendMode::Normal => PictureCompositeKey::Identity,
MixBlendMode::Multiply => PictureCompositeKey::Multiply,
MixBlendMode::Screen => PictureCompositeKey::Screen,
MixBlendMode::Overlay => PictureCompositeKey::Overlay,
MixBlendMode::Darken => PictureCompositeKey::Darken,
MixBlendMode::Lighten => PictureCompositeKey::Lighten,
MixBlendMode::ColorDodge => PictureCompositeKey::ColorDodge,
MixBlendMode::ColorBurn => PictureCompositeKey::ColorBurn,
MixBlendMode::HardLight => PictureCompositeKey::HardLight,
MixBlendMode::SoftLight => PictureCompositeKey::SoftLight,
MixBlendMode::Difference => PictureCompositeKey::Difference,
MixBlendMode::Exclusion => PictureCompositeKey::Exclusion,
MixBlendMode::Hue => PictureCompositeKey::Hue,
MixBlendMode::Saturation => PictureCompositeKey::Saturation,
MixBlendMode::Color => PictureCompositeKey::Color,
MixBlendMode::Luminosity => PictureCompositeKey::Luminosity,
}
}
Some(PictureCompositeMode::Filter(op)) => {
match op {
FilterOp::Blur(value) => PictureCompositeKey::Blur(Au::from_f32_px(value)),
FilterOp::Brightness(value) => PictureCompositeKey::Brightness(Au::from_f32_px(value)),
FilterOp::Contrast(value) => PictureCompositeKey::Contrast(Au::from_f32_px(value)),
FilterOp::Grayscale(value) => PictureCompositeKey::Grayscale(Au::from_f32_px(value)),
FilterOp::HueRotate(value) => PictureCompositeKey::HueRotate(Au::from_f32_px(value)),
FilterOp::Invert(value) => PictureCompositeKey::Invert(Au::from_f32_px(value)),
FilterOp::Saturate(value) => PictureCompositeKey::Saturate(Au::from_f32_px(value)),
FilterOp::Sepia(value) => PictureCompositeKey::Sepia(Au::from_f32_px(value)),
FilterOp::SrgbToLinear => PictureCompositeKey::SrgbToLinear,
FilterOp::LinearToSrgb => PictureCompositeKey::LinearToSrgb,
FilterOp::Identity => PictureCompositeKey::Identity,
FilterOp::DropShadow(offset, radius, color) => {
PictureCompositeKey::DropShadow(offset.into(), Au::from_f32_px(radius), color.into())
}
FilterOp::Opacity(binding, _) => {
match binding {
PropertyBinding::Value(value) => {
PictureCompositeKey::Opacity(Au::from_f32_px(value))
}
PropertyBinding::Binding(key, default) => {
PictureCompositeKey::OpacityBinding(key.id, Au::from_f32_px(default))
}
}
}
FilterOp::ColorMatrix(values) => {
let mut quantized_values: [Au; 20] = [Au(0); 20];
for (value, result) in values.iter().zip(quantized_values.iter_mut()) {
*result = Au::from_f32_px(*value);
}
PictureCompositeKey::ColorMatrix(quantized_values)
}
}
}
Some(PictureCompositeMode::Blit) |
Some(PictureCompositeMode::TileCache { .. }) |
None => {
PictureCompositeKey::Identity
}
}
}
}
/// Information specific to a primitive type that
/// uniquely identifies a primitive template by key.
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum PrimitiveKeyKind {
/// Pictures and old style (non-interned) primitives specify the
/// Unused primitive key kind. In the future it might make sense
/// to instead have Option<PrimitiveKeyKind>. It should become
/// clearer as we port more primitives to be interned.
Unused,
/// Identifying key for a line decoration.
LineDecoration {
// If the cache_key is Some(..) it is a line decoration
@ -391,6 +496,9 @@ pub enum PrimitiveKeyKind {
image_rendering: ImageRendering,
alpha_type: AlphaType,
},
Picture {
composite_mode_key: PictureCompositeKey,
},
}
#[cfg_attr(feature = "capture", derive(Serialize))]
@ -705,9 +813,9 @@ impl AsInstanceKind<PrimitiveDataHandle> for PrimitiveKey {
image_instance_index,
}
}
PrimitiveKeyKind::Unused => {
PrimitiveKeyKind::Picture { .. } => {
// Should never be hit as this method should not be
// called for old style primitives.
// called for pictures.
unreachable!();
}
}
@ -760,7 +868,9 @@ pub enum PrimitiveTemplateKind {
alpha_type: AlphaType,
},
Clear,
Unused,
Picture {
},
}
/// Construct the primitive template data from a primitive key. This
@ -772,7 +882,11 @@ impl PrimitiveKeyKind {
size: LayoutSize,
) -> PrimitiveTemplateKind {
match self {
PrimitiveKeyKind::Unused => PrimitiveTemplateKind::Unused,
PrimitiveKeyKind::Picture { .. } => {
PrimitiveTemplateKind::Picture {
}
}
PrimitiveKeyKind::Clear => {
PrimitiveTemplateKind::Clear
}
@ -984,7 +1098,7 @@ impl PrimitiveTemplateKind {
0.0,
]);
}
PrimitiveTemplateKind::Unused => {}
PrimitiveTemplateKind::Picture { .. } => {}
}
}
@ -1016,7 +1130,7 @@ impl PrimitiveTemplateKind {
PrimitiveTemplateKind::Image { .. } |
PrimitiveTemplateKind::Rectangle { .. } |
PrimitiveTemplateKind::YuvImage { .. } |
PrimitiveTemplateKind::Unused => {}
PrimitiveTemplateKind::Picture { .. } => {}
}
}
}
@ -1225,7 +1339,7 @@ impl PrimitiveTemplate {
}
}
}
PrimitiveTemplateKind::Unused => {
PrimitiveTemplateKind::Picture { .. } => {
PrimitiveOpacity::translucent()
}
};
@ -1721,7 +1835,7 @@ impl IsVisible for PrimitiveKeyKind {
PrimitiveKeyKind::YuvImage { .. } |
PrimitiveKeyKind::Image { .. } |
PrimitiveKeyKind::Clear |
PrimitiveKeyKind::Unused => {
PrimitiveKeyKind::Picture { .. } => {
true
}
PrimitiveKeyKind::Rectangle { ref color, .. } |
@ -1772,7 +1886,7 @@ impl CreateShadow for PrimitiveKeyKind {
}
PrimitiveKeyKind::ImageBorder { .. } |
PrimitiveKeyKind::YuvImage { .. } |
PrimitiveKeyKind::Unused |
PrimitiveKeyKind::Picture { .. } |
PrimitiveKeyKind::Clear => {
panic!("bug: this prim is not supported in shadow contexts");
}

View File

@ -481,6 +481,9 @@ impl SpatialNode {
// offsets actually adjust the node position itself, whereas scroll offsets
// only apply to contents inside the node.
state.parent_accumulated_scroll_offset += info.current_offset;
// We want nested sticky items to take into account the shift
// we applied as well.
state.nearest_scrolling_ancestor_offset += info.current_offset;
}
SpatialNodeType::ScrollFrame(ref scrolling) => {
state.parent_accumulated_scroll_offset += scrolling.offset;

View File

@ -0,0 +1,11 @@
root:
items:
# This is a scroll frame with an out-of-viewport rect that should be pushed into the
# viewport by its "bottom" sticky constraint.
- type: scroll-frame
bounds: [10, 10, 50, 50]
content-size: [200, 200]
items:
- type: rect
bounds: [10, 20, 50, 50]
color: green

View File

@ -0,0 +1,20 @@
root:
items:
- type: scroll-frame
bounds: [10, 10, 50, 50]
content-size: [200, 200]
scroll-offset: [0, 30]
items:
- type: sticky-frame
bounds: [10, 30, 50, 50]
margin-top: 5
vertical-offset-bounds: [0, 500]
items:
- type: sticky-frame
bounds: [10, 30, 50, 50]
margin-top: 10
vertical-offset-bounds: [0, 500]
items:
- type: rect
bounds: [10, 30, 50, 50]
color: green

View File

@ -15,3 +15,4 @@
== sticky-transformed.yaml sticky-transformed-ref.yaml
== sibling-hidden-clip.yaml sibling-hidden-clip-ref.yaml
== scale-offsets.yaml scale-offsets-ref.yaml
== nested-stickys.yaml nested-stickys-ref.yaml

View File

@ -481,24 +481,13 @@ class TestChecksConfigure(unittest.TestCase):
def test_java_tool_checks(self):
includes = ('util.configure', 'checks.configure', 'java.configure')
def mock_valid_javac(_, args):
if len(args) == 1 and args[0] == '-version':
return 0, '1.8', ''
self.fail("Unexpected arguments to mock_valid_javac: %s" % args)
# A valid set of tools in a standard location.
java = mozpath.abspath('/usr/bin/java')
javah = mozpath.abspath('/usr/bin/javah')
javac = mozpath.abspath('/usr/bin/javac')
jar = mozpath.abspath('/usr/bin/jar')
jarsigner = mozpath.abspath('/usr/bin/jarsigner')
keytool = mozpath.abspath('/usr/bin/keytool')
paths = {
java: None,
javah: None,
javac: mock_valid_javac,
jar: None,
jarsigner: None,
keytool: None,
}
@ -507,37 +496,24 @@ class TestChecksConfigure(unittest.TestCase):
self.assertEqual(status, 0)
self.assertEqual(config, {
'JAVA': java,
'JAVAH': javah,
'JAVAC': javac,
'JAR': jar,
'JARSIGNER': jarsigner,
'KEYTOOL': keytool,
'MOZ_JAVA_CODE_COVERAGE': False,
})
self.assertEqual(out, textwrap.dedent('''\
checking for java... %s
checking for javah... %s
checking for jar... %s
checking for jarsigner... %s
checking for keytool... %s
checking for javac... %s
checking for javac version... 1.8
''' % (java, javah, jar, jarsigner, keytool, javac)))
''' % (java, jarsigner, keytool)))
# An alternative valid set of tools referred to by JAVA_HOME.
alt_java = mozpath.abspath('/usr/local/bin/java')
alt_javah = mozpath.abspath('/usr/local/bin/javah')
alt_javac = mozpath.abspath('/usr/local/bin/javac')
alt_jar = mozpath.abspath('/usr/local/bin/jar')
alt_jarsigner = mozpath.abspath('/usr/local/bin/jarsigner')
alt_keytool = mozpath.abspath('/usr/local/bin/keytool')
alt_java_home = mozpath.dirname(mozpath.dirname(alt_java))
paths.update({
alt_java: None,
alt_javah: None,
alt_javac: mock_valid_javac,
alt_jar: None,
alt_jarsigner: None,
alt_keytool: None,
})
@ -551,23 +527,15 @@ class TestChecksConfigure(unittest.TestCase):
self.assertEqual(status, 0)
self.assertEqual(config, {
'JAVA': alt_java,
'JAVAH': alt_javah,
'JAVAC': alt_javac,
'JAR': alt_jar,
'JARSIGNER': alt_jarsigner,
'KEYTOOL': alt_keytool,
'MOZ_JAVA_CODE_COVERAGE': False,
})
self.assertEqual(out, textwrap.dedent('''\
checking for java... %s
checking for javah... %s
checking for jar... %s
checking for jarsigner... %s
checking for keytool... %s
checking for javac... %s
checking for javac version... 1.8
''' % (alt_java, alt_javah, alt_jar, alt_jarsigner,
alt_keytool, alt_javac)))
''' % (alt_java, alt_jarsigner, alt_keytool)))
# We can use --with-java-bin-path instead of JAVA_HOME to similar
# effect.
@ -581,23 +549,15 @@ class TestChecksConfigure(unittest.TestCase):
self.assertEqual(status, 0)
self.assertEqual(config, {
'JAVA': alt_java,
'JAVAH': alt_javah,
'JAVAC': alt_javac,
'JAR': alt_jar,
'JARSIGNER': alt_jarsigner,
'KEYTOOL': alt_keytool,
'MOZ_JAVA_CODE_COVERAGE': False,
})
self.assertEqual(out, textwrap.dedent('''\
checking for java... %s
checking for javah... %s
checking for jar... %s
checking for jarsigner... %s
checking for keytool... %s
checking for javac... %s
checking for javac version... 1.8
''' % (alt_java, alt_javah, alt_jar, alt_jarsigner,
alt_keytool, alt_javac)))
''' % (alt_java, alt_jarsigner, alt_keytool)))
# If --with-java-bin-path and JAVA_HOME are both set,
# --with-java-bin-path takes precedence.
@ -612,23 +572,15 @@ class TestChecksConfigure(unittest.TestCase):
self.assertEqual(status, 0)
self.assertEqual(config, {
'JAVA': alt_java,
'JAVAH': alt_javah,
'JAVAC': alt_javac,
'JAR': alt_jar,
'JARSIGNER': alt_jarsigner,
'KEYTOOL': alt_keytool,
'MOZ_JAVA_CODE_COVERAGE': False,
})
self.assertEqual(out, textwrap.dedent('''\
checking for java... %s
checking for javah... %s
checking for jar... %s
checking for jarsigner... %s
checking for keytool... %s
checking for javac... %s
checking for javac version... 1.8
''' % (alt_java, alt_javah, alt_jar, alt_jarsigner,
alt_keytool, alt_javac)))
''' % (alt_java, alt_jarsigner, alt_keytool)))
# --enable-java-coverage should set MOZ_JAVA_CODE_COVERAGE.
config, out, status = self.get_result(
@ -642,46 +594,11 @@ class TestChecksConfigure(unittest.TestCase):
self.assertEqual(status, 0)
self.assertEqual(config, {
'JAVA': java,
'JAVAH': javah,
'JAVAC': javac,
'JAR': jar,
'JARSIGNER': jarsigner,
'KEYTOOL': keytool,
'MOZ_JAVA_CODE_COVERAGE': True,
})
def mock_old_javac(_, args):
if len(args) == 1 and args[0] == '-version':
return 0, '1.6.9', ''
self.fail("Unexpected arguments to mock_old_javac: %s" % args)
# An old javac is fatal.
paths[javac] = mock_old_javac
config, out, status = self.get_result(includes=includes,
extra_paths=paths,
environ={
'PATH': mozpath.dirname(java)
})
self.assertEqual(status, 1)
self.assertEqual(config, {
'JAVA': java,
'JAVAH': javah,
'JAVAC': javac,
'JAR': jar,
'JARSIGNER': jarsigner,
'KEYTOOL': keytool,
})
self.assertEqual(out, textwrap.dedent('''\
checking for java... %s
checking for javah... %s
checking for jar... %s
checking for jarsigner... %s
checking for keytool... %s
checking for javac... %s
checking for javac version...
ERROR: javac 1.8 or higher is required (found 1.6.9). Check the JAVA_HOME environment variable.
''' % (java, javah, jar, jarsigner, keytool, javac)))
# Any missing tool is fatal when these checks run.
del paths[jarsigner]
config, out, status = self.get_result(includes=includes,
@ -692,17 +609,13 @@ class TestChecksConfigure(unittest.TestCase):
self.assertEqual(status, 1)
self.assertEqual(config, {
'JAVA': java,
'JAVAH': javah,
'JAR': jar,
'JARSIGNER': ':',
})
self.assertEqual(out, textwrap.dedent('''\
checking for java... %s
checking for javah... %s
checking for jar... %s
checking for jarsigner... not found
ERROR: The program jarsigner was not found. Set $JAVA_HOME to your Java SDK directory or use '--with-java-bin-path={java-bin-dir}'
''' % (java, javah, jar)))
''' % (java)))
def test_pkg_check_modules(self):
mock_pkg_config_version = '0.10.0'