The new name should make it more clear that this should not be the default way
to look up the BrowsingContext instance from a nsFrameLoader, as it does not
ensure that the BrowsingContext has been fully initialized and attached to the
tree.
Differential Revision: https://phabricator.services.mozilla.com/D62959
--HG--
extra : moz-landing-system : lando
This will ensure that the BrowsingContext has been attached before trying to
access properties on it.
Differential Revision: https://phabricator.services.mozilla.com/D62958
--HG--
extra : moz-landing-system : lando
The BrowsingContext is guaranteed to be being kept alive by
`nsFrameLoader::mBrowsingContext` and by the nsDocShell or RemoteBrowser object.
This improves the ergonomics of this helper method, which may help avoid misuse
of `mBrowsingContext`.
Differential Revision: https://phabricator.services.mozilla.com/D62957
--HG--
extra : moz-landing-system : lando
CLOSED TREE
Backed out changeset d6fd08e3fccf (bug 1615480)
Backed out changeset ad31eae54af2 (bug 1615480)
Backed out changeset 70aff2593d98 (bug 1615480)
The new name should make it more clear that this should not be the default way
to look up the BrowsingContext instance from a nsFrameLoader, as it does not
ensure that the BrowsingContext has been fully initialized and attached to the
tree.
Differential Revision: https://phabricator.services.mozilla.com/D62959
--HG--
extra : moz-landing-system : lando
This will ensure that the BrowsingContext has been attached before trying to
access properties on it.
Differential Revision: https://phabricator.services.mozilla.com/D62958
--HG--
extra : moz-landing-system : lando
The BrowsingContext is guaranteed to be being kept alive by
`nsFrameLoader::mBrowsingContext` and by the nsDocShell or RemoteBrowser object.
This improves the ergonomics of this helper method, which may help avoid misuse
of `mBrowsingContext`.
Differential Revision: https://phabricator.services.mozilla.com/D62957
--HG--
extra : moz-landing-system : lando
We should start seeking from the child-at-start/end-offset, rather than the
selection container.
The logic to select the starting node was backwards too...
If we're finding backwards we want to start looking from the beginning of the
range and vice versa. But I think that doesn't really matter since
nsWebBrowserFind always gives us a start range with start == end.
Differential Revision: https://phabricator.services.mozilla.com/D63553
--HG--
extra : moz-landing-system : lando
We should start seeking from the child-at-start/end-offset, rather than the
selection container.
The logic to select the starting node was backwards too...
If we're finding backwards we want to start looking from the beginning of the
range and vice versa. But I think that doesn't really matter since
nsWebBrowserFind always gives us a start range with start == end.
Differential Revision: https://phabricator.services.mozilla.com/D63553
--HG--
extra : moz-landing-system : lando
This patch assumes that only element node can have content node. I.e., we
won't hit the following `MOZ_ASSERT`:
```
Element* element = nullptr;
nsIContent* content = aContent;
while (content) {
if (content->IsElement()) {
element = content->AsElement();
break;
}
content = content->GetParent();
}
MOZ_ASSERT(!content || content == element || content->GetParent() == element);
```
Differential Revision: https://phabricator.services.mozilla.com/D63308
--HG--
extra : moz-landing-system : lando
In order to generate media default metadata, we need to know document's title in the media session controller.
Therefore, store this property in `WindowGlobal` to allow we access document's title in chrome process.
Differential Revision: https://phabricator.services.mozilla.com/D62534
--HG--
extra : moz-landing-system : lando
Slightly clarfifies the relation of `Selection` and `nsFrameSelection`.
This requires undesirable 'kungFuDeathGrips'. However, they existed
already, only via an indirect call.
Differential Revision: https://phabricator.services.mozilla.com/D63479
--HG--
extra : moz-landing-system : lando
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.
Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.
Differential Revision: https://phabricator.services.mozilla.com/D62604
--HG--
extra : moz-landing-system : lando
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.
Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.
Differential Revision: https://phabricator.services.mozilla.com/D62604
--HG--
extra : moz-landing-system : lando
When structured clone reads a SAB and creates a new SAB object, or
when it serializes a SAB onto a channel, call a callback that lets the
embedder know. The embedder can then adjust its policy. Concretely,
we want to allow the browser to serialize threads in a process that
uses JS shared memory.
Note, for WebAssembly.Memory, reading and writing are delegated to the
cloning operations for SAB, so no special handling is needed.
Differential Revision: https://phabricator.services.mozilla.com/D61455
--HG--
extra : moz-landing-system : lando
Replace ElementOrCSSPseudoElement with Element and add PseudoElement (which is
a DOMString) into KeyframeAnimationOptions and KeyframeEffect.
Differential Revision: https://phabricator.services.mozilla.com/D62667
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
Simplifies reasoning about table-cell related code, because it's less
coupled with `nsFrameSelection`.
Differential Revision: https://phabricator.services.mozilla.com/D62903
--HG--
extra : moz-landing-system : lando
Chrome does not allow nested `Document.execCommand()` calls:
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/editing/commands/document_exec_command.cc;l=75;drc=301e5d079a1b4c29c5b17574d0470e6db7370acc
On the other hand, Safari (and Firefox) allows it. However, it's worthwhile to
follow Chrome's behavior.
This patch makes `Document::ExecCommand()` return `false` when it's called
while running another `Document::ExecCommand()` call on Nightly and early Beta.
This is exactly same behavior, and we should watch broken web apps reports
for a while before riding this on the train.
And this patch sets the pref to `true` when all crash tests under
`editor/libeditor/crashtests` which depend on nested calls of `execCommand` run
since same things may be reproducible with other DOM APIs.
Differential Revision: https://phabricator.services.mozilla.com/D62815
--HG--
extra : moz-landing-system : lando
The original check, `currentContent != startContent`, is to skip the element we started on in frame traversal.
This would happen for instance on a scrollable element, where frame traversal could return the element again.
However, in shadow dom case, the frame traversal may start on a redirected shadow host, where `startContent` is still the original start element.
Differential Revision: https://phabricator.services.mozilla.com/D61566
--HG--
rename : testing/web-platform/tests/shadow-dom/focus/focus-tabindex-order-shadow-zero.html => testing/web-platform/tests/shadow-dom/focus/focus-tabindex-order-shadow-zero-host-scrollable.html
extra : moz-landing-system : lando
The checks for `*TopLevelScopeOwner` are to skip the scope that we have already checked.
But when the shadow host is scrollable, we will traverse anonymous children for the scroll frame first in frame traversal and `oldTopLevelScopeOwner` will be reset.
Then we don't realize that we have already checked the host's scope.
Differential Revision: https://phabricator.services.mozilla.com/D60923
--HG--
rename : testing/web-platform/tests/shadow-dom/focus/focus-tabindex-order-shadow-zero-host-not-set.html => testing/web-platform/tests/shadow-dom/focus/focus-tabindex-order-shadow-zero-host-not-set-scrollable.html
extra : moz-landing-system : lando
The idea is to propagate error messages defined in js.msg to
StructuredCloneHolder and throw it with a data clone error later. So that
developers can still understand the reason why serialization/deserialization
fails and we don't need to implement two similar set of error messages on JS and
DOM sides.
Note that this patch gave up the original idea (report error message to
console), but developers can stil get the error message by catching the
exception.
Differential Revision: https://phabricator.services.mozilla.com/D62260
--HG--
extra : moz-landing-system : lando
So that we can generate nsImageFrame for lazy load image elements in the first
place.
Differential Revision: https://phabricator.services.mozilla.com/D61942
--HG--
rename : layout/reftests/image/moz-broken-matching-1.html => layout/reftests/image/moz-broken-matching-lazy-load.html
extra : moz-landing-system : lando
For backward compatibility, `Document::EditingStateChanged()` calls
`HTMLEditor::BeginingOfDocument()` to initialize selection when the document
becomes editable first time. However, it checks whether
`Document::mEditingState` was ``EditingState::eOff` or not. This looks enough,
but not so because `Document::MaybeEditingStateChanged()` calls it
asynchronously if `contenteditable` element appears at not safe to run script.
Therefore, this patch makes it check `Document::mContentEditableCount` value
which is modified synchronously from `Element::AfterSetAttr()` (additionally,
this makes it check whether there is at least a range in normal selection too,
though).
Differential Revision: https://phabricator.services.mozilla.com/D62814
--HG--
extra : moz-landing-system : lando