Merge autoland to mozilla-central. a=merge

This commit is contained in:
Mihai Alexandru Michis 2019-09-10 12:52:27 +03:00
commit 0ef6713848
30 changed files with 626 additions and 569 deletions

View File

@ -198,6 +198,7 @@
<div class="reveal-password-wrapper">
<input type="password"
name="password"
autocomplete="off"
dir="ltr"
required
readonly/>

View File

@ -28,7 +28,6 @@
}
.fxaccount-email {
font-weight: 600;
font-size: .9em;
vertical-align: middle;
}

View File

@ -148,7 +148,7 @@ input[type="url"][readOnly]:hover:active {
display: block;
font-size: smaller;
color: var(--in-content-deemphasized-text);
margin-bottom: 5px;
margin-bottom: 8px;
}
:host([data-editing]) .detail-cell input:not([readOnly]):not([type="checkbox"]) {

View File

@ -146,7 +146,8 @@ export default class LoginItem extends HTMLElement {
this._title.textContent = this._login.title;
this._originInput.defaultValue = this._login.origin || "";
this._usernameInput.defaultValue = this._login.username || "";
this._passwordInput.defaultValue = this._login.password || "";
// The password gets filled in _updatePasswordRevealState
if (this.dataset.editing) {
this._usernameInput.removeAttribute("data-l10n-id");
this._usernameInput.placeholder = "";
@ -246,7 +247,8 @@ export default class LoginItem extends HTMLElement {
case "click": {
let classList = event.currentTarget.classList;
if (classList.contains("reveal-password-checkbox")) {
if (this._revealCheckbox.checked) {
// We prompt for the master password when entering edit mode already.
if (this._revealCheckbox.checked && !this.dataset.editing) {
let masterPasswordAuth = await new Promise(resolve => {
window.AboutLoginsUtils.promptForMasterPassword(resolve);
});
@ -344,6 +346,13 @@ export default class LoginItem extends HTMLElement {
return;
}
if (classList.contains("edit-button")) {
let masterPasswordAuth = await new Promise(resolve => {
window.AboutLoginsUtils.promptForMasterPassword(resolve);
});
if (!masterPasswordAuth) {
return;
}
this._toggleEditing();
this.render();
@ -680,7 +689,15 @@ export default class LoginItem extends HTMLElement {
let { checked } = this._revealCheckbox;
let inputType = checked ? "text" : "password";
this._passwordInput.setAttribute("type", inputType);
this._passwordInput.type = inputType;
// Don't include the password value in the attribute when it's supposed to be
// masked so that it's not trivial to bypass the Master Password prompt with
// the inspector in devtools.
let password = this._login.password || "";
// We prompt for the master password before entering edit mode so we can use
// the password in the markup then.
this._passwordInput.defaultValue =
checked || this.dataset.editing ? password : " ".repeat(password.length);
}
}
customElements.define("login-item", LoginItem);

View File

@ -79,7 +79,7 @@ add_task(async function test_telemetry_events() {
let promiseNewTab = BrowserTestUtils.waitForNewTab(
gBrowser,
TEST_LOGIN2.origin
TEST_LOGIN2.origin + "/"
);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
let loginItem = content.document.querySelector("login-item");

View File

@ -16,7 +16,7 @@ add_task(async function setup() {
add_task(async function test_launch_login_item() {
let promiseNewTab = BrowserTestUtils.waitForNewTab(
gBrowser,
TEST_LOGIN1.origin
TEST_LOGIN1.origin + "/"
);
let browser = gBrowser.selectedBrowser;

View File

@ -63,6 +63,10 @@ add_task(async function test_login_item() {
async function test_discard_dialog(exitPoint) {
editButton.click();
await ContentTaskUtils.waitForCondition(
() => loginItem.dataset.editing,
"Entering edit mode"
);
await Promise.resolve();
usernameInput.value += "-undome";
@ -102,7 +106,7 @@ add_task(async function test_login_item() {
);
is(
passwordInput.value,
login.password,
" ".repeat(login.password.length),
"Password change should be reverted"
);
is(
@ -118,6 +122,10 @@ add_task(async function test_login_item() {
await test_discard_dialog(cancelButton);
editButton.click();
await ContentTaskUtils.waitForCondition(
() => loginItem.dataset.editing,
"Entering edit mode"
);
await Promise.resolve();
let revealCheckbox = loginItem.shadowRoot.querySelector(
@ -132,6 +140,8 @@ add_task(async function test_login_item() {
usernameInput.value += "-saveme";
passwordInput.value += "-saveme";
// Cache the value since it will change upon leaving edit mode.
let passwordInputValue = passwordInput.value;
ok(loginItem.dataset.editing, "LoginItem should be in 'edit' mode");
let saveChangesButton = loginItem.shadowRoot.querySelector(
@ -145,7 +155,7 @@ add_task(async function test_login_item() {
return (
updatedLogin &&
updatedLogin.username == usernameInput.value &&
updatedLogin.password == passwordInput.value
updatedLogin.password == passwordInputValue
);
}, "Waiting for corresponding login in login list to update");
@ -164,6 +174,10 @@ add_task(async function test_login_item() {
);
editButton.click();
await ContentTaskUtils.waitForCondition(
() => loginItem.dataset.editing,
"Entering edit mode"
);
await Promise.resolve();
ok(loginItem.dataset.editing, "LoginItem should be in 'edit' mode");

View File

@ -8,8 +8,8 @@ let nsLoginInfo = new Components.Constructor(
);
let TEST_LOGIN1 = new nsLoginInfo(
"https://example.com/",
"https://example.com/",
"https://example.com",
"https://example.com",
null,
"user1",
"pass1",
@ -17,8 +17,8 @@ let TEST_LOGIN1 = new nsLoginInfo(
"password"
);
let TEST_LOGIN2 = new nsLoginInfo(
"https://2.example.com/",
"https://2.example.com/",
"https://2.example.com",
"https://2.example.com",
null,
"user2",
"pass2",
@ -27,8 +27,8 @@ let TEST_LOGIN2 = new nsLoginInfo(
);
let TEST_LOGIN3 = new nsLoginInfo(
"https://breached.com/",
"https://breached.com/",
"https://breached.com",
"https://breached.com",
null,
"breachedLogin1",
"pass3",

View File

@ -89,7 +89,7 @@ add_task(async function test_set_login() {
let usernameInput = gLoginItem.shadowRoot.querySelector("input[name='username']");
is(usernameInput.value, TEST_LOGIN_1.username, "username should be populated");
is(document.l10n.getAttributes(usernameInput).id, "about-logins-login-item-username", "username field should have default placeholder when not editing");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, TEST_LOGIN_1.password, "password should be populated");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value.length, TEST_LOGIN_1.password.length, "password mask text should be populated");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-created")).args.timeCreated, TEST_LOGIN_1.timeCreated, "time-created should be populated");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-changed")).args.timeChanged, TEST_LOGIN_1.timePasswordChanged, "time-changed should be populated");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-used")).args.timeUsed, TEST_LOGIN_1.timeLastUsed, "time-used should be populated");
@ -126,6 +126,7 @@ add_task(async function test_set_login() {
usernameInput.placeholder = "dummy placeholder";
gLoginItem.shadowRoot.querySelector(".edit-button").click();
await asyncElementRendered();
is(
document.l10n.getAttributes(usernameInput).id,
null,
@ -160,6 +161,7 @@ add_task(async function test_edit_login() {
usernameInput.placeholder = "dummy placeholder";
gLoginItem.shadowRoot.querySelector(".edit-button").click();
await asyncElementRendered();
await asyncElementRendered();
ok(gLoginItem.dataset.editing, "loginItem should be in 'edit' mode");
ok(isHidden(gLoginItem.shadowRoot.querySelector(".edit-button")), "edit button should be hidden in 'edit' mode");
@ -199,6 +201,7 @@ add_task(async function test_edit_login() {
add_task(async function test_edit_login_cancel() {
gLoginItem.setLogin(TEST_LOGIN_1);
gLoginItem.shadowRoot.querySelector(".edit-button").click();
await asyncElementRendered();
ok(gLoginItem.dataset.editing, "loginItem should be in 'edit' mode");
is(!!gLoginItem.dataset.isNewLogin, false,
@ -231,6 +234,8 @@ add_task(async function test_reveal_password_change_selected_login() {
let editButton = gLoginItem.shadowRoot.querySelector(".edit-button");
editButton.click();
await asyncElementRendered();
ok(revealCheckbox.checked, "reveal-checkbox should remain checked when entering 'edit' mode");
gLoginItem.shadowRoot.querySelector(".cancel-button").click();
ok(!revealCheckbox.checked, "reveal-checkbox should be unchecked after canceling 'edit' mode");
@ -307,7 +312,7 @@ add_task(async function test_different_login_modified() {
is(gLoginItem.shadowRoot.querySelector("input[name='origin']").value, TEST_LOGIN_1.origin, "origin should be unchanged");
is(gLoginItem.shadowRoot.querySelector("input[name='username']").value, TEST_LOGIN_1.username, "username should be unchanged");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, TEST_LOGIN_1.password, "password should be unchanged");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, " ".repeat(TEST_LOGIN_1.password.length), "password length should be unchanged");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-created")).args.timeCreated, TEST_LOGIN_1.timeCreated, "time-created should be unchanged");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-changed")).args.timeChanged, TEST_LOGIN_1.timePasswordChanged, "time-changed should be unchanged");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-used")).args.timeUsed, TEST_LOGIN_1.timeLastUsed, "time-used should be unchanged");
@ -321,7 +326,7 @@ add_task(async function test_different_login_removed() {
is(gLoginItem.shadowRoot.querySelector("input[name='origin']").value, TEST_LOGIN_1.origin, "origin should be unchanged");
is(gLoginItem.shadowRoot.querySelector("input[name='username']").value, TEST_LOGIN_1.username, "username should be unchanged");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, TEST_LOGIN_1.password, "password should be unchanged");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, " ".repeat(TEST_LOGIN_1.password.length), "password length should be unchanged");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-created")).args.timeCreated, TEST_LOGIN_1.timeCreated, "time-created should be unchanged");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-changed")).args.timeChanged, TEST_LOGIN_1.timePasswordChanged, "time-changed should be unchanged");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-used")).args.timeUsed, TEST_LOGIN_1.timeLastUsed, "time-used should be unchanged");
@ -335,7 +340,7 @@ add_task(async function test_login_modified() {
is(gLoginItem.shadowRoot.querySelector("input[name='origin']").value, modifiedLogin.origin, "origin should be updated");
is(gLoginItem.shadowRoot.querySelector("input[name='username']").value, modifiedLogin.username, "username should be updated");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, modifiedLogin.password, "password should be updated");
is(gLoginItem.shadowRoot.querySelector("input[name='password']").value, " ".repeat(modifiedLogin.password.length), "password length should be updated");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-created")).args.timeCreated, modifiedLogin.timeCreated, "time-created should be updated");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-changed")).args.timeChanged, modifiedLogin.timePasswordChanged, "time-changed should be updated");
is(document.l10n.getAttributes(gLoginItem.shadowRoot.querySelector(".time-used")).args.timeUsed, modifiedLogin.timeLastUsed, "time-used should be updated");

View File

@ -194,7 +194,7 @@ class ElfRelHackCode_Section : public ElfSection {
~ElfRelHackCode_Section() { delete elf; }
void serialize(std::ofstream& file, char ei_class, char ei_data) {
void serialize(std::ofstream& file, char ei_class, char ei_data) override {
// Readjust code offsets
for (std::vector<ElfSection*>::iterator c = code.begin(); c != code.end();
++c)
@ -217,7 +217,7 @@ class ElfRelHackCode_Section : public ElfSection {
ElfSection::serialize(file, ei_class, ei_data);
}
bool isRelocatable() { return false; }
bool isRelocatable() override { return false; }
unsigned int getEntryPoint() { return entry_point; }

View File

@ -203,7 +203,9 @@ $(addprefix build/unix/stdc++compat/,target host) build/clang-plugin/host: confi
# export, which ensures it exists before recursing the rust targets, tricking
# Make into keeping them early.
$(rust_targets): $(DEPTH)/.cargo/config
ifndef TEST_MOZBUILD
export:: $(DEPTH)/.cargo/config
endif
# When building gtest as part of the build (LINK_GTEST_DURING_COMPILE),
# force the build system to get to it first, so that it can be linked

View File

@ -5,7 +5,7 @@
// @flow
import type { SourceContent } from "../types";
import { saveAs } from "devtools-modules";
import { DevToolsUtils } from "devtools-modules";
/**
* Utils for utils, by utils
@ -62,5 +62,5 @@ export function downloadFile(content: SourceContent, fileName: string) {
}
const data = new TextEncoder().encode(content.value);
saveAs(window, data, fileName);
DevToolsUtils.saveAs(window, data, fileName);
}

View File

@ -72,6 +72,7 @@ const moduleMapping = {
asyncStoreHelper: "devtools/client/shared/async-store-helper",
asyncStorage: "devtools/shared/async-storage",
PluralForm: "devtools/shared/plural-form",
DevToolsUtils: "devtools/shared/DevToolsUtils",
};
/*

File diff suppressed because it is too large Load Diff

View File

@ -113,19 +113,6 @@ class HTMLEditRules : public TextEditRules {
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult DidDeleteSelection();
/**
* Called before aligning contents around Selection. This method actually
* sets align attributes to align contents.
*
* @param aAlignType New align attribute value where the contents
* should be aligned to.
* @param aCancel Returns true if the operation is canceled.
* @param aHandled Returns true if the edit action is handled.
*/
MOZ_CAN_RUN_SCRIPT
nsresult WillAlign(const nsAString& aAlignType, bool* aCancel,
bool* aHandled);
/**
* Called before changing absolute positioned element to static positioned.
* This method actually changes the position property of nearest absolute
@ -191,20 +178,6 @@ class HTMLEditRules : public TextEditRules {
MOZ_CAN_RUN_SCRIPT
MOZ_MUST_USE nsresult DidAbsolutePosition();
/**
* AlignContentsAtSelection() aligns contents around Selection to aAlignType.
* This creates AutoSelectionRestorer. Therefore, even if this returns
* NS_OK, CanHandleEditAction() may return false if the editor is destroyed
* during restoring the Selection. So, every caller needs to check if
* CanHandleEditAction() returns true before modifying the DOM tree or
* changing Selection.
*
* @param aAlignType New align attribute value where the contents
* should be aligned to.
*/
MOZ_CAN_RUN_SCRIPT
MOZ_MUST_USE nsresult AlignContentsAtSelection(const nsAString& aAlignType);
nsresult AppendInnerFormatNodes(nsTArray<OwningNonNull<nsINode>>& aArray,
nsINode* aNode);
nsresult GetFormatString(nsINode* aNode, nsAString& outFormat);
@ -236,33 +209,6 @@ class HTMLEditRules : public TextEditRules {
void CheckInterlinePosition();
/**
* AdjustSelection() may adjust Selection range to nearest editable content.
* Despite of the name, this may change the DOM tree. If it needs to create
* a <br> to put caret, this tries to create a <br> element.
*
* @param aAction Maybe used to look for a good point to put caret.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
AdjustSelection(nsIEditor::EDirection aAction);
/**
* FindNearEditableNode() tries to find an editable node near aPoint.
*
* @param aPoint The DOM point where to start to search from.
* @param aDirection If nsIEditor::ePrevious is set, this searches an
* editable node from next nodes. Otherwise, from
* previous nodes.
* @return If found, returns non-nullptr. Otherwise, nullptr.
* Note that if found node is in different table element,
* this returns nullptr.
* And also if aDirection is not nsIEditor::ePrevious,
* the result may be the node pointed by aPoint.
*/
template <typename PT, typename CT>
nsIContent* FindNearEditableNode(const EditorDOMPointBase<PT, CT>& aPoint,
nsIEditor::EDirection aDirection);
/**
* RemoveEmptyNodesInChangedRange() removes all empty nodes in
* TopLevelEditSubActionData::mChangedRange. However, if mail-cite node has
@ -276,35 +222,6 @@ class HTMLEditRules : public TextEditRules {
MOZ_CAN_RUN_SCRIPT
MOZ_MUST_USE nsresult RemoveEmptyNodesInChangedRange();
nsresult SelectionEndpointInNode(nsINode* aNode, bool* aResult);
/**
* ConfirmSelectionInBody() makes sure that Selection is in editor root
* element typically <body> element (see HTMLEditor::UpdateRootElement())
* and only one Selection range.
* XXX This method is not necessary because even if selection is outside the
* <body> element, elements outside the <body> element should be
* editable, e.g., any element can be inserted siblings as <body> element
* and other browsers allow to edit such elements.
*/
MOZ_MUST_USE nsresult ConfirmSelectionInBody();
/**
* AlignBlock() resets align attribute, text-align property, etc first.
* Then, aligns contents of aElement on aAlignType.
*
* @param aElement The element whose contents will be aligned.
* @param aAlignType Boundary or "center" which contents should be
* aligned on.
* @param aResetAlignOf Resets align of whether element and its
* descendants or only descendants.
*/
enum class ResetAlignOf { ElementAndDescendants, OnlyDescendants };
MOZ_CAN_RUN_SCRIPT
MOZ_MUST_USE nsresult AlignBlock(Element& aElement,
const nsAString& aAlignType,
ResetAlignOf aResetAlignOf);
/**
* DocumentModifiedWorker() is called by DocumentModified() either
* synchronously or asynchronously.

View File

@ -2205,28 +2205,9 @@ nsresult HTMLEditor::AlignAsAction(const nsAString& aAlignType,
return NS_ERROR_NOT_INITIALIZED;
}
// Protect the edit rules object from dying
RefPtr<TextEditRules> rules(mRules);
AutoPlaceholderBatch treatAsOneTransaction(*this);
AutoEditSubActionNotifier startToHandleEditSubAction(
*this, EditSubAction::eSetOrClearAlignment, nsIEditor::eNext);
bool cancel, handled;
// Find out if the selection is collapsed:
EditSubActionInfo subActionInfo(EditSubAction::eSetOrClearAlignment);
subActionInfo.alignType = &aAlignType;
nsresult rv = rules->WillDoAction(subActionInfo, &cancel, &handled);
if (cancel || NS_FAILED(rv)) {
return EditorBase::ToGenericNSResult(rv);
}
rv = rules->DidDoAction(subActionInfo, rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return EditorBase::ToGenericNSResult(rv);
}
return NS_OK;
EditActionResult result = AlignAsSubAction(aAlignType);
NS_WARNING_ASSERTION(result.Succeeded(), "AlignAsSubAction() failed");
return EditorBase::ToGenericNSResult(result.Rv());
}
Element* HTMLEditor::GetElementOrParentByTagName(const nsAtom& aTagName,

View File

@ -259,8 +259,8 @@ class HTMLEditor final : public TextEditor,
MOZ_CAN_RUN_SCRIPT nsresult SetParagraphFormatAsAction(
const nsAString& aParagraphFormat, nsIPrincipal* aPrincipal = nullptr);
nsresult AlignAsAction(const nsAString& aAlignType,
nsIPrincipal* aPrincipal = nullptr);
MOZ_CAN_RUN_SCRIPT nsresult AlignAsAction(const nsAString& aAlignType,
nsIPrincipal* aPrincipal = nullptr);
MOZ_CAN_RUN_SCRIPT nsresult RemoveListAsAction(
const nsAString& aListType, nsIPrincipal* aPrincipal = nullptr);
@ -2501,6 +2501,116 @@ class HTMLEditor final : public TextEditor,
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult RemoveAlignFromDescendants(
Element& aElement, const nsAString& aAlignType, EditTarget aEditTarget);
/**
* SetBlockElementAlign() resets `align` attribute, `text-align` property
* of descendants of aBlockOrHRElement except `<table>` element descendants.
* Then, set `align` attribute or `text-align` property of aBlockOrHRElement.
*
* @param aBlockOrHRElement The element whose contents will be aligned.
* This must be a block element or `<hr>` element.
* If we're not in CSS mode, this element has
* to support `align` attribute (i.e.,
* `HTMLEditUtils::SupportsAlignAttr()` must
* return true).
* @param aAlignType Boundary or "center" which contents should be
* aligned on.
* @param aEditTarget If `OnlyDescendantsExceptTable`, modifies only
* descendants of aBlockOrHRElement.
* If `NodeAndDescendantsExceptTable`, modifies
* aBlockOrHRElement and its descendants.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
SetBlockElementAlign(Element& aBlockOrHRElement, const nsAString& aAlignType,
EditTarget aEditTarget);
/**
* AlignContentsAtSelectionWithEmptyDivElement() inserts new `<div>` element
* at `Selection` to align selected contents. This returns as "handled"
* if this modifies `Selection` so that callers shouldn't modify `Selection`
* in such case especially when using AutoSelectionRestorer.
*
* @param aAlignType New align attribute value where the contents
* should be aligned to.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE EditActionResult
AlignContentsAtSelectionWithEmptyDivElement(const nsAString& aAlignType);
/**
* AlignNodesAndDescendants() make contents of nodes in aArrayOfNodes and
* their descendants aligned to aAlignType.
*
* @param aAlignType New align attribute value where the contents
* should be aligned to.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
AlignNodesAndDescendants(nsTArray<OwningNonNull<nsINode>>& aArrayOfNodes,
const nsAString& aAlignType);
/**
* AlignContentsAtSelection() aligns contents around Selection to aAlignType.
* This creates AutoSelectionRestorer. Therefore, even if this returns
* NS_OK, we might have been destroyed. So, every caller needs to check if
* Destroyed() returns false before modifying the DOM tree or changing
* Selection.
* NOTE: Call AlignAsSubAction() instead.
*
* @param aAlignType New align attribute value where the contents
* should be aligned to.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
AlignContentsAtSelection(const nsAString& aAlignType);
/**
* AlignAsSubAction() handles "align" command with `Selection`.
*
* @param aAlignType New align attribute value where the contents
* should be aligned to.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE EditActionResult
AlignAsSubAction(const nsAString& aAlignType);
/**
* StartOrEndOfSelectionRangesIsIn() returns true if start or end of one
* of selection ranges is in aContent.
*/
bool StartOrEndOfSelectionRangesIsIn(nsIContent& aContent) const;
/**
* FindNearEditableContent() tries to find an editable node near aPoint.
*
* @param aPoint The DOM point where to start to search from.
* @param aDirection If nsIEditor::ePrevious is set, this searches an
* editable node from next nodes. Otherwise, from
* previous nodes.
* @return If found, returns non-nullptr. Otherwise, nullptr.
* Note that if found node is in different table element,
* this returns nullptr.
* And also if aDirection is not nsIEditor::ePrevious,
* the result may be the node pointed by aPoint.
*/
template <typename PT, typename CT>
nsIContent* FindNearEditableContent(const EditorDOMPointBase<PT, CT>& aPoint,
nsIEditor::EDirection aDirection);
/**
* AdjustCaretPositionAndEnsurePaddingBRElement() may adjust caret
* position to nearest editable content and if padding `<br>` element is
* necessary at caret position, this creates it.
*
* @param aDirectionAndAmount Direction of the edit action.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
AdjustCaretPositionAndEnsurePaddingBRElement(
nsIEditor::EDirection aDirectionAndAmount);
/**
* EnsureSelectionInBodyOrDocumentElement() collapse `Selection` to the
* primary `<body>` element or document element when `Selection` crosses
* `<body>` element's boundary.
*/
MOZ_CAN_RUN_SCRIPT MOZ_MUST_USE nsresult
EnsureSelectionInBodyOrDocumentElement();
protected: // Called by helper classes.
virtual void OnStartToHandleTopLevelEditSubAction(
EditSubAction aEditSubAction, nsIEditor::EDirection aDirection) override;

View File

@ -307,6 +307,7 @@ interface nsIHTMLEditor : nsISupports
* Document me!
*
*/
[can_run_script]
void align(in AString aAlign);
/**

41
gfx/wr/Cargo.lock generated
View File

@ -174,6 +174,9 @@ dependencies = [
name = "cc"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cfg-if"
@ -420,7 +423,7 @@ version = "0.1.0"
dependencies = [
"euclid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender 0.60.0",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -592,17 +595,17 @@ dependencies = [
[[package]]
name = "gl_generator"
version = "0.9.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gl_generator"
version = "0.11.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -781,11 +784,6 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "khronos_api"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "khronos_api"
version = "3.1.0"
@ -939,12 +937,13 @@ dependencies = [
[[package]]
name = "mozangle"
version = "0.1.7"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1834,7 +1833,7 @@ dependencies = [
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plane-split 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1995,7 +1994,7 @@ dependencies = [
"image 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"mozangle 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"osmesa-src 0.1.1 (git+https://github.com/servo/osmesa-src)",
"osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2050,14 +2049,6 @@ name = "xdg"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "xml-rs"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xml-rs"
version = "0.8.0"
@ -2148,7 +2139,7 @@ dependencies = [
"checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592"
"checksum gif 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff3414b424657317e708489d2857d9575f4403698428b040b609b9d1c1a84a2c"
"checksum gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39a23d5e872a275135d66895d954269cf5e8661d234eb1c2480f4ce0d586acbd"
"checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a"
"checksum gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a"
"checksum gleam 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7f46fd8874e043ffac0d638ed1567a2584f7814f6d72b4db37ab1689004a26c4"
"checksum glutin 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb26027a84c3b9e1949ef0df0b6a3db8d0c124243a5c161ea25c7def90cb1474"
"checksum glutin_egl_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "23f48987ab6cb2b61ad903b59e54a2fd0c380a7baff68cffd6826b69a73dd326"
@ -2166,7 +2157,6 @@ dependencies = [
"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682"
"checksum jpeg-decoder 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0dfe27a6c0dabd772d0f9b9f8701c4ca12c4d1eebcadf2be1f6f70396f6a1434"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "037ab472c33f67b5fbd3e9163a2645319e5356fcd355efa6d4eb7fff4bbcb554"
"checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
@ -2187,7 +2177,7 @@ dependencies = [
"checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432"
"checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40"
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
"checksum mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "45a8a18a41cfab0fde25cc2f43ea89064d211a0fbb33225b8ff93ab20406e0e7"
"checksum mozangle 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "75a61b5a06b6f362eb45590ddf2643c255768a7039bcde1dc70320b97e7f9651"
"checksum net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9044faf1413a1057267be51b5afba8eb1090bd2231c693664aa1db716fe1eae0"
"checksum nix 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "319fffb13b63c0f4ff5a4e1c97566e7e741561ff5d03bf8bbf11653454bbd70b"
"checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce"
@ -2301,7 +2291,6 @@ dependencies = [
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)" = "940586acb859ea05c53971ac231685799a7ec1dee66ac0bccc0e6ad96e06b4e3"
"checksum xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57"
"checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2"
"checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5"
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
"checksum yaml-rust 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "95acf0db5515d07da9965ec0e0ba6cc2d825e2caeb7303b66ca441729801254e"

View File

@ -8,7 +8,7 @@ edition = "2018"
[target.'cfg(windows)'.dependencies]
euclid = "0.20"
gleam = "0.6.2"
mozangle = {version = "0.1", features = ["egl"]}
mozangle = {version = "0.2.7", features = ["egl"]}
webrender = {path = "../webrender"}
winapi = {version = "0.3", features = ["winerror", "d3d11", "dcomp"]}
winit = "0.19"

View File

@ -8,7 +8,6 @@ check-alphabetical-order = false
packages = [
"crossbeam-utils",
"gl_generator",
"khronos_api",
"lazy_static",
"nix",
"percent-encoding",
@ -17,7 +16,6 @@ packages = [
"winapi",
"core-graphics",
"core-text",
"xml-rs",
"yaml-rust",
]

View File

@ -54,7 +54,7 @@ ws = { optional = true, version = "0.9" }
svg_fmt = "0.4"
[dev-dependencies]
mozangle = "0.1"
mozangle = "0.2"
rand = "0.4"
[target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies]

View File

@ -42,7 +42,7 @@ headless = [ "osmesa-sys", "osmesa-src" ]
[target.'cfg(target_os = "windows")'.dependencies]
dwrote = "0.9"
mozangle = {version = "0.1.5", features = ["egl"]}
mozangle = {version = "0.2", features = ["egl"]}
[target.'cfg(all(unix, not(target_os = "android")))'.dependencies]
font-loader = "0.7"

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="display: grid; grid-template-rows: subgrid repeat(auto-fill, []);"></div>
<div style="display: grid">
<div style="display: grid; grid-template-rows: subgrid repeat(auto-fill, []);"></div>
</div>
</body>
</html>

View File

@ -653,6 +653,7 @@ load 1233191.html
load 1233607.html
load 1234701-1.html
load 1234701-2.html
load 1248227.html
load 1271765.html
pref(layout.css.xul-box-display-values.content.enabled,true) asserts(2) asserts-if(Android,1) load 1272983-1.html # bug 586628
pref(layout.css.xul-box-display-values.content.enabled,true) asserts(2) asserts-if(Android,1) load 1272983-2.html # bug 586628

View File

@ -1827,3 +1827,9 @@ class RecursiveMakeBackend(CommonBackend):
webidls_mk = mozpath.join(bindings_dir, 'webidlsrcs.mk')
with self._write_file(webidls_mk) as fh:
mk.dump(fh, removal_guard=False)
# Add the test directory to the compile graph.
if self.environment.substs.get('ENABLE_TESTS'):
self._compile_graph[mozpath.join(
mozpath.relpath(bindings_dir, self.environment.topobjdir),
'test', 'target-objects')]

View File

@ -1171,7 +1171,7 @@ linux64-aarch64/opt:
fetches:
toolchain:
- linux64-binutils
- linux64-clang
- linux64-clang-aarch64-cross
- linux64-rust
- linux64-rust-size
- linux64-cbindgen

View File

@ -145,7 +145,7 @@ linux64-clang-8-aarch64-cross:
- 'build/build-clang/clang-8-linux64-aarch64-cross.json'
resources:
- 'build/build-clang/clang-8-linux64-aarch64-cross.json'
toolchain-alias: linux64-aarch64-cross
toolchain-alias: linux64-clang-aarch64-cross
toolchain-artifact: public/build/clang.tar.xz
fetches:
fetch:

View File

@ -8,7 +8,7 @@ var EXPORTED_SYMBOLS = ["ZoomParent"];
class ZoomParent extends JSWindowActorParent {
receiveMessage(message) {
let browser = this.browsingContext.embedderElement;
let browser = this.browsingContext.top.embedderElement;
if (!browser) {
return;
}