Empty inline nodes except non-container nodes are not required in the
destination paragraph. Therefore, it should just remove the node from the
DOM tree.
Differential Revision: https://phabricator.services.mozilla.com/D157416
We don't ignore invisible data node at joining 2 paragraphs and this is
a different behavior from the other browsers. When looking for a content
from current block boundary, `AutoBlockElementsJoiner` should keep scanning
visible things with ignoring invisible data nodes. Then, it should delete
all invisible things after joining the paragraphs.
Differential Revision: https://phabricator.services.mozilla.com/D157414
Chrome and Safari preserve `white-space` with `style` attribute to keep
collapsible or preserved white-spaces as-is. If an HTML element is moved,
`style` attribute should be set to it. Otherwise, create `<span>` element
whose `style` attribute has the declaration for `white-space` and move
content into it.
Differential Revision: https://phabricator.services.mozilla.com/D157413
Gecko just joins 2 blocks when editable block parents are same element, e.g.,
both are `<div>`. However, Chrome and Safari moves only first line of the
right block into the left block, and Gecko does it when both blocks are
different elements.
Ideally, we should take same behavior as Chrome and Safari because it's
reasonable for both compatibility with the other browsers and consistency
when both blocks are different but has same style, then we don't need to
maintain different behavior paths.
However, doing it for all elements are too risky because right block will be
merged into left block if right block has no line break. On the other hand,
without doing it, preserving `white-space` is really hard because we need to
maintain the both paths.
Therefore, I'd like to change the behavior only when both blocks have different
`white-space` styles. Usually, web apps do not change `white-space` for each
block, so I think that this is safer than doing this in all elements,
additionally, we can revert the behavior easy since this patch is really small.
Differential Revision: https://phabricator.services.mozilla.com/D157412
This fixes bug 503838 partially. The new utility method scans unnecessary
`<br>` with strict check as far as possible. Then, we can delete the node or
the preformatted line break at end of the last text node.
Differential Revision: https://phabricator.services.mozilla.com/D157411
This patch ports most part of `editor/libeditor/tests/test_bug772796.html` to
WPT because this kind of behaviors are not tested by `editing/run/delete.html`
nor `editing/run/forwarddelete.html`. (Not ported tests are invalid HTML
structure cases and list item cases, the reason why not doing this for the
latter is, it needs a lot of cases and not important for most web apps.)
The most expectations are based on Chrome and Safari (they both behave almost
same), but they fail a lot in `join-pre-and-other-block.html` and
`white-space: pre-line` cases in the other tests.
Even though this ports a lot of cases, for making easier to compare the
behavior change in the following patches, we should keep the tests.
Differential Revision: https://phabricator.services.mozilla.com/D157410
This gecko integration code is better managed with the other devtools platform
hook code. To simplify resolving the JSM and avoiding issues around restricted
use of eval in chrome, I also reset the DIST_SUBDIR config and run the xpcshell
tests without a firefox-appdir. The test works on Android these days, so
re-enable it on that platform.
Differential Revision: https://phabricator.services.mozilla.com/D157522
When we move this out of the js/ directory, a number of lint exceptions stop
applying so we should just fix the issues now.
Differential Revision: https://phabricator.services.mozilla.com/D157521
Use 'globalThis' instead of 'this' when trying to attach a debugger to the
current global to avoid subtle footguns with the varied definitions of 'this'.
The debugger interface needs a true GlobalObject so this is much clearer. In
particular, this is a problem in test_nativewrappers.js when the test runs in
strict mode since the 'this' in the test function is no long implicitly the
global.
Differential Revision: https://phabricator.services.mozilla.com/D157544
A cross origin image request should not respect the given style image
orientation, but should use any image orientation provided by the image.
Differential Revision: https://phabricator.services.mozilla.com/D156919
nsXPCWrappedJS use a special extra refcount to support weak references. When
a WJS is held alive only by this refcount, instead of holding its JS object
alive, the JS object holds it alive. This patch adds support for properly
cycle collecting WJS in this state. First, it makes it so the CC will traverse
these WJS, so that it has a chance to collect them. Secondly, it represents
the reference from the JS object to the WJS via the NoteWeakMapping API.
This lets us represent a strong reference outside of the actual object.
This also adds some basic tests for the lifetime of WJS with weak references.
The first two tests pass with and without this patch. This patch makes the
third test pass.
Differential Revision: https://phabricator.services.mozilla.com/D157672
The cycle collector needs to be able to see nsXPCWrappedJS that are held
alive only from JS in order to unlink them. This patch adds a linked
list of WJS that are subject to finalization, and suspects those WJS in
the CC. Wrapped JS are normally suspected via the JS holder mechanism,
but that skips things, like WJS subject to finalization, that aren't holding
alive JS objects.
Differential Revision: https://phabricator.services.mozilla.com/D157671
For nsXPCWrappedJS, we need to add an edge to the cycle collector graph
from the JS object to its WJS, even though the JS object does not actually
contain a pointer to the WJS object. We can (mis)use the weak mapping
interface for this purpose. The only difference is that we need it during
traversal instead of while adding roots. The API is fairly specialized to
the specific use case we need.
Differential Revision: https://phabricator.services.mozilla.com/D157529
This help factorise all code trying to instantiate a server and a client everywhere.
This will also help migrate from descriptor to commands in Toolbox constructor.
A good way to track all leftover manual instantiation of descriptors is to look for mainRoot.get*.
There should only be tests now, and descriptor-from-url, which I would to convert once
we migrate toolbox constructor from descriptor to commands.
Differential Revision: https://phabricator.services.mozilla.com/D157737
Change the behavior of the QuickActions provider, so that setting the
pref `quickactions.enabled` to false will prevent showing quick action
results in all contexts, while setting `suggest.quickactions` to false
will only prevent showing quick action results in the default search
mode (i.e., quick action results will still appear in the Quick Actions
search mode enabled by typing `> ` in the urlbar).
Differential Revision: https://phabricator.services.mozilla.com/D157702
ResizeObserver only handles multiple fragments when the preference
dom.resize_observer.support_fragments is true.
That's because this experimental behavior may have compat problems.
But the last remembered size uses an internal ResizeObserver,
so changing the signature of the callback is not a problem.
Differential Revision: https://phabricator.services.mozilla.com/D158034
Remove all the thread names only used in tests from ThreadAllows.txt.
Instead, list the test files that create them in ThreadFileAllows.txt.
Differential Revision: https://phabricator.services.mozilla.com/D157762
Filenames alone do not uniquely identify files in the Mozilla codebase.
Allow specification of path-elements alongside filenames.
Differential Revision: https://phabricator.services.mozilla.com/D157761
Expand the processor for ThreadAllows.txt and ThreadFileAllows.txt to
also recognize and permit comments prefixed by `#`.
Differential Revision: https://phabricator.services.mozilla.com/D157760
Automatic update from web-platform-tests
[beacon-api] Fix sendondiscard web tests's assertions
1. Move sendondiscard web tests to `wpt_internal/`:
Tests in this file were not working properly as the BackgroundSync
permission is set to `Denied` by default in the web test runner.
Moving to `wpt_internal/` allows the use of
`internals.setPermission()` API.
2. There was also a bug in `expectBeacon()` function which didn't
check the total number of sent beacons properly.
This CL fixes the above issues.
Bug: 1293679,1364348
Change-Id: Ia037080f94303279154fa0d71d33cf364712590c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907264
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Ming-Ying Chung <mych@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049485}
--
wpt-commits: 5d424eb8c75dee2c8c11f4d5db17ee4e31fe1a71
wpt-pr: 35960
Automatic update from web-platform-tests
Prerender: Upstream tests for cross-origin iframe in prerendered pages
This CL upstreams tests for the cross-origin iframe including
a sandbox iframe in prerendered pages to the WPT repository.
sandbox iframes should be treated as the cross-origin iframe
specified in the draft spec:
https://wicg.github.io/nav-speculation/prerendering.html#delay-crossorigin
Bug: 1253158
Change-Id: Id34264eaec7584fbef38844a20ef8c15636d156d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3908027
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1049479}
--
wpt-commits: dd968b9c3f154a515342d1f57b8c722ef6da4d6f
wpt-pr: 35988
Automatic update from web-platform-tests
FrameSet NG: Fix a crash on re-showing a sub FRAMESET
We clear NeedsLayout flags of FRAMESET children which are not fit in
the FRAMESET's grid. We should clear their NGPhysicalFragments too in
order not to re-use stale fragment trees when a child fits in the grid
again.
Bug: 1365048
Change-Id: I638f68eba61d557b1aede9d4f686998f0c774d60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3904719
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049471}
--
wpt-commits: b4cafb54ac6b0835c8b09174d2b92cb123b2afbd
wpt-pr: 35983
Automatic update from web-platform-tests
Prerender: Upstream tests for the referrer on prerendering navigation
This CL upstreams tests that prerender uses the page's default referrer
policy. The behavior isn't described in spec, but discussed in [1].
[1] https://github.com/WICG/nav-speculation/issues/51
Bug: 1253158
Change-Id: I8ea931af24ecefc8da84f9710945b36c8e1ea98d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907161
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1049450}
--
wpt-commits: c607b88000b40a6d41005087c499f52eb5734dfd
wpt-pr: 35959
Automatic update from web-platform-tests
Make multiple-centered-dialogs.html handle different zoom levels better.
This changes the test to get the necessary heights with subpixel
precision rather than with getters that round to pixels, and then
expects the result to be accurate within 0.05px. These sizes may be
subpixel values when the device-pixel-scale is not an integer.
Fixed: 1365295
Change-Id: I1107a60cb8ff39f8d028f54a37b5ba13ab7b678b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3906230
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049441}
--
wpt-commits: 51085f9ff9bf6685b3bb5664cb9d6f1f82c27933
wpt-pr: 35984
Automatic update from web-platform-tests
[anchor-position] Support nested block fragmentation
In a nested block fragmentation context, fragmentainers of the
inner context may not have the correct block offsets. This is
intentionally omitted because it is expensive, and it is not
necessary for existing usages.
However, when anchors in the nested multicol is fragmented by
the outer multicol, anchor query needs the offsets. This patch
changes to let anchor query to search anchors from the outer
block fragmentation context in such cases.
|NGLogicalAnchorQueryForFragmentation| can find fragments and
their offsets by traversing descendants. By giving the outer
block fragmentation context to it, it can determine the
correct offsets of the inner fragmentainers.
Bug: 1309178
Change-Id: I0e98ed8b345b3fda1a08d9bb5b4e25cb7903f306
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3881852
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Alison Maher <almaher@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1049351}
--
wpt-commits: 42108c3d10b6982fc52fbdd678f8e1cfdf3f2bd4
wpt-pr: 35971
Automatic update from web-platform-tests
[last-baseline] Fix alignment baseline for spanning items.
When introducing the minor baseline groups we didn't set/get the
baseline from the correct set.
This changes the logic such that when use access a minor baseline we
use the end set.
Bug: 885175
Change-Id: I88f1d8fce2fc056d971fc7c4cc4c75ec50d232a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3905711
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Kurt Catti-Schmidt <kschmi@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1049300}
--
wpt-commits: 3505e87ffb37558ea29d04778726a2c79ed8d61a
wpt-pr: 35977
Automatic update from web-platform-tests
[last-baseline] Propagate last-baseline from tables.
For more details see:
https://github.com/w3c/csswg-drafts/issues/7655#issuecomment-1248528627
Effectively we should propagate the last-baseline from the last
table-row (we ignore caption baselines for example).
If the row is baseline aligned (using vertical-align: baseline) this
becomes the first & last baseline (until we support
"align-content: last baseline"), otherwise we use the lowest
content-edge.
Bug: 885175
Change-Id: Id9de2f8baff5511fd4da2cef3f056c1bac0fc112
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3907838
Reviewed-by: David Grogan <dgrogan@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049240}
--
wpt-commits: 55e1c625687971d6e9ad0836127bb2f679f33123
wpt-pr: 35976