From fc9bd7e335bc4fb1b05f278cafefda6d8977d642 Mon Sep 17 00:00:00 2001 From: Lars T Hansen Date: Wed, 31 Oct 2018 12:36:22 +0100 Subject: [PATCH 01/50] Bug 1502030 - Encode memory/table operand as varuint32 in bulkmem ops. r=jseward A spec change requires us to change our reader operation from FixedU8 to VarU32, not a big deal, and backward compatible with all tests and content. --HG-- extra : rebase_source : 7ffa913727c35802f4ba355b85de161d843c0e30 extra : histedit_source : db755f9bbbdd634a01114dffbf45ed8ad10c54ec --- .../jit-test/tests/wasm/passive-segs-nonboundary.js | 1 + js/src/wasm/WasmOpIter.h | 12 ++++++------ js/src/wasm/WasmTextToBinary.cpp | 8 +++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/js/src/jit-test/tests/wasm/passive-segs-nonboundary.js b/js/src/jit-test/tests/wasm/passive-segs-nonboundary.js index 1c7bf502d4dc..d32f105046d5 100644 --- a/js/src/jit-test/tests/wasm/passive-segs-nonboundary.js +++ b/js/src/jit-test/tests/wasm/passive-segs-nonboundary.js @@ -370,6 +370,7 @@ function checkMiscPrefixed(opcode, expect_failure) { checkMiscPrefixed([0x0a, 0x00], false); // memory.copy, flags=0 checkMiscPrefixed([0x0b, 0x00], false); // memory.fill, flags=0 +checkMiscPrefixed([0x0b, 0x80, 0x00], false); // memory.fill, flags=0 (long encoding) checkMiscPrefixed([0x0f], true); // table.copy+1, which is currently unassigned //----------------------------------------------------------- diff --git a/js/src/wasm/WasmOpIter.h b/js/src/wasm/WasmOpIter.h index cc4f43d7639a..1ca7956b3493 100644 --- a/js/src/wasm/WasmOpIter.h +++ b/js/src/wasm/WasmOpIter.h @@ -2055,8 +2055,8 @@ OpIter::readMemOrTableCopy(bool isMem, Value* dst, Value* src, Value* le } } - uint8_t memOrTableFlags; - if (!readFixedU8(&memOrTableFlags)) { + uint32_t memOrTableFlags; + if (!readVarU32(&memOrTableFlags)) { return fail(isMem ? "unable to read memory flags" : "unable to read table flags"); } if (memOrTableFlags != 0) { @@ -2122,8 +2122,8 @@ OpIter::readMemFill(Value* start, Value* val, Value* len) return fail("can't touch memory without memory"); } - uint8_t memoryFlags; - if (!readFixedU8(&memoryFlags)) { + uint32_t memoryFlags; + if (!readVarU32(&memoryFlags)) { return fail("unable to read memory flags"); } if (memoryFlags != 0) { @@ -2174,8 +2174,8 @@ OpIter::readMemOrTableInit(bool isMem, uint32_t* segIndex, return false; } - uint8_t memOrTableFlags; - if (!readFixedU8(&memOrTableFlags)) { + uint32_t memOrTableFlags; + if (!readVarU32(&memOrTableFlags)) { return fail(isMem ? "unable to read memory flags" : "unable to read table flags"); } if (memOrTableFlags != 0) { diff --git a/js/src/wasm/WasmTextToBinary.cpp b/js/src/wasm/WasmTextToBinary.cpp index 2d4aed305dd7..9bd22acd61ed 100644 --- a/js/src/wasm/WasmTextToBinary.cpp +++ b/js/src/wasm/WasmTextToBinary.cpp @@ -6290,8 +6290,6 @@ EncodeWake(Encoder& e, AstWake& s) } #ifdef ENABLE_WASM_BULKMEM_OPS -static const uint8_t DEFAULT_MEM_TABLE_FLAGS = 0; - static bool EncodeMemOrTableCopy(Encoder& e, AstMemOrTableCopy& s) { @@ -6299,7 +6297,7 @@ EncodeMemOrTableCopy(Encoder& e, AstMemOrTableCopy& s) EncodeExpr(e, s.src()) && EncodeExpr(e, s.len()) && e.writeOp(s.isMem() ? MiscOp::MemCopy : MiscOp::TableCopy) && - e.writeFixedU8(DEFAULT_MEM_TABLE_FLAGS); + e.writeVarU32(uint32_t(MemoryTableFlags::Default)); } static bool @@ -6316,7 +6314,7 @@ EncodeMemFill(Encoder& e, AstMemFill& s) EncodeExpr(e, s.val()) && EncodeExpr(e, s.len()) && e.writeOp(MiscOp::MemFill) && - e.writeFixedU8(DEFAULT_MEM_TABLE_FLAGS); + e.writeVarU32(uint32_t(MemoryTableFlags::Default)); } static bool @@ -6326,7 +6324,7 @@ EncodeMemOrTableInit(Encoder& e, AstMemOrTableInit& s) EncodeExpr(e, s.src()) && EncodeExpr(e, s.len()) && e.writeOp(s.isMem() ? MiscOp::MemInit : MiscOp::TableInit) && - e.writeFixedU8(DEFAULT_MEM_TABLE_FLAGS) && + e.writeVarU32(uint32_t(MemoryTableFlags::Default)) && e.writeVarU32(s.segIndex()); } #endif From c344ca3a7acd1ce0ae6484c015904a831310ae6f Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Mon, 12 Nov 2018 10:32:13 +0100 Subject: [PATCH 02/50] Bug 1506493 - Update Rust nightly version for Mac cross-compilation. r=me DONTBUILD as the code coverage build is mozilla-central only --HG-- extra : rebase_source : 94d75e99dde2938150d0ca867fb706963c856ef2 extra : histedit_source : 8284f911201465cfe71b26c75bf048f47b8710f7 --- taskcluster/ci/toolchain/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskcluster/ci/toolchain/linux.yml b/taskcluster/ci/toolchain/linux.yml index f20d1bc19fad..1faf9f20f01f 100755 --- a/taskcluster/ci/toolchain/linux.yml +++ b/taskcluster/ci/toolchain/linux.yml @@ -575,7 +575,7 @@ linux64-rust-nightly-macos: using: toolchain-script script: repack_rust.py arguments: [ - '--channel', 'nightly-2018-09-16', + '--channel', 'nightly-2018-10-05', '--host', 'x86_64-unknown-linux-gnu', '--target', 'x86_64-unknown-linux-gnu', '--target', 'x86_64-apple-darwin', From c316a1e4520c45226bd30e92cecc7a3b0651974c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 12 Nov 2018 11:19:24 +0100 Subject: [PATCH 03/50] No bug - Remove outdated comment. --- servo/components/style/values/specified/box.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/servo/components/style/values/specified/box.rs b/servo/components/style/values/specified/box.rs index a5761d3f9b23..b8e38da37a72 100644 --- a/servo/components/style/values/specified/box.rs +++ b/servo/components/style/values/specified/box.rs @@ -52,9 +52,6 @@ fn moz_box_display_values_enabled(context: &ParserContext) -> bool { /// If you change it, make sure to take a look at the /// FrameConstructionDataByDisplay stuff (both the XUL and non-XUL version), and /// ensure it's still correct! -/// -/// Also, when you change this from Gecko you may need to regenerate the -/// C++-side bindings (see components/style/cbindgen.toml). #[allow(missing_docs)] #[derive( Clone, From 47eb45a0b57c78e96a6d6db482592eb499534002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 17:57:41 +0100 Subject: [PATCH 04/50] Bug 1492958 - Move user-select outside of mako. r=xidorn This is the first step to unprefix user-select. This has no behavior change, it's just a nicer way to do the same thing which allows us to unship individual values more easily using parse(condition). Differential Revision: https://phabricator.services.mozilla.com/D11580 --- layout/style/ServoBindings.toml | 1 + layout/style/ServoCSSPropList.mako.py | 1 + layout/style/nsStyleConsts.h | 14 -------- servo/components/style/cbindgen.toml | 1 + servo/components/style/properties/data.py | 1 + .../components/style/properties/gecko.mako.rs | 1 + .../style/properties/longhands/ui.mako.rs | 11 +++--- servo/components/style/values/computed/mod.rs | 2 +- servo/components/style/values/computed/ui.rs | 2 +- .../components/style/values/specified/mod.rs | 2 +- servo/components/style/values/specified/ui.rs | 36 +++++++++++++++++++ 11 files changed, 49 insertions(+), 23 deletions(-) diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index 4ed046ddeacb..dc27c0f73858 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -396,6 +396,7 @@ cbindgen-types = [ { gecko = "StylePathCommand", servo = "values::specified::svg_path::PathCommand" }, { gecko = "StyleUnicodeRange", servo = "cssparser::UnicodeRange" }, { gecko = "StyleOverflowWrap", servo = "values::computed::OverflowWrap" }, + { gecko = "StyleUserSelect", servo = "values::computed::UserSelect" }, ] mapped-generic-types = [ diff --git a/layout/style/ServoCSSPropList.mako.py b/layout/style/ServoCSSPropList.mako.py index 0ede99179e22..bef0ccf71088 100644 --- a/layout/style/ServoCSSPropList.mako.py +++ b/layout/style/ServoCSSPropList.mako.py @@ -110,6 +110,7 @@ SERIALIZED_PREDEFINED_TYPES = [ "Translate", "TimingFunction", "TransformStyle", + "UserSelect", "background::BackgroundSize", "basic_shape::ClippingShape", "basic_shape::FloatAreaShape", diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index 58c7688dadbe..fe862238af62 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -223,20 +223,6 @@ enum class StyleUserFocus : uint8_t { SelectMenu, }; -// user-select -enum class StyleUserSelect : uint8_t { - None, - Text, - Element, - Elements, - All, - Toggle, - TriState, - Auto, // internal value - please use nsFrame::IsSelectable() - MozAll, // force selection of all children, unless an ancestor has NONE set - bug 48096 - MozText, // Like TEXT, except that it won't get overridden by ancestors having ALL. -}; - // user-input enum class StyleUserInput : uint8_t { None, diff --git a/servo/components/style/cbindgen.toml b/servo/components/style/cbindgen.toml index 06c1730622a2..d9efc9d9e18b 100644 --- a/servo/components/style/cbindgen.toml +++ b/servo/components/style/cbindgen.toml @@ -53,5 +53,6 @@ include = [ "TimingFunction", "PathCommand", "UnicodeRange", + "UserSelect", ] item_types = ["enums", "structs", "typedefs"] diff --git a/servo/components/style/properties/data.py b/servo/components/style/properties/data.py index 10f64484693e..97e2f7f0d84d 100644 --- a/servo/components/style/properties/data.py +++ b/servo/components/style/properties/data.py @@ -336,6 +336,7 @@ class Longhand(object): "TextEmphasisPosition", "TouchAction", "TransformStyle", + "UserSelect", "XSpan", "XTextZoom", "ZIndex", diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index b845d3826234..2cc8cf2bcd39 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -1429,6 +1429,7 @@ impl Clone for ${style_struct.gecko_struct_name} { "SVGWidth": impl_svg_length, "Transform": impl_transform, "TransformOrigin": impl_transform_origin, + "UserSelect": impl_simple, "url::UrlOrNone": impl_css_url, } diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs index b8a188d896b3..b73792104cb7 100644 --- a/servo/components/style/properties/longhands/ui.mako.rs +++ b/servo/components/style/properties/longhands/ui.mako.rs @@ -31,16 +31,15 @@ ${helpers.single_keyword( spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width" )} -${helpers.single_keyword( +${helpers.predefined_type( "-moz-user-select", - "auto text none all element elements toggle tri-state -moz-all -moz-text", + "UserSelect", + "computed::UserSelect::Auto", products="gecko", - alias="-webkit-user-select", gecko_ffi_name="mUserSelect", - gecko_enum_prefix="StyleUserSelect", - gecko_strip_moz_prefix=False, - aliases="-moz-none=none", + alias="-webkit-user-select", animation_value_type="discrete", + needs_context=False, spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select", )} diff --git a/servo/components/style/values/computed/mod.rs b/servo/components/style/values/computed/mod.rs index e24472a80687..b8484a291ab0 100644 --- a/servo/components/style/values/computed/mod.rs +++ b/servo/components/style/values/computed/mod.rs @@ -84,7 +84,7 @@ pub use self::transform::{Rotate, Scale, Transform, TransformOperation}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; #[cfg(feature = "gecko")] pub use self::ui::CursorImage; -pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon}; +pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect}; pub use super::specified::{BorderStyle, TextDecorationLine}; pub use super::{Auto, Either, None_}; pub use app_units::Au; diff --git a/servo/components/style/values/computed/ui.rs b/servo/components/style/values/computed/ui.rs index 57990d84d794..7d4a5c6a1ce3 100644 --- a/servo/components/style/values/computed/ui.rs +++ b/servo/components/style/values/computed/ui.rs @@ -10,7 +10,7 @@ use crate::values::computed::Number; use crate::values::generics::ui as generics; use crate::values::{Auto, Either}; -pub use crate::values::specified::ui::MozForceBrokenImageIcon; +pub use crate::values::specified::ui::{MozForceBrokenImageIcon, UserSelect}; /// auto | pub type ColorOrAuto = Either; diff --git a/servo/components/style/values/specified/mod.rs b/servo/components/style/values/specified/mod.rs index 3b7a3d0e04e6..bcca8ed8f49a 100644 --- a/servo/components/style/values/specified/mod.rs +++ b/servo/components/style/values/specified/mod.rs @@ -82,7 +82,7 @@ pub use self::transform::{Rotate, Scale, Transform}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; #[cfg(feature = "gecko")] pub use self::ui::CursorImage; -pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon}; +pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect}; pub use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent; #[cfg(feature = "gecko")] diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 5adfcaa7f701..f11aae73bc39 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -140,3 +140,39 @@ impl Parse for ScrollbarColor { }) } } + +/// The specified value for the `user-select` property. +/// +/// https://drafts.csswg.org/css-ui-4/#propdef-user-select +#[allow(missing_docs)] +#[derive( + Clone, + Copy, + Debug, + Eq, + MallocSizeOf, + Parse, + PartialEq, + SpecifiedValueInfo, + ToComputedValue, + ToCss, +)] +#[repr(u8)] +pub enum UserSelect { + Auto, + Text, + #[parse(aliases = "-moz-none")] + None, + Element, + Elements, + All, + Toggle, + TriState, + /// Force selection of all children, unless an ancestor has `none` set. + /// + /// See bug 48096. + MozAll, + /// Like `text`, except that it won't get overridden by ancestors having + /// `all`. + MozText, +} From e0b5a6ba3e59b73ef165fb0f5cf765828f00f57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 18:00:49 +0100 Subject: [PATCH 05/50] Bug 1492958 - Remove unimplemented values of the user-select property. r=mats Can't believe we literally had no code to handle them. Differential Revision: https://phabricator.services.mozilla.com/D11581 --- layout/generic/nsFrame.cpp | 2 -- layout/style/test/property_database.js | 2 +- servo/components/style/values/specified/ui.rs | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 22b1aae4bb74..5bc3587fbe2e 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4268,8 +4268,6 @@ nsFrame::HandlePress(nsPresContext* aPresContext, return NS_OK; } - // When implementing StyleUserSelect::Element, StyleUserSelect::Elements and - // StyleUserSelect::Toggle, need to change this logic bool useFrameSelection = (selectStyle == StyleUserSelect::Text); // If the mouse is dragged outside the nearest enclosing scrollable area diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 9d85dea1a2b5..c7682751534e 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2625,7 +2625,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "none", "text", "element", "elements", "all", "toggle", "tri-state", "-moz-all", "-moz-none" ], + other_values: [ "none", "text", "all", "-moz-all", "-moz-none" ], invalid_values: [] }, "background": { diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index f11aae73bc39..37dd4ebc9f22 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -163,11 +163,7 @@ pub enum UserSelect { Text, #[parse(aliases = "-moz-none")] None, - Element, - Elements, All, - Toggle, - TriState, /// Force selection of all children, unless an ancestor has `none` set. /// /// See bug 48096. From 740de114a92b31e88ecdcb61264c63146d04db68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 18:05:49 +0100 Subject: [PATCH 06/50] Bug 1492958 - Remove user-select: -moz-all. r=mats It's an attempt of an alias to `all`, except it doesn't get handled in all places. Seems unused both in comm-central and mozilla-central, and all external usage I could find is followed by -webkit-user-select: all. Differential Revision: https://phabricator.services.mozilla.com/D11582 --- layout/generic/nsFrame.cpp | 6 +----- layout/style/test/property_database.js | 2 +- servo/components/style/values/specified/ui.rs | 5 +---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 5bc3587fbe2e..3d112d55ff33 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4162,9 +4162,7 @@ nsIFrame::IsSelectable(StyleUserSelect* aSelectStyle) const while (frame) { const nsStyleUIReset* userinterface = frame->StyleUIReset(); switch (userinterface->mUserSelect) { - case StyleUserSelect::All: - case StyleUserSelect::MozAll: - { + case StyleUserSelect::All: { // override the previous values if (selectStyle != StyleUserSelect::MozText) { selectStyle = userinterface->mUserSelect; @@ -4188,8 +4186,6 @@ nsIFrame::IsSelectable(StyleUserSelect* aSelectStyle) const if (selectStyle == StyleUserSelect::Auto || selectStyle == StyleUserSelect::MozText) { selectStyle = StyleUserSelect::Text; - } else if (selectStyle == StyleUserSelect::MozAll) { - selectStyle = StyleUserSelect::All; } // If user tries to select all of a non-editable content, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index c7682751534e..5352c2ae607c 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2625,7 +2625,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "none", "text", "all", "-moz-all", "-moz-none" ], + other_values: [ "none", "text", "all", "-moz-none" ], invalid_values: [] }, "background": { diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 37dd4ebc9f22..6dbf910a6554 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -163,11 +163,8 @@ pub enum UserSelect { Text, #[parse(aliases = "-moz-none")] None, - All, /// Force selection of all children, unless an ancestor has `none` set. - /// - /// See bug 48096. - MozAll, + All, /// Like `text`, except that it won't get overridden by ancestors having /// `all`. MozText, From 3825f8f77ba2c56dbcd7cccdaf880f4cc2526483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 18:16:00 +0100 Subject: [PATCH 07/50] Bug 1492958 - Allow user-select: -moz-text on user-agent stylesheets only. r=mats It's only used in contenteditable.css, and same usage in comm-central. That sheet is loaded as a ua sheet so let's restrict it to that. No relevant external usage either. This value was introduced in bug 1181130. Differential Revision: https://phabricator.services.mozilla.com/D11584 --- .../test/test_non_content_accessible_values.html | 3 +++ .../components/style/properties/longhands/ui.mako.rs | 1 - servo/components/style/values/specified/ui.rs | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/layout/style/test/test_non_content_accessible_values.html b/layout/style/test/test_non_content_accessible_values.html index 02a235d83d99..9ed5ad34f752 100644 --- a/layout/style/test/test_non_content_accessible_values.html +++ b/layout/style/test/test_non_content_accessible_values.html @@ -110,6 +110,9 @@ const NON_CONTENT_ACCESSIBLE_VALUES = { "-moz-mac-vibrant-titlebar-dark", "-moz-mac-vibrant-titlebar-light", ], + "-moz-user-select": [ + "-moz-text", + ], }; if (!SpecialPowers.getBoolPref("layout.css.xul-box-display-values.content.enabled")) { diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs index b73792104cb7..c077d4d8ba8d 100644 --- a/servo/components/style/properties/longhands/ui.mako.rs +++ b/servo/components/style/properties/longhands/ui.mako.rs @@ -39,7 +39,6 @@ ${helpers.predefined_type( gecko_ffi_name="mUserSelect", alias="-webkit-user-select", animation_value_type="discrete", - needs_context=False, spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select", )} diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 6dbf910a6554..067ce312102f 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -141,6 +141,11 @@ impl Parse for ScrollbarColor { } } +fn in_ua_sheet(context: &ParserContext) -> bool { + use crate::stylesheets::Origin; + context.stylesheet_origin == Origin::UserAgent +} + /// The specified value for the `user-select` property. /// /// https://drafts.csswg.org/css-ui-4/#propdef-user-select @@ -167,5 +172,11 @@ pub enum UserSelect { All, /// Like `text`, except that it won't get overridden by ancestors having /// `all`. + /// + /// FIXME(emilio): This only has one use in contenteditable.css, can we find + /// a better way to do this? + /// + /// See bug 1181130. + #[parse(condition = "in_ua_sheet")] MozText, } From 83cfa2a9c0346db60a7f843b1bd0a1dd7d7b9740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 12 Nov 2018 11:51:09 +0100 Subject: [PATCH 08/50] Bug 1492958 - Update the devtools property database. --- devtools/shared/css/generated/properties-db.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index d6bf54407cfd..481a03265925 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -1356,19 +1356,14 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ - "-moz-all", "-moz-none", "-moz-text", "all", "auto", - "element", - "elements", "inherit", "initial", "none", "text", - "toggle", - "tri-state", "unset" ] }, @@ -2752,19 +2747,14 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ - "-moz-all", "-moz-none", "-moz-text", "all", "auto", - "element", - "elements", "inherit", "initial", "none", "text", - "toggle", - "tri-state", "unset" ] }, From abcfe1c1825a9e271ef869b41d03e7c7c71fa3ae Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Mon, 12 Nov 2018 12:59:06 +0100 Subject: [PATCH 09/50] Bug 1500310 - Better scoping for code in IDBObjectStore::GetAddInfo; r=asuth --- dom/indexedDB/IDBObjectStore.cpp | 41 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index a0781901920c..4c8e6d606bad 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -1575,31 +1575,27 @@ IDBObjectStore::GetAddInfo(JSContext* aCx, } // Figure out indexes and the index values to update here. - const nsTArray& indexes = mSpec->indexes(); - uint32_t idxCount = indexes.Length(); - - if (idxCount) { - if (!aValueWrapper.Clone(aCx)) { - return NS_ERROR_DOM_DATA_CLONE_ERR; - } - - // Update idxCount, the structured clone process may trigger content code - // via getters/other which can potentially call CreateIndex/DeleteIndex. - idxCount = indexes.Length(); + if (mSpec->indexes().Length() && !aValueWrapper.Clone(aCx)) { + return NS_ERROR_DOM_DATA_CLONE_ERR; } - aUpdateInfoArray.SetCapacity(idxCount); // Pretty good estimate + { + const nsTArray& indexes = mSpec->indexes(); + uint32_t idxCount = indexes.Length(); - for (uint32_t idxIndex = 0; idxIndex < idxCount; idxIndex++) { - const IndexMetadata& metadata = indexes[idxIndex]; + aUpdateInfoArray.SetCapacity(idxCount); // Pretty good estimate - rv = AppendIndexUpdateInfo(metadata.id(), metadata.keyPath(), - metadata.unique(), metadata.multiEntry(), - metadata.locale(), aCx, aValueWrapper.Value(), - aUpdateInfoArray); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; + for (uint32_t idxIndex = 0; idxIndex < idxCount; idxIndex++) { + const IndexMetadata& metadata = indexes[idxIndex]; + + rv = AppendIndexUpdateInfo(metadata.id(), metadata.keyPath(), + metadata.unique(), metadata.multiEntry(), + metadata.locale(), aCx, aValueWrapper.Value(), + aUpdateInfoArray); + if (NS_WARN_IF(NS_FAILED(rv))) { + return rv; + } } } @@ -1664,6 +1660,11 @@ IDBObjectStore::AddOrPut(JSContext* aCx, return nullptr; } + if (!mTransaction->IsOpen()) { + aRv.Throw(NS_ERROR_DOM_INDEXEDDB_TRANSACTION_INACTIVE_ERR); + return nullptr; + } + // Check the size limit of the serialized message which mainly consists of // a StructuredCloneBuffer, an encoded object key, and the encoded index keys. // kMaxIDBMsgOverhead covers the minor stuff not included in this calculation From cccd9d10837c9c65cfd193fd07157b56681c3c10 Mon Sep 17 00:00:00 2001 From: Margareta Eliza Balazs Date: Mon, 12 Nov 2018 14:36:43 +0200 Subject: [PATCH 10/50] Backed out 5 changesets (bug 1492958) for bc failures in browser/base/content/test/static/browser_parsable_css.js CLOSED TREE Backed out changeset d7c8793ee054 (bug 1492958) Backed out changeset e59edfbbd327 (bug 1492958) Backed out changeset 5e643bc2e17b (bug 1492958) Backed out changeset 59cf251c1a59 (bug 1492958) Backed out changeset edc955448df6 (bug 1492958) --- .../shared/css/generated/properties-db.js | 10 +++++ layout/generic/nsFrame.cpp | 8 +++- layout/style/ServoBindings.toml | 1 - layout/style/ServoCSSPropList.mako.py | 1 - layout/style/nsStyleConsts.h | 14 +++++++ layout/style/test/property_database.js | 2 +- .../test_non_content_accessible_values.html | 3 -- servo/components/style/cbindgen.toml | 1 - servo/components/style/properties/data.py | 1 - .../components/style/properties/gecko.mako.rs | 1 - .../style/properties/longhands/ui.mako.rs | 10 +++-- servo/components/style/values/computed/mod.rs | 2 +- servo/components/style/values/computed/ui.rs | 2 +- .../components/style/values/specified/mod.rs | 2 +- servo/components/style/values/specified/ui.rs | 40 ------------------- 15 files changed, 41 insertions(+), 57 deletions(-) diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 481a03265925..d6bf54407cfd 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -1356,14 +1356,19 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ + "-moz-all", "-moz-none", "-moz-text", "all", "auto", + "element", + "elements", "inherit", "initial", "none", "text", + "toggle", + "tri-state", "unset" ] }, @@ -2747,14 +2752,19 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ + "-moz-all", "-moz-none", "-moz-text", "all", "auto", + "element", + "elements", "inherit", "initial", "none", "text", + "toggle", + "tri-state", "unset" ] }, diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 3d112d55ff33..22b1aae4bb74 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4162,7 +4162,9 @@ nsIFrame::IsSelectable(StyleUserSelect* aSelectStyle) const while (frame) { const nsStyleUIReset* userinterface = frame->StyleUIReset(); switch (userinterface->mUserSelect) { - case StyleUserSelect::All: { + case StyleUserSelect::All: + case StyleUserSelect::MozAll: + { // override the previous values if (selectStyle != StyleUserSelect::MozText) { selectStyle = userinterface->mUserSelect; @@ -4186,6 +4188,8 @@ nsIFrame::IsSelectable(StyleUserSelect* aSelectStyle) const if (selectStyle == StyleUserSelect::Auto || selectStyle == StyleUserSelect::MozText) { selectStyle = StyleUserSelect::Text; + } else if (selectStyle == StyleUserSelect::MozAll) { + selectStyle = StyleUserSelect::All; } // If user tries to select all of a non-editable content, @@ -4264,6 +4268,8 @@ nsFrame::HandlePress(nsPresContext* aPresContext, return NS_OK; } + // When implementing StyleUserSelect::Element, StyleUserSelect::Elements and + // StyleUserSelect::Toggle, need to change this logic bool useFrameSelection = (selectStyle == StyleUserSelect::Text); // If the mouse is dragged outside the nearest enclosing scrollable area diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index dc27c0f73858..4ed046ddeacb 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -396,7 +396,6 @@ cbindgen-types = [ { gecko = "StylePathCommand", servo = "values::specified::svg_path::PathCommand" }, { gecko = "StyleUnicodeRange", servo = "cssparser::UnicodeRange" }, { gecko = "StyleOverflowWrap", servo = "values::computed::OverflowWrap" }, - { gecko = "StyleUserSelect", servo = "values::computed::UserSelect" }, ] mapped-generic-types = [ diff --git a/layout/style/ServoCSSPropList.mako.py b/layout/style/ServoCSSPropList.mako.py index bef0ccf71088..0ede99179e22 100644 --- a/layout/style/ServoCSSPropList.mako.py +++ b/layout/style/ServoCSSPropList.mako.py @@ -110,7 +110,6 @@ SERIALIZED_PREDEFINED_TYPES = [ "Translate", "TimingFunction", "TransformStyle", - "UserSelect", "background::BackgroundSize", "basic_shape::ClippingShape", "basic_shape::FloatAreaShape", diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index fe862238af62..58c7688dadbe 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -223,6 +223,20 @@ enum class StyleUserFocus : uint8_t { SelectMenu, }; +// user-select +enum class StyleUserSelect : uint8_t { + None, + Text, + Element, + Elements, + All, + Toggle, + TriState, + Auto, // internal value - please use nsFrame::IsSelectable() + MozAll, // force selection of all children, unless an ancestor has NONE set - bug 48096 + MozText, // Like TEXT, except that it won't get overridden by ancestors having ALL. +}; + // user-input enum class StyleUserInput : uint8_t { None, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 5352c2ae607c..9d85dea1a2b5 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2625,7 +2625,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "none", "text", "all", "-moz-none" ], + other_values: [ "none", "text", "element", "elements", "all", "toggle", "tri-state", "-moz-all", "-moz-none" ], invalid_values: [] }, "background": { diff --git a/layout/style/test/test_non_content_accessible_values.html b/layout/style/test/test_non_content_accessible_values.html index 9ed5ad34f752..02a235d83d99 100644 --- a/layout/style/test/test_non_content_accessible_values.html +++ b/layout/style/test/test_non_content_accessible_values.html @@ -110,9 +110,6 @@ const NON_CONTENT_ACCESSIBLE_VALUES = { "-moz-mac-vibrant-titlebar-dark", "-moz-mac-vibrant-titlebar-light", ], - "-moz-user-select": [ - "-moz-text", - ], }; if (!SpecialPowers.getBoolPref("layout.css.xul-box-display-values.content.enabled")) { diff --git a/servo/components/style/cbindgen.toml b/servo/components/style/cbindgen.toml index d9efc9d9e18b..06c1730622a2 100644 --- a/servo/components/style/cbindgen.toml +++ b/servo/components/style/cbindgen.toml @@ -53,6 +53,5 @@ include = [ "TimingFunction", "PathCommand", "UnicodeRange", - "UserSelect", ] item_types = ["enums", "structs", "typedefs"] diff --git a/servo/components/style/properties/data.py b/servo/components/style/properties/data.py index 97e2f7f0d84d..10f64484693e 100644 --- a/servo/components/style/properties/data.py +++ b/servo/components/style/properties/data.py @@ -336,7 +336,6 @@ class Longhand(object): "TextEmphasisPosition", "TouchAction", "TransformStyle", - "UserSelect", "XSpan", "XTextZoom", "ZIndex", diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index 2cc8cf2bcd39..b845d3826234 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -1429,7 +1429,6 @@ impl Clone for ${style_struct.gecko_struct_name} { "SVGWidth": impl_svg_length, "Transform": impl_transform, "TransformOrigin": impl_transform_origin, - "UserSelect": impl_simple, "url::UrlOrNone": impl_css_url, } diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs index c077d4d8ba8d..b8a188d896b3 100644 --- a/servo/components/style/properties/longhands/ui.mako.rs +++ b/servo/components/style/properties/longhands/ui.mako.rs @@ -31,13 +31,15 @@ ${helpers.single_keyword( spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width" )} -${helpers.predefined_type( +${helpers.single_keyword( "-moz-user-select", - "UserSelect", - "computed::UserSelect::Auto", + "auto text none all element elements toggle tri-state -moz-all -moz-text", products="gecko", - gecko_ffi_name="mUserSelect", alias="-webkit-user-select", + gecko_ffi_name="mUserSelect", + gecko_enum_prefix="StyleUserSelect", + gecko_strip_moz_prefix=False, + aliases="-moz-none=none", animation_value_type="discrete", spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select", )} diff --git a/servo/components/style/values/computed/mod.rs b/servo/components/style/values/computed/mod.rs index b8484a291ab0..e24472a80687 100644 --- a/servo/components/style/values/computed/mod.rs +++ b/servo/components/style/values/computed/mod.rs @@ -84,7 +84,7 @@ pub use self::transform::{Rotate, Scale, Transform, TransformOperation}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; #[cfg(feature = "gecko")] pub use self::ui::CursorImage; -pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect}; +pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon}; pub use super::specified::{BorderStyle, TextDecorationLine}; pub use super::{Auto, Either, None_}; pub use app_units::Au; diff --git a/servo/components/style/values/computed/ui.rs b/servo/components/style/values/computed/ui.rs index 7d4a5c6a1ce3..57990d84d794 100644 --- a/servo/components/style/values/computed/ui.rs +++ b/servo/components/style/values/computed/ui.rs @@ -10,7 +10,7 @@ use crate::values::computed::Number; use crate::values::generics::ui as generics; use crate::values::{Auto, Either}; -pub use crate::values::specified::ui::{MozForceBrokenImageIcon, UserSelect}; +pub use crate::values::specified::ui::MozForceBrokenImageIcon; /// auto | pub type ColorOrAuto = Either; diff --git a/servo/components/style/values/specified/mod.rs b/servo/components/style/values/specified/mod.rs index bcca8ed8f49a..3b7a3d0e04e6 100644 --- a/servo/components/style/values/specified/mod.rs +++ b/servo/components/style/values/specified/mod.rs @@ -82,7 +82,7 @@ pub use self::transform::{Rotate, Scale, Transform}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; #[cfg(feature = "gecko")] pub use self::ui::CursorImage; -pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect}; +pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon}; pub use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent; #[cfg(feature = "gecko")] diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 067ce312102f..5adfcaa7f701 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -140,43 +140,3 @@ impl Parse for ScrollbarColor { }) } } - -fn in_ua_sheet(context: &ParserContext) -> bool { - use crate::stylesheets::Origin; - context.stylesheet_origin == Origin::UserAgent -} - -/// The specified value for the `user-select` property. -/// -/// https://drafts.csswg.org/css-ui-4/#propdef-user-select -#[allow(missing_docs)] -#[derive( - Clone, - Copy, - Debug, - Eq, - MallocSizeOf, - Parse, - PartialEq, - SpecifiedValueInfo, - ToComputedValue, - ToCss, -)] -#[repr(u8)] -pub enum UserSelect { - Auto, - Text, - #[parse(aliases = "-moz-none")] - None, - /// Force selection of all children, unless an ancestor has `none` set. - All, - /// Like `text`, except that it won't get overridden by ancestors having - /// `all`. - /// - /// FIXME(emilio): This only has one use in contenteditable.css, can we find - /// a better way to do this? - /// - /// See bug 1181130. - #[parse(condition = "in_ua_sheet")] - MozText, -} From 33b3044c08c39a15ca8ca3aa9b46fa53cd260f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 17:57:41 +0100 Subject: [PATCH 11/50] Bug 1492958 - Move user-select outside of mako. r=xidorn This is the first step to unprefix user-select. This has no behavior change, it's just a nicer way to do the same thing which allows us to unship individual values more easily using parse(condition). Differential Revision: https://phabricator.services.mozilla.com/D11580 --- layout/style/ServoBindings.toml | 1 + layout/style/ServoCSSPropList.mako.py | 1 + layout/style/nsStyleConsts.h | 14 -------- servo/components/style/cbindgen.toml | 1 + servo/components/style/properties/data.py | 1 + .../components/style/properties/gecko.mako.rs | 1 + .../style/properties/longhands/ui.mako.rs | 11 +++--- servo/components/style/values/computed/mod.rs | 2 +- servo/components/style/values/computed/ui.rs | 2 +- .../components/style/values/specified/mod.rs | 2 +- servo/components/style/values/specified/ui.rs | 36 +++++++++++++++++++ 11 files changed, 49 insertions(+), 23 deletions(-) diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml index 4ed046ddeacb..dc27c0f73858 100644 --- a/layout/style/ServoBindings.toml +++ b/layout/style/ServoBindings.toml @@ -396,6 +396,7 @@ cbindgen-types = [ { gecko = "StylePathCommand", servo = "values::specified::svg_path::PathCommand" }, { gecko = "StyleUnicodeRange", servo = "cssparser::UnicodeRange" }, { gecko = "StyleOverflowWrap", servo = "values::computed::OverflowWrap" }, + { gecko = "StyleUserSelect", servo = "values::computed::UserSelect" }, ] mapped-generic-types = [ diff --git a/layout/style/ServoCSSPropList.mako.py b/layout/style/ServoCSSPropList.mako.py index 0ede99179e22..bef0ccf71088 100644 --- a/layout/style/ServoCSSPropList.mako.py +++ b/layout/style/ServoCSSPropList.mako.py @@ -110,6 +110,7 @@ SERIALIZED_PREDEFINED_TYPES = [ "Translate", "TimingFunction", "TransformStyle", + "UserSelect", "background::BackgroundSize", "basic_shape::ClippingShape", "basic_shape::FloatAreaShape", diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index 58c7688dadbe..fe862238af62 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -223,20 +223,6 @@ enum class StyleUserFocus : uint8_t { SelectMenu, }; -// user-select -enum class StyleUserSelect : uint8_t { - None, - Text, - Element, - Elements, - All, - Toggle, - TriState, - Auto, // internal value - please use nsFrame::IsSelectable() - MozAll, // force selection of all children, unless an ancestor has NONE set - bug 48096 - MozText, // Like TEXT, except that it won't get overridden by ancestors having ALL. -}; - // user-input enum class StyleUserInput : uint8_t { None, diff --git a/servo/components/style/cbindgen.toml b/servo/components/style/cbindgen.toml index 06c1730622a2..d9efc9d9e18b 100644 --- a/servo/components/style/cbindgen.toml +++ b/servo/components/style/cbindgen.toml @@ -53,5 +53,6 @@ include = [ "TimingFunction", "PathCommand", "UnicodeRange", + "UserSelect", ] item_types = ["enums", "structs", "typedefs"] diff --git a/servo/components/style/properties/data.py b/servo/components/style/properties/data.py index 10f64484693e..97e2f7f0d84d 100644 --- a/servo/components/style/properties/data.py +++ b/servo/components/style/properties/data.py @@ -336,6 +336,7 @@ class Longhand(object): "TextEmphasisPosition", "TouchAction", "TransformStyle", + "UserSelect", "XSpan", "XTextZoom", "ZIndex", diff --git a/servo/components/style/properties/gecko.mako.rs b/servo/components/style/properties/gecko.mako.rs index b845d3826234..2cc8cf2bcd39 100644 --- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -1429,6 +1429,7 @@ impl Clone for ${style_struct.gecko_struct_name} { "SVGWidth": impl_svg_length, "Transform": impl_transform, "TransformOrigin": impl_transform_origin, + "UserSelect": impl_simple, "url::UrlOrNone": impl_css_url, } diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs index b8a188d896b3..b73792104cb7 100644 --- a/servo/components/style/properties/longhands/ui.mako.rs +++ b/servo/components/style/properties/longhands/ui.mako.rs @@ -31,16 +31,15 @@ ${helpers.single_keyword( spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width" )} -${helpers.single_keyword( +${helpers.predefined_type( "-moz-user-select", - "auto text none all element elements toggle tri-state -moz-all -moz-text", + "UserSelect", + "computed::UserSelect::Auto", products="gecko", - alias="-webkit-user-select", gecko_ffi_name="mUserSelect", - gecko_enum_prefix="StyleUserSelect", - gecko_strip_moz_prefix=False, - aliases="-moz-none=none", + alias="-webkit-user-select", animation_value_type="discrete", + needs_context=False, spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select", )} diff --git a/servo/components/style/values/computed/mod.rs b/servo/components/style/values/computed/mod.rs index e24472a80687..b8484a291ab0 100644 --- a/servo/components/style/values/computed/mod.rs +++ b/servo/components/style/values/computed/mod.rs @@ -84,7 +84,7 @@ pub use self::transform::{Rotate, Scale, Transform, TransformOperation}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; #[cfg(feature = "gecko")] pub use self::ui::CursorImage; -pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon}; +pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect}; pub use super::specified::{BorderStyle, TextDecorationLine}; pub use super::{Auto, Either, None_}; pub use app_units::Au; diff --git a/servo/components/style/values/computed/ui.rs b/servo/components/style/values/computed/ui.rs index 57990d84d794..7d4a5c6a1ce3 100644 --- a/servo/components/style/values/computed/ui.rs +++ b/servo/components/style/values/computed/ui.rs @@ -10,7 +10,7 @@ use crate::values::computed::Number; use crate::values::generics::ui as generics; use crate::values::{Auto, Either}; -pub use crate::values::specified::ui::MozForceBrokenImageIcon; +pub use crate::values::specified::ui::{MozForceBrokenImageIcon, UserSelect}; /// auto | pub type ColorOrAuto = Either; diff --git a/servo/components/style/values/specified/mod.rs b/servo/components/style/values/specified/mod.rs index 3b7a3d0e04e6..bcca8ed8f49a 100644 --- a/servo/components/style/values/specified/mod.rs +++ b/servo/components/style/values/specified/mod.rs @@ -82,7 +82,7 @@ pub use self::transform::{Rotate, Scale, Transform}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; #[cfg(feature = "gecko")] pub use self::ui::CursorImage; -pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon}; +pub use self::ui::{ColorOrAuto, Cursor, MozForceBrokenImageIcon, UserSelect}; pub use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent; #[cfg(feature = "gecko")] diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 5adfcaa7f701..f11aae73bc39 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -140,3 +140,39 @@ impl Parse for ScrollbarColor { }) } } + +/// The specified value for the `user-select` property. +/// +/// https://drafts.csswg.org/css-ui-4/#propdef-user-select +#[allow(missing_docs)] +#[derive( + Clone, + Copy, + Debug, + Eq, + MallocSizeOf, + Parse, + PartialEq, + SpecifiedValueInfo, + ToComputedValue, + ToCss, +)] +#[repr(u8)] +pub enum UserSelect { + Auto, + Text, + #[parse(aliases = "-moz-none")] + None, + Element, + Elements, + All, + Toggle, + TriState, + /// Force selection of all children, unless an ancestor has `none` set. + /// + /// See bug 48096. + MozAll, + /// Like `text`, except that it won't get overridden by ancestors having + /// `all`. + MozText, +} From 318ef24ef6ced76f958ca8c29a6e3be80fad0003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 18:00:49 +0100 Subject: [PATCH 12/50] Bug 1492958 - Remove unimplemented values of the user-select property. r=mats Can't believe we literally had no code to handle them. Differential Revision: https://phabricator.services.mozilla.com/D11581 --- layout/generic/nsFrame.cpp | 2 -- layout/style/test/property_database.js | 2 +- servo/components/style/values/specified/ui.rs | 4 ---- toolkit/mozapps/extensions/content/extensions.css | 1 - 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 22b1aae4bb74..5bc3587fbe2e 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4268,8 +4268,6 @@ nsFrame::HandlePress(nsPresContext* aPresContext, return NS_OK; } - // When implementing StyleUserSelect::Element, StyleUserSelect::Elements and - // StyleUserSelect::Toggle, need to change this logic bool useFrameSelection = (selectStyle == StyleUserSelect::Text); // If the mouse is dragged outside the nearest enclosing scrollable area diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 9d85dea1a2b5..c7682751534e 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2625,7 +2625,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "none", "text", "element", "elements", "all", "toggle", "tri-state", "-moz-all", "-moz-none" ], + other_values: [ "none", "text", "all", "-moz-all", "-moz-none" ], invalid_values: [] }, "background": { diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index f11aae73bc39..37dd4ebc9f22 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -163,11 +163,7 @@ pub enum UserSelect { Text, #[parse(aliases = "-moz-none")] None, - Element, - Elements, All, - Toggle, - TriState, /// Force selection of all children, unless an ancestor has `none` set. /// /// See bug 48096. diff --git a/toolkit/mozapps/extensions/content/extensions.css b/toolkit/mozapps/extensions/content/extensions.css index 10285106ebfb..22adb0f8c06e 100644 --- a/toolkit/mozapps/extensions/content/extensions.css +++ b/toolkit/mozapps/extensions/content/extensions.css @@ -58,7 +58,6 @@ xhtml|link { .text-list { white-space: pre-line; - -moz-user-select: element; } row[unsupported="true"] { From e7cb518669249ca1b0182a0680a4e5d9bc6edb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 18:05:49 +0100 Subject: [PATCH 13/50] Bug 1492958 - Remove user-select: -moz-all. r=mats It's an attempt of an alias to `all`, except it doesn't get handled in all places. Seems unused both in comm-central and mozilla-central, and all external usage I could find is followed by -webkit-user-select: all. Differential Revision: https://phabricator.services.mozilla.com/D11582 --- layout/generic/nsFrame.cpp | 6 +----- layout/style/test/property_database.js | 2 +- servo/components/style/values/specified/ui.rs | 5 +---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 5bc3587fbe2e..3d112d55ff33 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4162,9 +4162,7 @@ nsIFrame::IsSelectable(StyleUserSelect* aSelectStyle) const while (frame) { const nsStyleUIReset* userinterface = frame->StyleUIReset(); switch (userinterface->mUserSelect) { - case StyleUserSelect::All: - case StyleUserSelect::MozAll: - { + case StyleUserSelect::All: { // override the previous values if (selectStyle != StyleUserSelect::MozText) { selectStyle = userinterface->mUserSelect; @@ -4188,8 +4186,6 @@ nsIFrame::IsSelectable(StyleUserSelect* aSelectStyle) const if (selectStyle == StyleUserSelect::Auto || selectStyle == StyleUserSelect::MozText) { selectStyle = StyleUserSelect::Text; - } else if (selectStyle == StyleUserSelect::MozAll) { - selectStyle = StyleUserSelect::All; } // If user tries to select all of a non-editable content, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index c7682751534e..5352c2ae607c 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2625,7 +2625,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "none", "text", "all", "-moz-all", "-moz-none" ], + other_values: [ "none", "text", "all", "-moz-none" ], invalid_values: [] }, "background": { diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 37dd4ebc9f22..6dbf910a6554 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -163,11 +163,8 @@ pub enum UserSelect { Text, #[parse(aliases = "-moz-none")] None, - All, /// Force selection of all children, unless an ancestor has `none` set. - /// - /// See bug 48096. - MozAll, + All, /// Like `text`, except that it won't get overridden by ancestors having /// `all`. MozText, From cbc11eb6a324d464ac793819f0f23c160a538543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 11 Nov 2018 18:16:00 +0100 Subject: [PATCH 14/50] Bug 1492958 - Allow user-select: -moz-text on user-agent stylesheets only. r=mats It's only used in contenteditable.css, and same usage in comm-central. That sheet is loaded as a ua sheet so let's restrict it to that. No relevant external usage either. This value was introduced in bug 1181130. Differential Revision: https://phabricator.services.mozilla.com/D11584 --- .../base/content/test/static/browser_parsable_css.js | 4 ++++ .../test/test_non_content_accessible_values.html | 3 +++ .../components/style/properties/longhands/ui.mako.rs | 1 - servo/components/style/values/specified/ui.rs | 11 +++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/browser/base/content/test/static/browser_parsable_css.js b/browser/base/content/test/static/browser_parsable_css.js index 191620901dad..b801bf351483 100644 --- a/browser/base/content/test/static/browser_parsable_css.js +++ b/browser/base/content/test/static/browser_parsable_css.js @@ -48,6 +48,10 @@ let whitelist = [ {sourceName: /(?:res|gre-resources)\/forms\.css$/i, errorMessage: /Error in parsing value for \u2018-moz-appearance\u2019/iu, isFromDevTools: false}, + // -moz-user-select: -moz-text is only enabled to user-agent stylesheets. + {sourceName: /contenteditable.css$/i, + errorMessage: /Error in parsing value for \u2018-moz-user-select\u2019/iu, + isFromDevTools: false}, // These variables are declared somewhere else, and error when we load the // files directly. They're all marked intermittent because their appearance // in the error console seems to not be consistent. diff --git a/layout/style/test/test_non_content_accessible_values.html b/layout/style/test/test_non_content_accessible_values.html index 02a235d83d99..9ed5ad34f752 100644 --- a/layout/style/test/test_non_content_accessible_values.html +++ b/layout/style/test/test_non_content_accessible_values.html @@ -110,6 +110,9 @@ const NON_CONTENT_ACCESSIBLE_VALUES = { "-moz-mac-vibrant-titlebar-dark", "-moz-mac-vibrant-titlebar-light", ], + "-moz-user-select": [ + "-moz-text", + ], }; if (!SpecialPowers.getBoolPref("layout.css.xul-box-display-values.content.enabled")) { diff --git a/servo/components/style/properties/longhands/ui.mako.rs b/servo/components/style/properties/longhands/ui.mako.rs index b73792104cb7..c077d4d8ba8d 100644 --- a/servo/components/style/properties/longhands/ui.mako.rs +++ b/servo/components/style/properties/longhands/ui.mako.rs @@ -39,7 +39,6 @@ ${helpers.predefined_type( gecko_ffi_name="mUserSelect", alias="-webkit-user-select", animation_value_type="discrete", - needs_context=False, spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select", )} diff --git a/servo/components/style/values/specified/ui.rs b/servo/components/style/values/specified/ui.rs index 6dbf910a6554..067ce312102f 100644 --- a/servo/components/style/values/specified/ui.rs +++ b/servo/components/style/values/specified/ui.rs @@ -141,6 +141,11 @@ impl Parse for ScrollbarColor { } } +fn in_ua_sheet(context: &ParserContext) -> bool { + use crate::stylesheets::Origin; + context.stylesheet_origin == Origin::UserAgent +} + /// The specified value for the `user-select` property. /// /// https://drafts.csswg.org/css-ui-4/#propdef-user-select @@ -167,5 +172,11 @@ pub enum UserSelect { All, /// Like `text`, except that it won't get overridden by ancestors having /// `all`. + /// + /// FIXME(emilio): This only has one use in contenteditable.css, can we find + /// a better way to do this? + /// + /// See bug 1181130. + #[parse(condition = "in_ua_sheet")] MozText, } From 9674abaaa82e0c033fd655fe5647d711266f1626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 12 Nov 2018 11:51:09 +0100 Subject: [PATCH 15/50] Bug 1492958 - Update the devtools property database. --- devtools/shared/css/generated/properties-db.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index d6bf54407cfd..481a03265925 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -1356,19 +1356,14 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ - "-moz-all", "-moz-none", "-moz-text", "all", "auto", - "element", - "elements", "inherit", "initial", "none", "text", - "toggle", - "tri-state", "unset" ] }, @@ -2752,19 +2747,14 @@ exports.CSS_PROPERTIES = { ], "supports": [], "values": [ - "-moz-all", "-moz-none", "-moz-text", "all", "auto", - "element", - "elements", "inherit", "initial", "none", "text", - "toggle", - "tri-state", "unset" ] }, From 7797a1a972a09312bc57d349f3139381774818d4 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Mon, 12 Nov 2018 14:44:39 +0100 Subject: [PATCH 16/50] Bug 1387503 - FestStreamReader should cancel the reader when the worker shutdowns, r=jorendorff --- dom/fetch/FetchStreamReader.cpp | 12 ++-- dom/workers/test/chrome.ini | 1 + .../test_readableStream_when_closing.html | 66 +++++++++++++++++++ 3 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 dom/workers/test/test_readableStream_when_closing.html diff --git a/dom/fetch/FetchStreamReader.cpp b/dom/fetch/FetchStreamReader.cpp index b850c0033c83..3a7b18e24285 100644 --- a/dom/fetch/FetchStreamReader.cpp +++ b/dom/fetch/FetchStreamReader.cpp @@ -66,10 +66,14 @@ FetchStreamReader::Create(JSContext* aCx, nsIGlobalObject* aGlobal, RefPtr workerRef = WeakWorkerRef::Create(workerPrivate, [streamReader]() { - // The WorkerPrivate does have a context available, and we could pass - // it here to trigger cancellation of the reader, but the author of - // this comment chickened out. - streamReader->CloseAndRelease(nullptr, NS_ERROR_DOM_INVALID_STATE_ERR); + MOZ_ASSERT(streamReader); + MOZ_ASSERT(streamReader->mWorkerRef); + + WorkerPrivate* workerPrivate = streamReader->mWorkerRef->GetPrivate(); + MOZ_ASSERT(workerPrivate); + + streamReader->CloseAndRelease(workerPrivate->GetJSContext(), + NS_ERROR_DOM_INVALID_STATE_ERR); }); if (NS_WARN_IF(!workerRef)) { diff --git a/dom/workers/test/chrome.ini b/dom/workers/test/chrome.ini index 5964c2d25145..3af1dc0f215a 100644 --- a/dom/workers/test/chrome.ini +++ b/dom/workers/test/chrome.ini @@ -83,3 +83,4 @@ skip-if = (os == 'linux') # Bug 1244409 [test_sharedWorker_privateBrowsing.html] [test_shutdownCheck.xul] support-files = worker_shutdownCheck.js +[test_readableStream_when_closing.html] diff --git a/dom/workers/test/test_readableStream_when_closing.html b/dom/workers/test/test_readableStream_when_closing.html new file mode 100644 index 000000000000..d730c84daf81 --- /dev/null +++ b/dom/workers/test/test_readableStream_when_closing.html @@ -0,0 +1,66 @@ + + + + + Test for ReadableStream+fetch when the worker is closing + + + + + + + + From fc9060ccfdd86ac8e8b09f83c833085d51475d26 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 9 Nov 2018 15:45:32 +0000 Subject: [PATCH 17/50] Bug 1501056 [wpt PR 13657] - WebAssembly: Add tests for invalid code arguments., a=testonly Automatic update from web-platform-testsWebAssembly: Add tests for invalid code arguments. -- wpt-commits: f53205cf5fa7f6a6c546330755c0e4f26068af23 wpt-pr: 13657 --- .../tests/wasm/jsapi/constructor/compile.any.js | 5 +++++ .../wasm/jsapi/constructor/instantiate.any.js | 5 +++++ .../tests/wasm/jsapi/module/constructor.any.js | 5 +++++ .../tests/wasm/webapi/invalid-code.any.js | 16 ++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 testing/web-platform/tests/wasm/webapi/invalid-code.any.js diff --git a/testing/web-platform/tests/wasm/jsapi/constructor/compile.any.js b/testing/web-platform/tests/wasm/jsapi/constructor/compile.any.js index 3ad61edf4b7b..f0d6f7aee4cc 100644 --- a/testing/web-platform/tests/wasm/jsapi/constructor/compile.any.js +++ b/testing/web-platform/tests/wasm/jsapi/constructor/compile.any.js @@ -62,6 +62,11 @@ test(() => { promise_test(t => { const buffer = new Uint8Array(); return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.compile(buffer)); +}, "Empty buffer"); + +test(() => { + const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0])); + assert_throws(new WebAssembly.CompileError(), () => WebAssembly.compile(buffer)); }, "Invalid code"); promise_test(() => { diff --git a/testing/web-platform/tests/wasm/jsapi/constructor/instantiate.any.js b/testing/web-platform/tests/wasm/jsapi/constructor/instantiate.any.js index ae2ad15585fa..97350c5acd2c 100644 --- a/testing/web-platform/tests/wasm/jsapi/constructor/instantiate.any.js +++ b/testing/web-platform/tests/wasm/jsapi/constructor/instantiate.any.js @@ -79,6 +79,11 @@ for (const [name, fn] of instanceTestFactory) { promise_test(t => { const buffer = new Uint8Array(); return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.instantiate(buffer)); +}, "Empty buffer"); + +promise_test(t => { + const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0])); + return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly.instantiate(buffer)); }, "Invalid code"); promise_test(() => { diff --git a/testing/web-platform/tests/wasm/jsapi/module/constructor.any.js b/testing/web-platform/tests/wasm/jsapi/module/constructor.any.js index a467c1a17bb6..2127e2810cb8 100644 --- a/testing/web-platform/tests/wasm/jsapi/module/constructor.any.js +++ b/testing/web-platform/tests/wasm/jsapi/module/constructor.any.js @@ -49,6 +49,11 @@ test(() => { assert_throws(new WebAssembly.CompileError(), () => new WebAssembly.Module(buffer)); }, "Empty buffer"); +test(() => { + const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0])); + assert_throws(new WebAssembly.CompileError(), () => new WebAssembly.Module(buffer)); +}, "Invalid code"); + test(() => { const module = new WebAssembly.Module(emptyModuleBinary); assert_equals(Object.getPrototypeOf(module), WebAssembly.Module.prototype); diff --git a/testing/web-platform/tests/wasm/webapi/invalid-code.any.js b/testing/web-platform/tests/wasm/webapi/invalid-code.any.js new file mode 100644 index 000000000000..e30b7cf33945 --- /dev/null +++ b/testing/web-platform/tests/wasm/webapi/invalid-code.any.js @@ -0,0 +1,16 @@ +// META: global=window,worker +// META: script=/wasm/jsapi/wasm-constants.js +// META: script=/wasm/jsapi/wasm-module-builder.js + +let emptyModuleBinary; +setup(() => { + emptyModuleBinary = new WasmModuleBuilder().toBuffer(); +}); + +for (const method of ["compileStreaming", "instantiateStreaming"]) { + promise_test(t => { + const buffer = new Uint8Array(Array.from(emptyModuleBinary).concat([0, 0])); + const response = new Response(buffer, { headers: { "Content-Type": "application/wasm" } }); + return promise_rejects(t, new WebAssembly.CompileError(), WebAssembly[method](response)); + }, `Invalid code: ${method}`); +} From 88feb63cea71da780d586b99029dcecf52b74cb0 Mon Sep 17 00:00:00 2001 From: moz-wptsync-bot Date: Tue, 23 Oct 2018 04:00:26 +0000 Subject: [PATCH 18/50] Bug 1501056 [wpt PR 13657] - Update wpt metadata, a=testonly wpt-pr: 13657 wpt-type: metadata --- .../meta/wasm/jsapi/constructor/compile.any.js.ini | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 testing/web-platform/meta/wasm/jsapi/constructor/compile.any.js.ini diff --git a/testing/web-platform/meta/wasm/jsapi/constructor/compile.any.js.ini b/testing/web-platform/meta/wasm/jsapi/constructor/compile.any.js.ini new file mode 100644 index 000000000000..b1ab84bdebef --- /dev/null +++ b/testing/web-platform/meta/wasm/jsapi/constructor/compile.any.js.ini @@ -0,0 +1,13 @@ +[compile.any.worker.html] + [Invalid code] + expected: FAIL + + +[compile.any.html] + [Invalid code] + expected: FAIL + + +[compile.any.js] + [Invalid code] + expected: FAIL From f78af13e00f08733bd72d51458a340b157c096c1 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 12 Nov 2018 09:42:09 -0500 Subject: [PATCH 19/50] Bug 1506596 - Update pdf.js to version 2.1.52. r=bdahl --- browser/extensions/pdfjs/README.mozilla | 4 +- browser/extensions/pdfjs/content/build/pdf.js | 10 +- .../pdfjs/content/build/pdf.worker.js | 6 +- .../extensions/pdfjs/content/web/viewer.js | 106 +++++++++++------- browser/extensions/pdfjs/moz.yaml | 2 +- 5 files changed, 79 insertions(+), 49 deletions(-) diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index bfa0cc8060c6..5752422fd330 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 2.1.42 +Current extension version is: 2.1.52 -Taken from upstream commit: 2194aef0 +Taken from upstream commit: 4724ebbc diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index b0c5ea56dbfa..152a0fadecc6 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.1.42'; -var pdfjsBuild = '2194aef0'; +var pdfjsVersion = '2.1.52'; +var pdfjsBuild = '4724ebbc'; var pdfjsSharedUtil = __w_pdfjs_require__(1); var pdfjsDisplayAPI = __w_pdfjs_require__(7); var pdfjsDisplayTextLayer = __w_pdfjs_require__(19); @@ -4226,7 +4226,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { } return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, - apiVersion: '2.1.42', + apiVersion: '2.1.52', source: { data: source.data, url: source.url, @@ -5540,8 +5540,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { }(); var version, build; { - exports.version = version = '2.1.42'; - exports.build = build = '2194aef0'; + exports.version = version = '2.1.52'; + exports.build = build = '4724ebbc'; } exports.getDocument = getDocument; exports.LoopbackPort = LoopbackPort; diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index 148f8c4e41d9..f54b62ccc2a1 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.1.42'; -var pdfjsBuild = '2194aef0'; +var pdfjsVersion = '2.1.52'; +var pdfjsBuild = '4724ebbc'; var pdfjsCoreWorker = __w_pdfjs_require__(1); exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; @@ -326,7 +326,7 @@ var WorkerMessageHandler = { var cancelXHRs = null; var WorkerTasks = []; let apiVersion = docParams.apiVersion; - let workerVersion = '2.1.42'; + let workerVersion = '2.1.52'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); } diff --git a/browser/extensions/pdfjs/content/web/viewer.js b/browser/extensions/pdfjs/content/web/viewer.js index 49b94cbcae07..407606af2849 100644 --- a/browser/extensions/pdfjs/content/web/viewer.js +++ b/browser/extensions/pdfjs/content/web/viewer.js @@ -4045,12 +4045,12 @@ Object.defineProperty(exports, "__esModule", { }); exports.PDFFindController = exports.FindState = undefined; +var _ui_utils = __webpack_require__(2); + var _pdfjsLib = __webpack_require__(3); var _pdf_find_utils = __webpack_require__(16); -var _ui_utils = __webpack_require__(2); - const FindState = { FOUND: 0, NOT_FOUND: 1, @@ -4058,6 +4058,8 @@ const FindState = { PENDING: 3 }; const FIND_TIMEOUT = 250; +const MATCH_SCROLL_OFFSET_TOP = -50; +const MATCH_SCROLL_OFFSET_LEFT = -400; const CHARACTERS_TO_NORMALIZE = { '\u2018': '\'', '\u2019': '\'', @@ -4114,18 +4116,24 @@ class PDFFindController { this._firstPageCapability.resolve(); } executeCommand(cmd, state) { + if (!state) { + return; + } const pdfDocument = this._pdfDocument; - if (this._state === null || this._shouldDirtyMatch(cmd)) { + if (this._state === null || this._shouldDirtyMatch(cmd, state)) { this._dirtyMatch = true; } this._state = state; - this._updateUIState(FindState.PENDING); + if (cmd !== 'findhighlightallchange') { + this._updateUIState(FindState.PENDING); + } this._firstPageCapability.promise.then(() => { if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { return; } this._extractText(); const findbarClosed = !this._highlightMatches; + const pendingTimeout = !!this._findTimeout; if (this._findTimeout) { clearTimeout(this._findTimeout); this._findTimeout = null; @@ -4142,13 +4150,36 @@ class PDFFindController { if (findbarClosed && this._state.highlightAll) { this._updateAllPages(); } + } else if (cmd === 'findhighlightallchange') { + if (pendingTimeout) { + this._nextMatch(); + } else { + this._highlightMatches = true; + } + this._updateAllPages(); } else { this._nextMatch(); } }); } + scrollMatchIntoView({ element = null, pageIndex = -1, matchIndex = -1 }) { + if (!this._scrollMatches || !element) { + return; + } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) { + return; + } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) { + return; + } + this._scrollMatches = false; + const spot = { + top: MATCH_SCROLL_OFFSET_TOP, + left: MATCH_SCROLL_OFFSET_LEFT + }; + (0, _ui_utils.scrollIntoView)(element, spot, true); + } _reset() { this._highlightMatches = false; + this._scrollMatches = false; this._pdfDocument = null; this._pageMatches = []; this._pageMatchesLength = []; @@ -4180,7 +4211,10 @@ class PDFFindController { } return this._normalizedQuery; } - _shouldDirtyMatch(cmd) { + _shouldDirtyMatch(cmd, state) { + if (state.query !== this._state.query) { + return true; + } switch (cmd) { case 'findagain': const pageNumber = this._selected.pageIdx + 1; @@ -4189,6 +4223,8 @@ class PDFFindController { break; } return false; + case 'findhighlightallchange': + return false; } return true; } @@ -4343,7 +4379,7 @@ class PDFFindController { } } _updatePage(index) { - if (this._selected.pageIdx === index) { + if (this._scrollMatches && this._selected.pageIdx === index) { this._linkService.page = index + 1; } this._eventBus.dispatch('updatetextlayermatches', { @@ -4463,6 +4499,7 @@ class PDFFindController { } this._updateUIState(state, this._state.findPrevious); if (this._selected.pageIdx !== -1) { + this._scrollMatches = true; this._updatePage(this._selected.pageIdx); } } @@ -6922,22 +6959,19 @@ class BaseViewer { let pageView = this._pages[this._currentPageNumber - 1]; this._scrollIntoView({ pageDiv: pageView.div }); } - scrollPageIntoView(params) { + scrollPageIntoView({ pageNumber, destArray = null, allowNegativeOffset = false }) { if (!this.pdfDocument) { return; } - let pageNumber = params.pageNumber || 0; - let dest = params.destArray || null; - let allowNegativeOffset = params.allowNegativeOffset || false; - if (this.isInPresentationMode || !dest) { - this._setCurrentPageNumber(pageNumber, true); - return; - } - let pageView = this._pages[pageNumber - 1]; + const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1]; if (!pageView) { console.error(`${this._name}.scrollPageIntoView: Invalid "pageNumber" parameter.`); return; } + if (this.isInPresentationMode || !destArray) { + this._setCurrentPageNumber(pageNumber, true); + return; + } let x = 0, y = 0; let width = 0, @@ -6948,11 +6982,11 @@ class BaseViewer { let pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _ui_utils.CSS_UNITS; let pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _ui_utils.CSS_UNITS; let scale = 0; - switch (dest[1].name) { + switch (destArray[1].name) { case 'XYZ': - x = dest[2]; - y = dest[3]; - scale = dest[4]; + x = destArray[2]; + y = destArray[3]; + scale = destArray[4]; x = x !== null ? x : 0; y = y !== null ? y : pageHeight; break; @@ -6962,7 +6996,7 @@ class BaseViewer { break; case 'FitH': case 'FitBH': - y = dest[2]; + y = destArray[2]; scale = 'page-width'; if (y === null && this._location) { x = this._location.left; @@ -6971,16 +7005,16 @@ class BaseViewer { break; case 'FitV': case 'FitBV': - x = dest[2]; + x = destArray[2]; width = pageWidth; height = pageHeight; scale = 'page-height'; break; case 'FitR': - x = dest[2]; - y = dest[3]; - width = dest[4] - x; - height = dest[5] - y; + x = destArray[2]; + y = destArray[3]; + width = destArray[4] - x; + height = destArray[5] - y; let hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING; let vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING; widthScale = (this.container.clientWidth - hPadding) / width / _ui_utils.CSS_UNITS; @@ -6988,7 +7022,7 @@ class BaseViewer { scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); break; default: - console.error(`${this._name}.scrollPageIntoView: "${dest[1].name}" ` + 'is not a valid destination type.'); + console.error(`${this._name}.scrollPageIntoView: ` + `"${destArray[1].name}" is not a valid destination type.`); return; } if (scale && scale !== this._currentScale) { @@ -6996,7 +7030,7 @@ class BaseViewer { } else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) { this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; } - if (scale === 'page-fit' && !dest[4]) { + if (scale === 'page-fit' && !destArray[4]) { this._scrollIntoView({ pageDiv: pageView.div, pageNumber @@ -7232,7 +7266,7 @@ class BaseViewer { if (this._currentScaleValue && isNaN(this._currentScaleValue)) { this._setScale(this._currentScaleValue, true); } - this.scrollPageIntoView({ pageNumber }); + this._setCurrentPageNumber(pageNumber, true); this.update(); } get spreadMode() { @@ -7281,7 +7315,7 @@ class BaseViewer { if (!pageNumber) { return; } - this.scrollPageIntoView({ pageNumber }); + this._setCurrentPageNumber(pageNumber, true); this.update(); } } @@ -7854,8 +7888,6 @@ var _ui_utils = __webpack_require__(2); var _pdfjsLib = __webpack_require__(3); const EXPAND_DIVS_TIMEOUT = 300; -const MATCH_SCROLL_OFFSET_TOP = -50; -const MATCH_SCROLL_OFFSET_LEFT = -400; class TextLayerBuilder { constructor({ textLayerDiv, eventBus, pageIndex, viewport, findController = null, enhanceTextSelection = false }) { this.textLayerDiv = textLayerDiv; @@ -8013,13 +8045,11 @@ class TextLayerBuilder { let end = match.end; let isSelected = isSelectedPage && i === selectedMatchIdx; let highlightSuffix = isSelected ? ' selected' : ''; - if (findController.selected.matchIdx === i && findController.selected.pageIdx === pageIdx) { - const spot = { - top: MATCH_SCROLL_OFFSET_TOP, - left: MATCH_SCROLL_OFFSET_LEFT - }; - (0, _ui_utils.scrollIntoView)(textDivs[begin.divIdx], spot, true); - } + findController.scrollMatchIntoView({ + element: textDivs[begin.divIdx], + pageIndex: pageIdx, + matchIndex: i + }); if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { if (prevEnd !== null) { appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); diff --git a/browser/extensions/pdfjs/moz.yaml b/browser/extensions/pdfjs/moz.yaml index 7038a2756205..2b98d84b765d 100644 --- a/browser/extensions/pdfjs/moz.yaml +++ b/browser/extensions/pdfjs/moz.yaml @@ -20,7 +20,7 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: version 2.1.42 + release: version 2.1.52 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/ From 852f1694c739bb870d4d82bbd2b0eeaea7260a15 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Fri, 9 Nov 2018 16:04:49 -1000 Subject: [PATCH 20/50] Bug 1506311 - Refine filtering of CGColorSpaceCreateDevice symbols where redirection instructions can be installed. --HG-- extra : rebase_source : d02e7cd81e986f6d253857bd5ca7d17180dcdf46 extra : histedit_source : a68d8ce5c8e7dbad65196068e532c7717ac47064 --- toolkit/recordreplay/ProcessRedirect.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolkit/recordreplay/ProcessRedirect.cpp b/toolkit/recordreplay/ProcessRedirect.cpp index b52331fcc26c..9b5c1c687879 100644 --- a/toolkit/recordreplay/ProcessRedirect.cpp +++ b/toolkit/recordreplay/ProcessRedirect.cpp @@ -468,8 +468,10 @@ MaybeInternalJumpTarget(uint8_t* aIpStart, uint8_t* aIpEnd) !strstr(startName, "CTRunGetPositionsPtr")) || (strstr(startName, "CTRunGetStringIndices") && !strstr(startName, "CTRunGetStringIndicesPtr")) || - strstr(startName, "CGColorSpaceCreateDeviceGray") || - strstr(startName, "CGColorSpaceCreateDeviceRGB") || + (strstr(startName, "CGColorSpaceCreateDeviceGray") && + !strstr(startName, "CGColorSpaceCreateDeviceGray_block_invoke")) || + (strstr(startName, "CGColorSpaceCreateDeviceRGB") && + !strstr(startName, "CGColorSpaceCreateDeviceRGB_block_invoke")) || // For these functions, there is a syscall near the beginning which // other system threads might be inside. strstr(startName, "__workq_kernreturn") || From b7d645db8b1c4dada8ab3cbe716ab99468781793 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Fri, 9 Nov 2018 16:19:33 -1000 Subject: [PATCH 21/50] Bug 1505962 - Add redirection for rand(), r=lsmyth. --HG-- extra : rebase_source : e920fe34cf158a23465c97b27310d5a893d89bdc extra : histedit_source : 02db3f0100ac0dc03f5a98925edf051fda1a9da3 --- toolkit/recordreplay/ProcessRedirectDarwin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/toolkit/recordreplay/ProcessRedirectDarwin.cpp b/toolkit/recordreplay/ProcessRedirectDarwin.cpp index e36dac6e827c..9160291ac4e8 100644 --- a/toolkit/recordreplay/ProcessRedirectDarwin.cpp +++ b/toolkit/recordreplay/ProcessRedirectDarwin.cpp @@ -199,6 +199,7 @@ namespace recordreplay { MACRO(mach_vm_allocate, nullptr, Preamble_mach_vm_allocate) \ MACRO(mach_vm_deallocate, nullptr, Preamble_mach_vm_deallocate) \ MACRO(mach_vm_protect, nullptr, Preamble_mach_vm_protect) \ + MACRO(rand, RR_ScalarRval) \ MACRO(realpath, \ RR_SaveRvalHadErrorZero>>) \ From be3e8a163bf0c462c09b2ee80b0d14c48236a056 Mon Sep 17 00:00:00 2001 From: Eliza Balazs Date: Mon, 12 Nov 2018 04:18:00 +0200 Subject: [PATCH 22/50] Bug 1506417 - Disable key_valid.html on mac debug for frequent failures. r=aryx --- testing/web-platform/meta/IndexedDB/key_valid.html.ini | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 testing/web-platform/meta/IndexedDB/key_valid.html.ini diff --git a/testing/web-platform/meta/IndexedDB/key_valid.html.ini b/testing/web-platform/meta/IndexedDB/key_valid.html.ini new file mode 100644 index 000000000000..251efa7fe02b --- /dev/null +++ b/testing/web-platform/meta/IndexedDB/key_valid.html.ini @@ -0,0 +1,3 @@ +[key_valid.html] + disabled: + if debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): https://bugzilla.mozilla.org/show_bug.cgi?id=1506417 From 8c92d01dbf1d4b05775e9a9b5a9677f9f67beb7b Mon Sep 17 00:00:00 2001 From: Matt Howell Date: Fri, 9 Nov 2018 09:55:01 -0800 Subject: [PATCH 23/50] Bug 1504244 - Remove an erroneous parameter that's overriding /ExtractDir in the MSI installer. r=agashlin --HG-- extra : source : 001e54e9309c7b09c888ba1ec6f94510ba2a3995 --- browser/installer/windows/docs/FullConfig.rst | 4 +--- browser/installer/windows/msi/installer.wxs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/browser/installer/windows/docs/FullConfig.rst b/browser/installer/windows/docs/FullConfig.rst index a6cde5535455..ad7397715f1e 100644 --- a/browser/installer/windows/docs/FullConfig.rst +++ b/browser/installer/windows/docs/FullConfig.rst @@ -69,6 +69,4 @@ For options that accept ``true`` or ``false``, ``=true`` can be left off to get OptionalExtensions=false ``/ExtractDir=[directory]`` - Extract the application files to the given directory and exit, without actually running the installer. Of course, this means all other options will be ignored. - - This option is not available for use in .ini files. + Extract the application files to the given directory and exit, without actually running the installer. No other options may be supplied along with ``ExtractDir``, and ``ExtractDir`` is not available for use in .ini files. diff --git a/browser/installer/windows/msi/installer.wxs b/browser/installer/windows/msi/installer.wxs index 319d65d919c7..df8c8f7b23d6 100644 --- a/browser/installer/windows/msi/installer.wxs +++ b/browser/installer/windows/msi/installer.wxs @@ -69,7 +69,7 @@ ExeCommand="/S /InstallDirectoryName=[INSTALL_DIRECTORY_NAME] /TaskbarShortcut=[TASKBAR_SHORTCUT] /DesktopShortcut=[DESKTOP_SHORTCUT] /StartMenuShortcut=[START_MENU_SHORTCUT] /MaintenanceService=[INSTALL_MAINTENANCE_SERVICE] /RemoveDistributionDir=[REMOTE_DISTRIBUTION_DIR] /PreventRebootRequired=[PREVENT_REBOOT_REQUIRED] /OptionalExtensions=[OPTIONAL_EXTENSIONS] /LaunchedFromMSI" /> + ExeCommand="/ExtractDir=[EXTRACT_DIR]" />