зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound
This commit is contained in:
Коммит
ae1dc5307b
|
@ -61,6 +61,20 @@ var EXPORTED_SYMBOLS = ["Policies"];
|
|||
* The callbacks will be bound to their parent policy object.
|
||||
*/
|
||||
var Policies = {
|
||||
"Authentication": {
|
||||
onBeforeAddons(manager, param) {
|
||||
if ("SPNEGO" in param) {
|
||||
setAndLockPref("network.negotiate-auth.trusted-uris", param.SPNEGO.join(", "));
|
||||
}
|
||||
if ("Delegated" in param) {
|
||||
setAndLockPref("network.negotiate-auth.delegation-uris", param.Delegated.join(", "));
|
||||
}
|
||||
if ("NTLM" in param) {
|
||||
setAndLockPref("network.automatic-ntlm-auth.trusted-uris", param.NTLM.join(", "));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"BlockAboutAddons": {
|
||||
onBeforeUIStartup(manager, param) {
|
||||
if (param) {
|
||||
|
@ -108,6 +122,14 @@ var Policies = {
|
|||
}
|
||||
},
|
||||
|
||||
"Certificates": {
|
||||
onBeforeAddons(manager, param) {
|
||||
if ("ImportEnterpriseRoots" in param) {
|
||||
setAndLockPref("security.enterprise_roots.enabled", true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"Cookies": {
|
||||
onBeforeUIStartup(manager, param) {
|
||||
addAllowDenyPermissions("cookie", param.Allow, param.Block);
|
||||
|
|
|
@ -2,6 +2,34 @@
|
|||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Authentication": {
|
||||
"description": "Sites that support integrated authentication. See https://developer.mozilla.org/en-US/docs/Mozilla/Integrated_authentication",
|
||||
"first_available": "60.0",
|
||||
"enterprise_only": true,
|
||||
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"SPNEGO" : {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"Delegated" : {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"NTLM" : {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"BlockAboutAddons": {
|
||||
"description": "Block access to the Add-ons Mananger (about:addons).",
|
||||
"first_available": "60.0",
|
||||
|
@ -70,6 +98,18 @@
|
|||
}
|
||||
},
|
||||
|
||||
"Certificates": {
|
||||
"description": "Whether or not to use built in certs.",
|
||||
"first_available": "60.0",
|
||||
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ImportEnterpriseRoots": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"Cookies": {
|
||||
"description": "Allow or deny websites to set cookies.",
|
||||
"first_available": "60.0",
|
||||
|
|
|
@ -75,6 +75,32 @@ const POLICIES_TESTS = [
|
|||
policies: { "OverrideFirstRunPage": "https://www.example.com/" },
|
||||
lockedPrefs: { "startup.homepage_welcome_url": "https://www.example.com/" },
|
||||
},
|
||||
|
||||
// POLICY: Authentication
|
||||
{
|
||||
policies: {
|
||||
"Authentication": {
|
||||
"SPNEGO": ["a.com", "b.com"],
|
||||
"Delegated": ["a.com", "b.com"],
|
||||
"NTLM": ["a.com", "b.com"],
|
||||
}
|
||||
},
|
||||
lockedPrefs: {
|
||||
"network.negotiate-auth.trusted-uris": "a.com, b.com",
|
||||
"network.negotiate-auth.delegation-uris": "a.com, b.com",
|
||||
"network.automatic-ntlm-auth.trusted-uris": "a.com, b.com",
|
||||
}
|
||||
},
|
||||
{
|
||||
policies: {
|
||||
"Certificates": {
|
||||
"ImportEnterpriseRoots": true,
|
||||
}
|
||||
},
|
||||
lockedPrefs: {
|
||||
"security.enterprise_roots.enabled": true,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
add_task(async function test_policy_remember_passwords() {
|
||||
|
|
|
@ -53,7 +53,7 @@ const res1 = [
|
|||
},
|
||||
{
|
||||
selector: ".boxmodel-margin.boxmodel-left > span",
|
||||
value: 0
|
||||
value: 4 // (100 - (10 * 2) - (20 * 2) - 32) / 2
|
||||
},
|
||||
{
|
||||
selector: ".boxmodel-margin.boxmodel-bottom > span",
|
||||
|
@ -61,7 +61,7 @@ const res1 = [
|
|||
},
|
||||
{
|
||||
selector: ".boxmodel-margin.boxmodel-right > span",
|
||||
value: 0
|
||||
value: 4 // (100 - (10 * 2) - (20 * 2) - 32) / 2
|
||||
},
|
||||
{
|
||||
selector: ".boxmodel-padding.boxmodel-top > span",
|
||||
|
|
|
@ -152,11 +152,7 @@ GetBoxRectForFrame(nsIFrame** aFrame, CSSBoxType aType)
|
|||
case CSSBoxType::Content: r = f->GetContentRectRelativeToSelf(); break;
|
||||
case CSSBoxType::Padding: r = f->GetPaddingRectRelativeToSelf(); break;
|
||||
case CSSBoxType::Border: r = nsRect(nsPoint(0, 0), f->GetSize()); break;
|
||||
case CSSBoxType::Margin: {
|
||||
r = nsRect(nsPoint(0, 0), f->GetSize());
|
||||
r.Inflate(f->GetUsedMargin());
|
||||
break;
|
||||
}
|
||||
case CSSBoxType::Margin: r = f->GetMarginRectRelativeToSelf(); break;
|
||||
default: MOZ_ASSERT(false, "unknown box type"); return r;
|
||||
}
|
||||
|
||||
|
|
|
@ -2531,7 +2531,7 @@ static void
|
|||
UpdateProp(nsIFrame* aFrame,
|
||||
const FramePropertyDescriptor<nsMargin>* aProperty,
|
||||
bool aNeeded,
|
||||
nsMargin& aNewValue)
|
||||
const nsMargin& aNewValue)
|
||||
{
|
||||
if (aNeeded) {
|
||||
nsMargin* propValue = aFrame->GetProperty(aProperty);
|
||||
|
@ -2566,10 +2566,10 @@ SizeComputationInput::InitOffsets(WritingMode aWM,
|
|||
// XXX fix to provide 0,0 for the top&bottom margins for
|
||||
// inline-non-replaced elements
|
||||
bool needMarginProp = ComputeMargin(aWM, aPercentBasis);
|
||||
// XXX We need to include 'auto' horizontal margins in this too!
|
||||
// ... but if we did that, we'd need to fix nsFrame::GetUsedMargin
|
||||
// to use it even when the margins are all zero (since sometimes
|
||||
// they get treated as auto)
|
||||
// Note that ComputeMargin() simplistically resolves 'auto' margins to 0.
|
||||
// In formatting contexts where this isn't correct, some later code will
|
||||
// need to update the UsedMargin() property with the actual resolved value.
|
||||
// One example of this is ::CalculateBlockSideMargins().
|
||||
::UpdateProp(mFrame, nsIFrame::UsedMarginProperty(), needMarginProp,
|
||||
ComputedPhysicalMargin());
|
||||
|
||||
|
@ -2800,7 +2800,16 @@ ReflowInput::CalculateBlockSideMargins(LayoutFrameType aFrameType)
|
|||
} else if (isAutoEndMargin) {
|
||||
margin.IEnd(cbWM) += availMarginSpace;
|
||||
}
|
||||
SetComputedLogicalMargin(margin.ConvertTo(mWritingMode, cbWM));
|
||||
LogicalMargin marginInOurWM = margin.ConvertTo(mWritingMode, cbWM);
|
||||
SetComputedLogicalMargin(marginInOurWM);
|
||||
|
||||
if (isAutoStartMargin || isAutoEndMargin) {
|
||||
// Update the UsedMargin property if we were tracking it already.
|
||||
nsMargin* propValue = mFrame->GetProperty(nsIFrame::UsedMarginProperty());
|
||||
if (propValue) {
|
||||
*propValue = marginInOurWM.GetPhysicalMargin(mWritingMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define NORMAL_LINE_HEIGHT_FACTOR 1.2f // in term of emHeight
|
||||
|
|
|
@ -553,6 +553,9 @@ public:
|
|||
bool NeedsMinSizeAutoResolution() const
|
||||
{ return mNeedsMinSizeAutoResolution; }
|
||||
|
||||
bool HasAnyAutoMargin() const
|
||||
{ return mHasAnyAutoMargin; }
|
||||
|
||||
// Indicates whether this item is a "strut" left behind by an element with
|
||||
// visibility:collapse.
|
||||
bool IsStrut() const { return mIsStrut; }
|
||||
|
@ -858,6 +861,9 @@ protected:
|
|||
// Does this item need to resolve a min-[width|height]:auto (in main-axis).
|
||||
bool mNeedsMinSizeAutoResolution;
|
||||
|
||||
// Does this item have an auto margin in either main or cross axis?
|
||||
bool mHasAnyAutoMargin;
|
||||
|
||||
uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
|
||||
// swapped out for parent"s "align-items" value,
|
||||
// in our constructor).
|
||||
|
@ -1816,7 +1822,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
|||
mIsInlineAxisMainAxis(aAxisTracker.IsRowOriented() !=
|
||||
aAxisTracker.GetWritingMode().IsOrthogonalTo(mWM))
|
||||
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
|
||||
// mAlignSelf, see below
|
||||
// mAlignSelf, mHasAnyAutoMargin see below
|
||||
{
|
||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||
MOZ_ASSERT(!mFrame->IsPlaceholderFrame(),
|
||||
|
@ -1853,12 +1859,16 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
|||
SetFlexBaseSizeAndMainSize(aFlexBaseSize);
|
||||
CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker);
|
||||
|
||||
|
||||
const nsStyleSides& styleMargin =
|
||||
aFlexItemReflowInput.mStyleMargin->mMargin;
|
||||
mHasAnyAutoMargin = styleMargin.HasInlineAxisAuto(mWM) ||
|
||||
styleMargin.HasBlockAxisAuto(mWM);
|
||||
|
||||
// Assert that any "auto" margin components are set to 0.
|
||||
// (We'll resolve them later; until then, we want to treat them as 0-sized.)
|
||||
#ifdef DEBUG
|
||||
{
|
||||
const nsStyleSides& styleMargin =
|
||||
aFlexItemReflowInput.mStyleMargin->mMargin;
|
||||
NS_FOR_CSS_SIDES(side) {
|
||||
if (styleMargin.GetUnit(side) == eStyleUnit_Auto) {
|
||||
MOZ_ASSERT(GetMarginComponentForSide(side) == 0,
|
||||
|
@ -1917,6 +1927,7 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize,
|
|||
mIsStrut(true), // (this is the constructor for making struts, after all)
|
||||
mIsInlineAxisMainAxis(true), // (doesn't matter b/c we're not doing layout)
|
||||
mNeedsMinSizeAutoResolution(false),
|
||||
mHasAnyAutoMargin(false),
|
||||
mAlignSelf(NS_STYLE_ALIGN_FLEX_START)
|
||||
{
|
||||
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
|
||||
|
@ -4753,6 +4764,16 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
|
|||
*item, framePos, containerSize);
|
||||
}
|
||||
|
||||
// If the item has auto margins, and we were tracking the UsedMargin
|
||||
// property, set the property to the computed margin values.
|
||||
if (item->HasAnyAutoMargin()) {
|
||||
nsMargin* propValue =
|
||||
item->Frame()->GetProperty(nsIFrame::UsedMarginProperty());
|
||||
if (propValue) {
|
||||
*propValue = item->GetMargin();
|
||||
}
|
||||
}
|
||||
|
||||
// If this is our first item and we haven't established a baseline for
|
||||
// the container yet (i.e. if we don't have 'align-self: baseline' on any
|
||||
// children), then use this child's first baseline as the container's
|
||||
|
@ -4953,10 +4974,6 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
|
|||
aItem.Frame()->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
||||
}
|
||||
|
||||
// XXXdholbert Might need to actually set the correct margins in the
|
||||
// reflow state at some point, so that they can be saved on the frame for
|
||||
// UsedMarginProperty(). Maybe doesn't matter though...?
|
||||
|
||||
// If we're overriding the computed width or height, *and* we had an
|
||||
// earlier "measuring" reflow, then this upcoming reflow needs to be
|
||||
// treated as a resize.
|
||||
|
|
|
@ -85,7 +85,11 @@ __wrap_dlsym(void *handle, const char *symbol)
|
|||
LibHandle *h = reinterpret_cast<LibHandle *>(handle);
|
||||
return h->GetSymbolPtr(symbol);
|
||||
}
|
||||
return dlsym(handle, symbol);
|
||||
|
||||
void* sym = dlsym(handle, symbol);
|
||||
ElfLoader::Singleton.lastError = dlerror();
|
||||
|
||||
return sym;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -356,6 +360,7 @@ SystemElf::Load(const char *path, int flags)
|
|||
* already loaded library, even when the full path doesn't exist */
|
||||
if (path && path[0] == '/' && (access(path, F_OK) == -1)){
|
||||
DEBUG_LOG("dlopen(\"%s\", 0x%x) = %p", path, flags, (void *)nullptr);
|
||||
ElfLoader::Singleton.lastError = "Specified file does not exist";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ protected:
|
|||
const char *lastError;
|
||||
|
||||
private:
|
||||
ElfLoader() : expect_shutdown(true)
|
||||
ElfLoader() : expect_shutdown(true), lastError(nullptr)
|
||||
{
|
||||
pthread_mutex_init(&handlesMutex, nullptr);
|
||||
}
|
||||
|
|
|
@ -139,8 +139,10 @@ ${helpers.single_keyword("mask-origin",
|
|||
background_size::get_initial_value()
|
||||
}
|
||||
|
||||
pub fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<SpecifiedValue,ParseError<'i>> {
|
||||
pub fn parse<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<SpecifiedValue, ParseError<'i>> {
|
||||
background_size::parse(context, input)
|
||||
}
|
||||
</%helpers:longhand>
|
||||
|
|
|
@ -33,8 +33,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let mut background_color = None;
|
||||
|
||||
% for name in "image position_x position_y repeat size attachment origin clip".split():
|
||||
|
@ -200,8 +202,10 @@
|
|||
use values::specified::AllowQuirks;
|
||||
use values::specified::position::Position;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
// Vec grows from 0 to 4 by default on first push(). So allocate with
|
||||
// capacity 1, so in the common case of only one item we don't way
|
||||
// overallocate. Note that we always push at least one item if parsing
|
||||
|
|
|
@ -24,8 +24,10 @@ ${helpers.four_sides_shorthand(
|
|||
use values::generics::rect::Rect;
|
||||
use values::specified::{AllowQuirks, BorderSideWidth};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let rect = Rect::parse_with(context, input, |_, i| {
|
||||
BorderSideWidth::parse_quirky(context, i, AllowQuirks::Yes)
|
||||
})?;
|
||||
|
@ -48,10 +50,10 @@ ${helpers.four_sides_shorthand(
|
|||
</%helpers:shorthand>
|
||||
|
||||
|
||||
pub fn parse_border<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<(specified::Color,
|
||||
specified::BorderStyle,
|
||||
specified::BorderSideWidth), ParseError<'i>> {
|
||||
pub fn parse_border<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<(specified::Color, specified::BorderStyle, specified::BorderSideWidth), ParseError<'i>> {
|
||||
use values::specified::{Color, BorderStyle, BorderSideWidth};
|
||||
let _unused = context;
|
||||
let mut color = None;
|
||||
|
@ -106,8 +108,10 @@ pub fn parse_border<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
|||
alias="${maybe_moz_logical_alias(product, (side, logical), '-moz-border-%s')}"
|
||||
spec="${spec}">
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let (color, style, width) = super::parse_border(context, input)?;
|
||||
Ok(expanded! {
|
||||
border_${to_rust_ident(side)}_color: color,
|
||||
|
@ -138,8 +142,10 @@ pub fn parse_border<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
|||
for name in ['outset', 'repeat', 'slice', 'source', 'width'])}"
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#border">
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
use properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
|
||||
use properties::longhands::{border_image_source, border_image_width};
|
||||
|
||||
|
@ -207,8 +213,10 @@ pub fn parse_border<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
|||
use values::specified::border::BorderRadius;
|
||||
use parser::Parse;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let radii = BorderRadius::parse(context, input)?;
|
||||
Ok(expanded! {
|
||||
border_top_left_radius: radii.top_left,
|
||||
|
@ -242,8 +250,10 @@ pub fn parse_border<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
|||
use properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
|
||||
use properties::longhands::{border_image_source, border_image_width};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
% for name in "outset repeat slice source width".split():
|
||||
let mut border_image_${name} = border_image_${name}::get_initial_specified_value();
|
||||
% endfor
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
use properties::longhands::overflow_x::SpecifiedValue;
|
||||
% endif
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
% if product == "gecko":
|
||||
let moz_kw_found = input.try(|input| {
|
||||
try_match_ident_ignore_ascii_case! { input,
|
||||
|
@ -118,8 +120,10 @@ macro_rules! try_parse_one {
|
|||
use properties::longhands::transition_${prop};
|
||||
% endfor
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
struct SingleTransition {
|
||||
% for prop in "duration timing_function delay".split():
|
||||
transition_${prop}: transition_${prop}::SingleSpecifiedValue,
|
||||
|
@ -129,8 +133,10 @@ macro_rules! try_parse_one {
|
|||
transition_property: Option<transition_property::SingleSpecifiedValue>,
|
||||
}
|
||||
|
||||
fn parse_one_transition<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<SingleTransition,ParseError<'i>> {
|
||||
fn parse_one_transition<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<SingleTransition,ParseError<'i>> {
|
||||
% for prop in "property duration timing_function delay".split():
|
||||
let mut ${prop} = None;
|
||||
% endfor
|
||||
|
@ -260,16 +266,20 @@ macro_rules! try_parse_one {
|
|||
use properties::longhands::animation_${prop};
|
||||
% endfor
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
struct SingleAnimation {
|
||||
% for prop in props:
|
||||
animation_${prop}: animation_${prop}::SingleSpecifiedValue,
|
||||
% endfor
|
||||
}
|
||||
|
||||
fn parse_one_animation<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<SingleAnimation,ParseError<'i>> {
|
||||
fn parse_one_animation<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<SingleAnimation, ParseError<'i>> {
|
||||
% for prop in props:
|
||||
let mut ${prop} = None;
|
||||
% endfor
|
||||
|
@ -364,8 +374,10 @@ macro_rules! try_parse_one {
|
|||
spec="https://drafts.csswg.org/css-scroll-snap/#propdef-scroll-snap-type">
|
||||
use properties::longhands::scroll_snap_type_x;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let result = scroll_snap_type_x::parse(context, input)?;
|
||||
Ok(expanded! {
|
||||
scroll_snap_type_x: result,
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
extra_prefixes="moz" spec="https://drafts.csswg.org/css-multicol/#propdef-columns">
|
||||
use properties::longhands::{column_count, column_width};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let mut column_count = None;
|
||||
let mut column_width = None;
|
||||
let mut autos = 0;
|
||||
|
@ -61,8 +62,10 @@
|
|||
use properties::longhands::{column_rule_width, column_rule_style};
|
||||
use properties::longhands::column_rule_color;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
% for name in "width style color".split():
|
||||
let mut column_rule_${name} = None;
|
||||
% endfor
|
||||
|
|
|
@ -42,8 +42,10 @@
|
|||
% endif
|
||||
use self::font_family::SpecifiedValue as FontFamily;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let mut nb_normals = 0;
|
||||
let mut style = None;
|
||||
let mut variant_caps = None;
|
||||
|
@ -262,8 +264,10 @@
|
|||
#[allow(unused_imports)]
|
||||
use values::specified::FontVariantLigatures;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
% for prop in sub_properties:
|
||||
let mut ${prop} = None;
|
||||
% endfor
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
spec="https://www.w3.org/TR/SVG2/painting.html#MarkerShorthand">
|
||||
use values::specified::UrlOrNone;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
use parser::Parse;
|
||||
let url = UrlOrNone::parse(context, input)?;
|
||||
|
||||
|
|
|
@ -10,8 +10,10 @@
|
|||
spec="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-property">
|
||||
use properties::longhands::{text_emphasis_color, text_emphasis_style};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let mut color = None;
|
||||
let mut style = None;
|
||||
|
||||
|
@ -52,8 +54,10 @@
|
|||
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
|
||||
use properties::longhands::{_webkit_text_stroke_color, _webkit_text_stroke_width};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let mut color = None;
|
||||
let mut width = None;
|
||||
loop {
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
use properties::longhands::{list_style_image, list_style_position, list_style_type};
|
||||
use values::{Either, None_};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
// `none` is ambiguous until we've finished parsing the shorthands, so we count the number
|
||||
// of times we see it.
|
||||
let mut nones = 0u8;
|
||||
|
|
|
@ -36,8 +36,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
% for name in "image mode position_x position_y size repeat origin clip composite".split():
|
||||
// Vec grows from 0 to 4 by default on first push(). So allocate
|
||||
// with capacity 1, so in the common case of only one item we don't
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
use values::specified;
|
||||
use parser::Parse;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let _unused = context;
|
||||
let mut color = None;
|
||||
let mut style = None;
|
||||
|
@ -64,8 +66,10 @@
|
|||
use values::specified::border::BorderRadius;
|
||||
use parser::Parse;
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let radii = BorderRadius::parse(context, input)?;
|
||||
Ok(expanded! {
|
||||
_moz_outline_radius_topleft: radii.top_left,
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
spec="https://drafts.csswg.org/css-flexbox/#flex-flow-property">
|
||||
use properties::longhands::{flex_direction, flex_wrap};
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let mut direction = None;
|
||||
let mut wrap = None;
|
||||
loop {
|
||||
|
|
|
@ -16,8 +16,10 @@
|
|||
use properties::longhands::text_decoration_line;
|
||||
% endif
|
||||
|
||||
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Longhands, ParseError<'i>> {
|
||||
pub fn parse_value<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
% if product == "gecko":
|
||||
let (mut line, mut style, mut color, mut any) = (None, None, None, false);
|
||||
% else:
|
||||
|
|
|
@ -601,17 +601,20 @@ impl Length {
|
|||
|
||||
/// Parse a non-negative length
|
||||
#[inline]
|
||||
pub fn parse_non_negative<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
|
||||
-> Result<Length, ParseError<'i>> {
|
||||
pub fn parse_non_negative<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
Self::parse_non_negative_quirky(context, input, AllowQuirks::No)
|
||||
}
|
||||
|
||||
/// Parse a non-negative length, allowing quirks.
|
||||
#[inline]
|
||||
pub fn parse_non_negative_quirky<'i, 't>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks)
|
||||
-> Result<Length, ParseError<'i>> {
|
||||
pub fn parse_non_negative_quirky<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
Self::parse_internal(context, input, AllowedNumericType::NonNegative, allow_quirks)
|
||||
}
|
||||
|
||||
|
@ -630,10 +633,11 @@ impl Parse for Length {
|
|||
|
||||
impl Length {
|
||||
/// Parses a length, with quirks.
|
||||
pub fn parse_quirky<'i, 't>(context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks)
|
||||
-> Result<Self, ParseError<'i>> {
|
||||
pub fn parse_quirky<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
allow_quirks: AllowQuirks,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
Self::parse_internal(context, input, AllowedNumericType::All, allow_quirks)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -317675,6 +317675,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"css/cssom-view/cssom-getBoxQuads-001.html": [
|
||||
[
|
||||
"/css/cssom-view/cssom-getBoxQuads-001.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/cssom-view/cssom-getClientRects-002.html": [
|
||||
[
|
||||
"/css/cssom-view/cssom-getClientRects-002.html",
|
||||
|
@ -531066,6 +531072,10 @@
|
|||
"8dfaa313b4abad30281d07ce22ac06a61754cc06",
|
||||
"testharness"
|
||||
],
|
||||
"css/cssom-view/cssom-getBoxQuads-001.html": [
|
||||
"6236946f2eb29b2fdb3e7b3c1152ef275d921759",
|
||||
"testharness"
|
||||
],
|
||||
"css/cssom-view/cssom-getClientRects-002.html": [
|
||||
"da348da01e09474f652ff1dfb6869665740668d5",
|
||||
"testharness"
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[auto-margins-001.html]
|
||||
expected: FAIL
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CSSOM View - getBoxQuads() returns proper border and margin boxes for block and flex</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#the-geometryutils-interface">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
background-color: gray;
|
||||
}
|
||||
span {
|
||||
display: block;
|
||||
background: gold;
|
||||
height: 4px;
|
||||
width: 14px;
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
border: 3px solid blue;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<span id="block-block"></span>
|
||||
</div>
|
||||
|
||||
<div class="container" style="display:flex">
|
||||
<span id="flex-block"></span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
let bb = document.getElementById("block-block");
|
||||
assert_equals(bb.getBoxQuads({box: "border"})[0].bounds.width, 20, "Block layout border box is expected width.");
|
||||
assert_equals(bb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Block layout margin box is expected width.");
|
||||
|
||||
// For containers that expand items to fill block-axis space, measure the box heights also.
|
||||
let fb = document.getElementById("flex-block");
|
||||
assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.width, 20, "Flex layout border box is expected width.");
|
||||
assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Flex layout margin box is expected width.");
|
||||
|
||||
assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.height, 10, "Flex layout border box is expected height.");
|
||||
assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.height, 50, "Flex layout margin box is expected height.");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -3407,10 +3407,10 @@ class BookmarkMerger {
|
|||
this.deleteRemotely = new Set();
|
||||
this.structureCounts = {
|
||||
new: 0,
|
||||
remoteItemDel: 0,
|
||||
localFolderDel: 0,
|
||||
localItemDel: 0,
|
||||
remoteFolderDel: 0,
|
||||
remoteRevives: 0, // Remote non-folder change wins over local deletion.
|
||||
localDeletes: 0, // Local folder deletion wins over remote change.
|
||||
localRevives: 0, // Local non-folder change wins over remote deletion.
|
||||
remoteDeletes: 0, // Remote folder deletion wins over local change.
|
||||
};
|
||||
this.dupeCount = 0;
|
||||
this.extraTelemetryEvents = [];
|
||||
|
@ -4108,7 +4108,7 @@ class BookmarkMerger {
|
|||
MirrorLog.trace("Remote non-folder ${remoteNode} deleted locally " +
|
||||
"and changed remotely; taking remote change",
|
||||
{ remoteNode });
|
||||
this.structureCounts.remoteItemDel++;
|
||||
this.structureCounts.remoteRevives++;
|
||||
return BookmarkMerger.STRUCTURE.UNCHANGED;
|
||||
}
|
||||
// For folders, we always take the local deletion and relocate remotely
|
||||
|
@ -4118,7 +4118,7 @@ class BookmarkMerger {
|
|||
MirrorLog.trace("Remote folder ${remoteNode} deleted locally " +
|
||||
"and changed remotely; taking local deletion",
|
||||
{ remoteNode });
|
||||
this.structureCounts.localFolderDel++;
|
||||
this.structureCounts.localDeletes++;
|
||||
} else {
|
||||
MirrorLog.trace("Remote node ${remoteNode} deleted locally and not " +
|
||||
"changed remotely; taking local deletion",
|
||||
|
@ -4177,12 +4177,12 @@ class BookmarkMerger {
|
|||
if (!localNode.isFolder()) {
|
||||
MirrorLog.trace("Local non-folder ${localNode} deleted remotely and " +
|
||||
"changed locally; taking local change", { localNode });
|
||||
this.structureCounts.localItemDel++;
|
||||
this.structureCounts.localRevives++;
|
||||
return BookmarkMerger.STRUCTURE.UNCHANGED;
|
||||
}
|
||||
MirrorLog.trace("Local folder ${localNode} deleted remotely and " +
|
||||
"changed locally; taking remote deletion", { localNode });
|
||||
this.structureCounts.remoteFolderDel++;
|
||||
this.structureCounts.remoteDeletes++;
|
||||
} else {
|
||||
MirrorLog.trace("Local node ${localNode} deleted remotely and not " +
|
||||
"changed locally; taking remote deletion", { localNode });
|
||||
|
|
|
@ -114,7 +114,7 @@ add_task(async function test_complex_orphaning() {
|
|||
deepEqual(await buf.fetchUnmergedGuids(), [], "Should merge all items");
|
||||
deepEqual(mergeTelemetryEvents, [{
|
||||
value: "structure",
|
||||
extra: { new: "2", localFolderDel: "1", remoteFolderDel: "1" },
|
||||
extra: { new: "2", localDeletes: "1", remoteDeletes: "1" },
|
||||
}], "Should record telemetry with structure change counts");
|
||||
|
||||
let idsToUpload = inspectChangeRecords(changesToUpload);
|
||||
|
@ -306,7 +306,7 @@ add_task(async function test_locally_modified_remotely_deleted() {
|
|||
deepEqual(await buf.fetchUnmergedGuids(), [], "Should merge all items");
|
||||
deepEqual(mergeTelemetryEvents, [{
|
||||
value: "structure",
|
||||
extra: { new: "1", localItemDel: "1", remoteFolderDel: "2" },
|
||||
extra: { new: "1", localRevives: "1", remoteDeletes: "2" },
|
||||
}], "Should record telemetry for local item and remote folder deletions");
|
||||
|
||||
let idsToUpload = inspectChangeRecords(changesToUpload);
|
||||
|
@ -453,7 +453,7 @@ add_task(async function test_locally_deleted_remotely_modified() {
|
|||
deepEqual(await buf.fetchUnmergedGuids(), [], "Should merge all items");
|
||||
deepEqual(mergeTelemetryEvents, [{
|
||||
value: "structure",
|
||||
extra: { new: "1", remoteItemDel: "1", localFolderDel: "2" },
|
||||
extra: { new: "1", remoteRevives: "1", localDeletes: "2" },
|
||||
}], "Should record telemetry for remote item and local folder deletions");
|
||||
|
||||
let idsToUpload = inspectChangeRecords(changesToUpload);
|
||||
|
|
|
@ -49,6 +49,12 @@ var InlineSpellCheckerContent = {
|
|||
enableRealTimeSpell: false };
|
||||
}
|
||||
|
||||
if (spellChecker.initialSpellCheckPending) {
|
||||
return { canSpellCheck: true,
|
||||
initialSpellCheckPending: true,
|
||||
enableRealTimeSpell: true };
|
||||
}
|
||||
|
||||
let dictionaryList = {};
|
||||
let realSpellChecker = spellChecker.mInlineSpellChecker.spellChecker;
|
||||
realSpellChecker.GetDictionaryList(dictionaryList, {});
|
||||
|
|
Загрузка…
Ссылка в новой задаче