Skip to content

Commit

Permalink
Merge mozilla-central to inbound. a=merge CLOSED TREE
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : c4fe851e9a89199d77e3c4694d6564efb642ab2c
  • Loading branch information
raulgurzau committed Jul 9, 2019
2 parents 803ac9a + 40ef220 commit 1e60892
Show file tree
Hide file tree
Showing 119 changed files with 2,812 additions and 3,237 deletions.
58 changes: 30 additions & 28 deletions accessible/ipc/DocAccessibleParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,38 +537,40 @@ ipc::IPCResult DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
}

#if defined(XP_WIN)
auto embeddedBrowser = static_cast<dom::BrowserParent*>(aChildDoc->Manager());
dom::BrowserBridgeParent* bridge = embeddedBrowser->GetBrowserBridgeParent();
if (bridge) {
if (aChildDoc->IsTopLevelInContentProcess()) {
// aChildDoc is an embedded document in a different content process to
// this document.
// Send a COM proxy for the embedded document to the embedder process
// hosting the iframe. This will be returned as the child of the
// embedder OuterDocAccessible.
RefPtr<IDispatch> docAcc;
aChildDoc->GetCOMInterface((void**)getter_AddRefs(docAcc));
RefPtr<IDispatch> docWrapped(
mscom::PassthruProxy::Wrap<IDispatch>(WrapNotNull(docAcc)));
IDispatchHolder::COMPtrType docPtr(
mscom::ToProxyUniquePtr(std::move(docWrapped)));
IDispatchHolder docHolder(std::move(docPtr));
if (bridge->SendSetEmbeddedDocAccessibleCOMProxy(docHolder)) {
auto embeddedBrowser = static_cast<dom::BrowserParent*>(aChildDoc->Manager());
dom::BrowserBridgeParent* bridge = embeddedBrowser->GetBrowserBridgeParent();
if (bridge) {
// Send a COM proxy for the embedded document to the embedder process
// hosting the iframe. This will be returned as the child of the
// embedder OuterDocAccessible.
RefPtr<IDispatch> docAcc;
aChildDoc->GetCOMInterface((void**)getter_AddRefs(docAcc));
RefPtr<IDispatch> docWrapped(
mscom::PassthruProxy::Wrap<IDispatch>(WrapNotNull(docAcc)));
IDispatchHolder::COMPtrType docPtr(
mscom::ToProxyUniquePtr(std::move(docWrapped)));
IDispatchHolder docHolder(std::move(docPtr));
if (bridge->SendSetEmbeddedDocAccessibleCOMProxy(docHolder)) {
# if defined(MOZ_SANDBOX)
mDocProxyStream = docHolder.GetPreservedStream();
mDocProxyStream = docHolder.GetPreservedStream();
# endif // defined(MOZ_SANDBOX)
}
// Send a COM proxy for the embedder OuterDocAccessible to the embedded
// document process. This will be returned as the parent of the
// embedded document.
aChildDoc->SendParentCOMProxy(WrapperFor(outerDoc));
if (nsWinUtils::IsWindowEmulationStarted()) {
// The embedded document should use the same emulated window handle as
// its embedder. It will return the embedder document (not a window
// accessible) as the parent accessible, so we pass a null accessible
// when sending the window to the embedded document.
aChildDoc->SetEmulatedWindowHandle(mEmulatedWindowHandle);
Unused << aChildDoc->SendEmulatedWindow(
reinterpret_cast<uintptr_t>(mEmulatedWindowHandle), nullptr);
}
// Send a COM proxy for the embedder OuterDocAccessible to the embedded
// document process. This will be returned as the parent of the
// embedded document.
aChildDoc->SendParentCOMProxy(WrapperFor(outerDoc));
if (nsWinUtils::IsWindowEmulationStarted()) {
// The embedded document should use the same emulated window handle as
// its embedder. It will return the embedder document (not a window
// accessible) as the parent accessible, so we pass a null accessible
// when sending the window to the embedded document.
aChildDoc->SetEmulatedWindowHandle(mEmulatedWindowHandle);
Unused << aChildDoc->SendEmulatedWindow(
reinterpret_cast<uintptr_t>(mEmulatedWindowHandle), nullptr);
}
}
}
#endif // defined(XP_WIN)
Expand Down
1 change: 1 addition & 0 deletions accessible/ipc/win/ProxyAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ bool ProxyAccessible::GetCOMInterface(void** aOutAccessible) const {
// overflow the stack.
VARIANT realId = {{{VT_I4}}};
realId.ulVal = wrap->GetExistingID();
MOZ_DIAGNOSTIC_ASSERT(realId.ulVal != CHILDID_SELF);
thisPtr->mCOMProxy = wrap->GetIAccessibleFor(realId, &isDefunct);
}

Expand Down
5 changes: 2 additions & 3 deletions build/moz.configure/rust.configure
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,10 @@ def rust_compiler(rustc_info, cargo_info, build_project):
or by directly running the installer from https://rustup.rs/
'''))
if build_project == 'tools/crashreporter':
rustc_min_version = Version('1.22.0')
cargo_min_version = Version('0.23.0')
rustc_min_version = Version('1.31.0')
else:
rustc_min_version = Version('1.35.0')
cargo_min_version = rustc_min_version
cargo_min_version = rustc_min_version

version = rustc_info.version
if version < rustc_min_version:
Expand Down
80 changes: 42 additions & 38 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,44 @@ add_old_configure_assignment('MOZ_HARDENING_LDFLAGS', security_hardening_cflags.
add_old_configure_assignment('MOZ_HARDENING_CFLAGS_JS', security_hardening_cflags.js_flags)
add_old_configure_assignment('MOZ_HARDENING_LDFLAGS_JS', security_hardening_cflags.js_ldflags)


# Frame pointers
# ==============================================================
@depends(c_compiler)
def frame_pointer_flags(compiler):
if compiler.type == 'clang-cl':
return namespace(
enable=['-Oy-'],
disable=['-Oy'],
)
return namespace(
enable=['-fno-omit-frame-pointer', '-funwind-tables'],
disable=['-fomit-frame-pointer', '-funwind-tables'],
)


@depends(moz_optimize.optimize, moz_debug, target,
'--enable-memory-sanitizer', '--enable-address-sanitizer',
'--enable-undefined-sanitizer')
def frame_pointer_default(optimize, debug, target, msan, asan, ubsan):
return bool(not optimize or debug or msan or asan or ubsan or \
(target.os == 'WINNT' and target.cpu in ('x86', 'aarch64')))


js_option('--enable-frame-pointers', default=frame_pointer_default,
help='{Enable|Disable} frame pointers')


@depends('--enable-frame-pointers', frame_pointer_flags)
def frame_pointer_flags(enable, flags):
if enable:
return flags.enable
return flags.disable


set_config('MOZ_FRAMEPTR_FLAGS', frame_pointer_flags)


# nasm detection
# ==============================================================
nasm = check_prog('NASM', ['nasm'], allow_missing=True, paths=toolchain_search_path)
Expand Down Expand Up @@ -1943,8 +1981,8 @@ def rustc_opt_level(opt_level_option, moz_optimize):
return '1' if moz_optimize.optimize else '0'


@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols')
def rust_compile_flags(opt_level, debug_rust, debug_symbols):
@depends(rustc_opt_level, debug_rust, '--enable-debug-symbols', '--enable-frame-pointers')
def rust_compile_flags(opt_level, debug_rust, debug_symbols, frame_pointers):
# Cargo currently supports only two interesting profiles for building:
# development and release. Those map (roughly) to --enable-debug and
# --disable-debug in Gecko, respectively.
Expand Down Expand Up @@ -1977,6 +2015,8 @@ def rust_compile_flags(opt_level, debug_rust, debug_symbols):
('yes' if debug_assertions else 'no'))
if debug_info is not None:
opts.append('debuginfo=%s' % debug_info)
if frame_pointers:
opts.append('force-frame-pointers=yes')

flags = []
for opt in opts:
Expand Down Expand Up @@ -2498,39 +2538,3 @@ ar = check_prog('AR', ar_config.names, paths=toolchain_search_path)
add_old_configure_assignment('AR', ar)

set_config('AR_FLAGS', ar_config.flags)

# Frame pointers
# ==============================================================
@depends(c_compiler)
def frame_pointer_flags(compiler):
if compiler.type == 'clang-cl':
return namespace(
enable=['-Oy-'],
disable=['-Oy'],
)
return namespace(
enable=['-fno-omit-frame-pointer', '-funwind-tables'],
disable=['-fomit-frame-pointer', '-funwind-tables'],
)


@depends(moz_optimize.optimize, moz_debug, target,
'--enable-memory-sanitizer', '--enable-address-sanitizer',
'--enable-undefined-sanitizer')
def frame_pointer_default(optimize, debug, target, msan, asan, ubsan):
return bool(not optimize or debug or msan or asan or ubsan or \
(target.os == 'WINNT' and target.cpu in ('x86', 'aarch64')))


js_option('--enable-frame-pointers', default=frame_pointer_default,
help='{Enable|Disable} frame pointers')


@depends('--enable-frame-pointers', frame_pointer_flags)
def frame_pointer_flags(enable, flags):
if enable:
return flags.enable
return flags.disable


set_config('MOZ_FRAMEPTR_FLAGS', frame_pointer_flags)
32 changes: 20 additions & 12 deletions dom/base/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9458,7 +9458,7 @@ Maybe<LayoutDeviceToScreenScale> Document::ParseScaleInHeader(
return ParseScaleString(scaleStr);
}

void Document::ParseScalesInMetaViewport() {
bool Document::ParseScalesInMetaViewport() {
Maybe<LayoutDeviceToScreenScale> scale;

scale = ParseScaleInHeader(nsGkAtoms::viewport_initial_scale);
Expand All @@ -9481,9 +9481,10 @@ void Document::ParseScalesInMetaViewport() {
if (mValidMaxScale && mValidMinScale) {
mScaleMaxFloat = std::max(mScaleMinFloat, mScaleMaxFloat);
}
return mValidScaleFloat || mValidMaxScale || mValidMinScale;
}

void Document::ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
bool Document::ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
const nsAString& aHeightString,
bool aHasValidScale) {
// The width and height properties
Expand All @@ -9498,7 +9499,7 @@ void Document::ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
// the range: [1px, 10000px]
// 2. Negative number values are dropped
// 3. device-width and device-height translate to 100vw and 100vh respectively
// 4. Other keywords and unknown values translate to 1px
// 4. Other keywords and unknown values are also dropped
mMinWidth = nsViewportInfo::Auto;
mMaxWidth = nsViewportInfo::Auto;
if (!aWidthString.IsEmpty()) {
Expand All @@ -9509,7 +9510,7 @@ void Document::ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
nsresult widthErrorCode;
mMaxWidth = aWidthString.ToInteger(&widthErrorCode);
if (NS_FAILED(widthErrorCode)) {
mMaxWidth = 1.0f;
mMaxWidth = nsViewportInfo::Auto;
} else if (mMaxWidth >= 0.0f) {
mMaxWidth = clamped(mMaxWidth, CSSCoord(1.0f), CSSCoord(10000.0f));
} else {
Expand All @@ -9536,14 +9537,16 @@ void Document::ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
nsresult heightErrorCode;
mMaxHeight = aHeightString.ToInteger(&heightErrorCode);
if (NS_FAILED(heightErrorCode)) {
mMaxHeight = 1.0f;
mMaxHeight = nsViewportInfo::Auto;
} else if (mMaxHeight >= 0.0f) {
mMaxHeight = clamped(mMaxHeight, CSSCoord(1.0f), CSSCoord(10000.0f));
} else {
mMaxHeight = nsViewportInfo::Auto;
}
}
}

return !aWidthString.IsEmpty() || !aHeightString.IsEmpty();
}

nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
Expand Down Expand Up @@ -9598,8 +9601,7 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
// We might early exit if the viewport is empty. Even if we don't,
// at the end of this case we'll note that it was empty. Later, when
// we're using the cached values, this will trigger alternate code paths.
bool viewportIsEmpty = viewport.IsEmpty();
if (viewportIsEmpty) {
if (viewport.IsEmpty()) {
// If the docType specifies that we are on a site optimized for mobile,
// then we want to return specially crafted defaults for the viewport
// info.
Expand All @@ -9626,7 +9628,7 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
}

// Parse initial-scale, minimum-scale and maximum-scale.
ParseScalesInMetaViewport();
bool hasValidContents = ParseScalesInMetaViewport();

nsAutoString widthStr, heightStr;

Expand All @@ -9635,7 +9637,10 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {

// Parse width and height properties
// This function sets m{Min,Max}{Width,Height}.
ParseWidthAndHeightInMetaViewport(widthStr, heightStr, mValidScaleFloat);
if (ParseWidthAndHeightInMetaViewport(widthStr, heightStr,
mValidScaleFloat)) {
hasValidContents = true;
}

mAllowZoom = true;
nsAutoString userScalable;
Expand All @@ -9646,14 +9651,17 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
(userScalable.EqualsLiteral("false"))) {
mAllowZoom = false;
}
if (!userScalable.IsEmpty()) {
hasValidContents = true;
}

mWidthStrEmpty = widthStr.IsEmpty();

mViewportType = viewportIsEmpty ? Empty : Specified;
mViewportType = hasValidContents ? Specified : NoValidContent;
MOZ_FALLTHROUGH;
}
case Specified:
case Empty:
case NoValidContent:
default:
LayoutDeviceToScreenScale effectiveMinScale = mScaleMinFloat;
LayoutDeviceToScreenScale effectiveMaxScale = mScaleMaxFloat;
Expand Down Expand Up @@ -9764,7 +9772,7 @@ nsViewportInfo Document::GetViewportInfo(const ScreenIntSize& aDisplaySize) {
// provided, in which case we want to assume that the document is not
// optimized for aDisplaySize, and we should instead force a useful
// size.
if (mViewportType == Empty) {
if (mViewportType == NoValidContent) {
// If we don't have any applicable viewport width constraints, this
// is most likely a desktop page written without mobile devices in
// mind. We use the desktop mode viewport for those pages by
Expand Down
13 changes: 10 additions & 3 deletions dom/base/Document.h
Original file line number Diff line number Diff line change
Expand Up @@ -3963,7 +3963,8 @@ class Document : public nsINode,
private:
void InitializeLocalization(nsTArray<nsString>& aResourceIds);

void ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
// Returns true if there is any valid value in the viewport meta tag.
bool ParseWidthAndHeightInMetaViewport(const nsAString& aWidthString,
const nsAString& aHeightString,
bool aIsAutoScale);

Expand All @@ -3973,7 +3974,8 @@ class Document : public nsINode,

// Parse scale values in viewport meta tag and set the values in
// mScaleMinFloat, mScaleMaxFloat and mScaleFloat respectively.
void ParseScalesInMetaViewport();
// Returns true if there is any valid scale value in the viewport meta tag.
bool ParseScalesInMetaViewport();

FlashClassification DocumentFlashClassificationInternal();

Expand Down Expand Up @@ -5044,7 +5046,12 @@ class Document : public nsINode,
// Our update nesting level
uint32_t mUpdateNestLevel;

enum ViewportType : uint8_t { DisplayWidthHeight, Specified, Unknown, Empty };
enum ViewportType : uint8_t {
DisplayWidthHeight,
Specified,
Unknown,
NoValidContent,
};

ViewportType mViewportType;

Expand Down
1 change: 1 addition & 0 deletions dom/canvas/WebGLContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ class WebGLContext : public nsICanvasRenderingContextInternal,
const dom::Nullable<dom::ArrayBufferView>& maybeView,
dom::CallerType aCallerType, ErrorResult& rv) {
const FuncScope funcScope(*this, "readPixels");
if (IsContextLost()) return;
if (!ValidateNonNull("pixels", maybeView)) return;
ReadPixels(x, y, width, height, format, type, maybeView.Value(), 0,
aCallerType, rv);
Expand Down
2 changes: 2 additions & 0 deletions dom/locales/en-US/chrome/dom/dom.properties
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ ManifestInvalidType=Expected the %1$S’s %2$S member to be a %3$S.
ManifestInvalidCSSColor=%1$S: %2$S is not a valid CSS color.
# LOCALIZATION NOTE: %1$S is the name of the property whose value is invalid. %2$S is the (invalid) value of the property. E.g. "lang: 42 is not a valid language code."
ManifestLangIsInvalid=%1$S: %2$S is not a valid language code.
# LOCALIZATION NOTE: %1$S is the name of the parent property whose value is invalid (e.g., "icons"). %2$S is the index of the image object that is invalid (from 0). %3$S is the name of actual member that is invalid. %4$S is the invalid value. E.g. "icons item at index 2 is invalid. The src member is an invalid URL http://:Invalid"
ManifestImageURLIsInvalid=%1$S item at index %2$S is invalid. The %3$S member is an invalid URL %4$S
PatternAttributeCompileFailure=Unable to check <input pattern='%S'> because the pattern is not a valid regexp: %S
# LOCALIZATION NOTE: Do not translate "postMessage" or DOMWindow. %S values are origins, like https://domain.com:port
TargetPrincipalDoesNotMatch=Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘%S’) does not match the recipient window’s origin (‘%S’).
Expand Down
Loading

0 comments on commit 1e60892

Please sign in to comment.