OneShotPostRefreshObserver works as the caller registers it, and
let it deletes itself via the DidRefresh method. The issue is that
DidRefresh is not guaranteed to run, and it'll leak PresShell
if it doesn't run.
This patch allows nsPresContext to store and release the last
registered OneShotPostRefreshObserver, and converted the existing
usage of OneShotPostRefreshObserver to use that. So instead of asking
OneShotPostRefreshObserver to delete itself, we now ask nsPresContext
to release it.
Differential Revision: https://phabricator.services.mozilla.com/D99939
Geckodriver doesn't support touch input yet, so convert new added the touch tests
into mochitest, these mochitest wpt could be removed once we could pass the
corresponding tests in wpt.
Depends on D101667
Differential Revision: https://phabricator.services.mozilla.com/D102044
Calling setPointerCapture or releasePointerCapture in pointerup event handler would
throw error due to the active pointer is removed in PreHandlerEvent which is too
early. So defer removing active pointer to PostHandeEvent to make the active pointer
available in pointerup or pointercancel event handler.
This patch adds WPTs which has been verified on Chrome. geckodriver doesn't support
touch input yet, so mark tests for touch as expected ERROR for now.
Differential Revision: https://phabricator.services.mozilla.com/D101667
RunOnBackgroundThread has been renamed to RunOnBackgroundThreadAndResolve. The
body dealing with calling InvokeAsync for calling a function on the background
event target and returning a MozPromise has been refactored into a new
function, RunOnBackgroundThread.
This allows us to have more complicated IOUtils methods that do not simply
resolve their promises to whatever is returned by the background methods.
Differential Revision: https://phabricator.services.mozilla.com/D99002
We add two @-moz-document functions: `plain-text-document()`, matching the
obvious, and `unobservable-document()`, which matches a top-level document with
no opener. This is the equivalent check we do for automatic darkening of
`about:blank` here:
https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/layout/base/PresShell.cpp#5282
The former we don't need to use, but it's nice to let user stylesheets target
plaintext documents properly (rather than relying on extensions or what not).
Note that these are not content-observable.
Add two tests: One showing that we produce different rendering when on dark
mode, and one showing that we produce the same one from an iframe, regardless
of dark mode.
Depends on D101517
Differential Revision: https://phabricator.services.mozilla.com/D101518
They should be different, test_pointer-events-5.xhtml was intended to test non-existent clip paths as part of bug 975206
Differential Revision: https://phabricator.services.mozilla.com/D102091
We add two @-moz-document functions: `plain-text-document()`, matching the
obvious, and `unobservable-document()`, which matches a top-level document with
no opener. This is the equivalent check we do for automatic darkening of
`about:blank` here:
https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/layout/base/PresShell.cpp#5282
The former we don't need to use, but it's nice to let user stylesheets target
plaintext documents properly (rather than relying on extensions or what not).
Note that these are not content-observable.
Add two tests: One showing that we produce different rendering when on dark
mode, and one showing that we produce the same one from an iframe, regardless
of dark mode.
Depends on D101517
Differential Revision: https://phabricator.services.mozilla.com/D101518
We add two @-moz-document functions: `plain-text-document()`, matching the
obvious, and `unobservable-document()`, which matches a top-level document with
no opener. This is the equivalent check we do for automatic darkening of
`about:blank` here:
https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/layout/base/PresShell.cpp#5282
The former we don't need to use, but it's nice to let user stylesheets target
plaintext documents properly (rather than relying on extensions or what not).
Note that these are not content-observable.
Add two tests: One showing that we produce different rendering when on dark
mode, and one showing that we produce the same one from an iframe, regardless
of dark mode.
Depends on D101517
Differential Revision: https://phabricator.services.mozilla.com/D101518
We add two @-moz-document functions: `plain-text-document()`, matching the
obvious, and `unobservable-document()`, which matches a top-level document with
no opener. This is the equivalent check we do for automatic darkening of
`about:blank` here:
https://searchfox.org/mozilla-central/rev/014fe72eaba26dcf6082fb9bbaf208f97a38594e/layout/base/PresShell.cpp#5282
The former we don't need to use, but it's nice to let user stylesheets target
plaintext documents properly (rather than relying on extensions or what not).
Note that these are not content-observable.
Add two tests: One showing that we produce different rendering when on dark
mode, and one showing that we produce the same one from an iframe, regardless
of dark mode.
Depends on D101517
Differential Revision: https://phabricator.services.mozilla.com/D101518
RunOnBackgroundThread has been renamed to RunOnBackgroundThreadAndResolve. The
body dealing with calling InvokeAsync for calling a function on the background
event target and returning a MozPromise has been refactored into a new
function, RunOnBackgroundThread.
This allows us to have more complicated IOUtils methods that do not simply
resolve their promises to whatever is returned by the background methods.
Differential Revision: https://phabricator.services.mozilla.com/D99002
This patch adds two tests, one for the mochitest and another for WPT.
Both tests will test the case of loading the about:blank page. And
mochitest tests the case of setting document.domain additionally.
The WPT framework won't support testing the document.domain case, so
there is no such test in the WPT.
Differential Revision: https://phabricator.services.mozilla.com/D101360
This patch changes the checking condition about the cases that we don't
need to reset the window.name.
Also, we take the domain into account when checking the principals of
the old and new documents. This would make the window.name to be
reset if the document.domain was changed to a cross-origin.
Differential Revision: https://phabricator.services.mozilla.com/D101359
Legacy LocalStorage checks if origins are in the same site by checking suffix
so that https://test2.example.com was expected to share site quota with
http://example.com and http://test1.example.com in the test.
However, in Fission, process isolation is based on SiteOrigin and that means
https://test2.example.com runs in one process and the other two run in another
process.
This patch only updates the test to ensure testing origins run in the same
process when Fission enables. The usage synchronization is still an issue and
that means Fission needs LSNG to be enabled.
Differential Revision: https://phabricator.services.mozilla.com/D101888
The handler is called before opening the connection again. This does not restore
the behaviour before Bug 1684912 exactly. In case removal of the usage or database
file fails, the handler will not be called. Also, the handler can no longer fail,
which simplifies the control flow.
Differential Revision: https://phabricator.services.mozilla.com/D100761
Take a step towards replacing the encoding menu with a single menu item that
triggers the autodetection manually. However, don't remove anything for now.
* Add an autodetect item.
* Add telemetry for autodetect used in session.
* Add telemetry for non-autodetect used in session.
* Restore and revise telemetry for how the encoding that is being overridden
was discovered.
Differential Revision: https://phabricator.services.mozilla.com/D81132
Storing the charset on cache entries makes the code path uselessly different
when loading from cache relative to uncached loads. Also, for future
telemetry purposes, caching the charset obscures its original source.
Differential Revision: https://phabricator.services.mozilla.com/D101570
Previously, in both Read and ReadUTF8, we were doing copies where we did not
need to. Read allocated an nsTArray and passed that to JS, which performed a
copy of its contents to create a Uint8Array. ReadUTF8, on the other hand, would
take that nsTArray, convert it into ns nsString (1 copy), and then pass it to
JS for it to recreate the string (2 copies).
Now, we allocate our string and array buffers up front in JS' memory pools
directly and use the JS API to create the strings and arrays ourselves (instead
of relying on Promise::MaybeResolve() to do a copying conversion). Read now
performs 0 copies in the best case (if the file is not compressed) and ReadUTF8
also does 0 copies in the best case (if the file is not compressed and the
string is ASCII). In the worst case, Read performs a single extra allocation
(to decompress the file) and ReadUTF8 performs 2 (to decompress the file and to
convert a UTF-8 string to either a Latin1 string or a UTF-16 string).
Differential Revision: https://phabricator.services.mozilla.com/D99004
Instead of accepting a DOMString (ie, a UTF16 string) and manually converting
it to UTF-8, we can instead accept a UTF8String from JS, which saves us
manually doing conversions and (and may save an additional conversion if the
JSString* is an ASCII string).
Differential Revision: https://phabricator.services.mozilla.com/D99003