This StorageAccess code tells callers that they must partition third-party
storage, or deny storage access if that is not possible.
Differential Revision: https://phabricator.services.mozilla.com/D29740
--HG--
extra : moz-landing-system : lando
And with some tidying some comments and removing stray #include "gfxPrefs.h"
Differential Revision: https://phabricator.services.mozilla.com/D31468
--HG--
extra : moz-landing-system : lando
gfxPrefs Live preferences are almost identical to StaticPrefs.
We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.
Differential Revision: https://phabricator.services.mozilla.com/D31256
--HG--
extra : moz-landing-system : lando
This is an attempt to reduce the negative impact of bug 1553644 by replacing a
remote browser which fails to create an `mBrowserParent` actor with a tab
crashed display rather than a failed `nsFrameLoader`. This is done by firing the
`oop-browser-crashed` event on the owner `<browser>` element when the attempt
fails, even if no `BrowserParent` was ever created.
This does not fix the root cause of bug 1553644, but may make the browser better
at recovering.
Differential Revision: https://phabricator.services.mozilla.com/D32381
--HG--
extra : moz-landing-system : lando
I was clearly trying to do that in bug 882653 part 3 and failed to. Our
current behavior of passing two args to this error message (which only takes
one arg) is silly, and the only thing that makes it at all sane is that we only
use it in class hooks, which can never have the wrong sort of object, so it's
unreached code.
The comment cleanup is just to make the role of CGAbstractBindingMethod. and
the validity of the changes to it, clearer.
Differential Revision: https://phabricator.services.mozilla.com/D32478
--HG--
extra : moz-landing-system : lando
Moreover, prepone deleting the cached serializer with LAST_RELEASE
already.
Differential Revision: https://phabricator.services.mozilla.com/D32286
--HG--
extra : moz-landing-system : lando
The relevant definition in the spec;
https://drafts.csswg.org/css-device-adapt/#min-scale-max-scale
Before this change, if both of initial-scale and maximum-scale are negative,
both values are clamped to 0.25. Whereas with this change, negative scale
values are treated as if it's not specified so that initial-scale value is
automatically calculated based on the layout viewport size.
negative-initial-and-maximum-scale.html is a test case for the case.
Also with this change, initial-scale values are going to be clamped to the
range [0.25, 10] during parsing it so that initial-scale-0.html and
initial-scale-100.html need to be modified, now the former is scaled by 0.25x,
the latter is scaled by 10x.
(Before this change, initial-scale=0 and initial-scale=100 were treated as
invalid scale values in nsViewportInfo::ConstrainViewportValues[1])
[1] https://searchfox.org/mozilla-central/rev/6c9f60f8cc064a1005cd8141ecd526578ae9da7a/dom/base/nsViewportInfo.cpp#15,19
Differential Revision: https://phabricator.services.mozilla.com/D32098
--HG--
extra : moz-landing-system : lando
And with some tidying some comments and removing stray #include "gfxPrefs.h"
Differential Revision: https://phabricator.services.mozilla.com/D31468
--HG--
extra : moz-landing-system : lando
gfxPrefs Live preferences are almost identical to StaticPrefs.
We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.
Differential Revision: https://phabricator.services.mozilla.com/D31256
--HG--
extra : moz-landing-system : lando
Soon XUL documents will be loaded as XHTML and createElement will create HTML
elements instead of XUL element by default. This restriction can be removed
once we migrate everything.
Differential Revision: https://phabricator.services.mozilla.com/D31294
--HG--
extra : moz-landing-system : lando
Soon XUL documents will be loaded as XHTML and createElement will create HTML
elements instead of XUL element by default. This restriction can be removed
once we migrate everything.
Differential Revision: https://phabricator.services.mozilla.com/D31294
--HG--
extra : moz-landing-system : lando
This bug will use the browsing context to notify content tab to mute/unmute media, instead of using MessageManager. We would use the top level canonical browsing context to
set the media mute property for the top level window and propagate it to other top level windows in other processes.
If we don't do so, we're not able to mute/unmute media in the different process when we we enable Fission, because the current way we use can only notify one process and would cause the media on other process can't be muted/unmuted.
Differential Revision: https://phabricator.services.mozilla.com/D32077
--HG--
extra : moz-landing-system : lando
We need to notify the whole parent chain (using NOTIFY) rather than just
mStyleSets, since mStyleSets is empty for @import-ed sheets.
Differential Revision: https://phabricator.services.mozilla.com/D31787
--HG--
extra : moz-landing-system : lando
Abstracts the streaming details away. Reduces complexity of
`nsDocumentEncoder`.
Differential Revision: https://phabricator.services.mozilla.com/D31767
--HG--
extra : moz-landing-system : lando
Soon XUL documents will be loaded as XHTML and createElement will create HTML
elements instead of XUL element by default. This restriction can be removed
once we migrate everything.
Differential Revision: https://phabricator.services.mozilla.com/D31294
--HG--
extra : moz-landing-system : lando
Note that the "loose | normal | strict" values are not yet parsed/implemented.
Differential Revision: https://phabricator.services.mozilla.com/D29817
--HG--
extra : moz-landing-system : lando
Soon XUL documents will be loaded as XHTML and createElement will create HTML
elements instead of XUL element by default. This restriction can be removed
once we migrate everything.
Differential Revision: https://phabricator.services.mozilla.com/D31294
--HG--
extra : moz-landing-system : lando
Because it states more clearly what the functions and the constant are
about.
Differential Revision: https://phabricator.services.mozilla.com/D31615
--HG--
extra : moz-landing-system : lando
The tests added in this patch do not fail any of their assertions with or
without the code changes in this patch. However, without the code changes in
this patch they will both fail due to reported memory leaks.
Differential Revision: https://phabricator.services.mozilla.com/D31577
--HG--
extra : moz-landing-system : lando
Amend several test files for triggering eval() assertion through simpletest.js
Differential Revision: https://phabricator.services.mozilla.com/D30474
--HG--
extra : moz-landing-system : lando
The name `SelectionCopyHelper` didn't state what the function does.
Now, instead of `SelectionCopyHelper`, the following two call sequences
exist:
1) `EncodeDocumentWithContext`, `PutToClipboard`.
2) `EncodeDocumentWithContextAndCreateTransferable`, calling
`EncodeDocumentWithContext` and
`CreateTransferable`.
Apart from additional nullptr checks, the semantics didn't change.
Differential Revision: https://phabricator.services.mozilla.com/D31044
--HG--
extra : moz-landing-system : lando
targetFrame is modified during the intersection computation loop, so it's not
the viewport you want if there are scrollframes around.
The test is the same as iframe-no-root.html but with a wrapping scroller which
triggers this bug.
This code is quite subtle, so will refactor and clean it up in a followup.
Differential Revision: https://phabricator.services.mozilla.com/D31147
--HG--
extra : moz-landing-system : lando
Still having lots of issues with tests failing, but need to get this
landed for various reasons. Followup to pref on at Bug 1550571.
Differential Revision: https://phabricator.services.mozilla.com/D30563
If we're doing a process switch due to the cross origin opener policy
being mismatched, we don't want to preserve the browsing context.
Differential Revision: https://phabricator.services.mozilla.com/D26392
When changing processes and therefore destroying/rebuilding
frameloaders, add ability to keep the browsing context around and add
it to the new frameloader.
Differential Revision: https://phabricator.services.mozilla.com/D26267
The second patch in bug 1518202 made it so that the reference to the
browsing context is declared to the cycle collector after all.
Differential Revision: https://phabricator.services.mozilla.com/D31001
--HG--
extra : moz-landing-system : lando
This takes into account `white-space: pre` style of `nsTextNode`'s
parent element when formatting the selected text of the `nsTextNode`
node.
Differential Revision: https://phabricator.services.mozilla.com/D29159
--HG--
extra : moz-landing-system : lando
This closer mimics user behaviour, compared to the existing tests using
`getSelection().selectAllChildren`.
Differential Revision: https://phabricator.services.mozilla.com/D28850
--HG--
extra : moz-landing-system : lando
However, we continue to only respect a <meta name="viewport"> tag if
dom.meta-viewport.enabled is set.
Differential Revision: https://phabricator.services.mozilla.com/D30988
--HG--
extra : moz-landing-system : lando
We can run /debug mochitests against geckoview for the cost of another dozen
or so test annotations. Both /opt and /debug mochitests are nearly worthy of
tier 1, but still waiting for bug 1534732.
Differential Revision: https://phabricator.services.mozilla.com/D30931
--HG--
extra : moz-landing-system : lando
If an XPIDL interface has a method or attribute that is [notxpcom],
then it is implicitly treated as [builtinclass], even if it is not
marked as such. For clarity, this patch goes through and marks every
place that relies on this behavior (aside from some test code).
Differential Revision: https://phabricator.services.mozilla.com/D30714
--HG--
extra : moz-landing-system : lando
According to the spec [1] 7.2.10.2, we should use the first line box's height or width as positioning unit to adjust box's position.
We will also use this value to adjust box when `snap-to-line` is false.
There, we implement a new chrome-only API to acquire this information, which would return the first line box's size in the `block` frame.
[1] https://www.w3.org/TR/webvtt1/#ref-for-webvtt-cue-snap-to-lines-flag-12
Differential Revision: https://phabricator.services.mozilla.com/D29745
--HG--
extra : moz-landing-system : lando
When adjusting cue's position, the goal is to place cue boxes fully inside the rendering area, and place in the right place.
In order to check whether the box is correctly inside the rendering area, we have to know the correct size of the cue box.
Therefore, we implement the new chrome-only APIs to acquire this information (box's height and width), and this returned value won't be affected by CSS transformation, which is good for positioning.
Differential Revision: https://phabricator.services.mozilla.com/D27178
--HG--
extra : moz-landing-system : lando
Amend several test files for triggering eval() assertion through simpletest.js
Differential Revision: https://phabricator.services.mozilla.com/D30474
--HG--
extra : moz-landing-system : lando
This API abstracts away the details of the decision on what context should be
partitioned away from the consumers and centralizes the decision making into
the same location in the code base.
Differential Revision: https://phabricator.services.mozilla.com/D29742
--HG--
extra : moz-landing-system : lando
This StorageAccess code tells callers that they must partition third-party
storage, or deny storage access if that is not possible.
Differential Revision: https://phabricator.services.mozilla.com/D29740
--HG--
extra : moz-landing-system : lando
`nsIDocumentStateListener` is a scriptable interface and each method may run
any script. So, we should mark them as `can_run_script`. Then, we need to
mark a lot of editing methods because we need to mark
`EditorBase::EndTransactionInternal()` and `EditorBase::DoTransactionInternal()`
as `MOZ_CAN_RUN_SCRIPT`.
Differential Revision: https://phabricator.services.mozilla.com/D30360
--HG--
extra : moz-landing-system : lando
In this patch, we support
1. content-box (default)
2. border-box
And let ResizeObserverEntry expose these box sizes.
Besides, we store the mLastReportedSize as the logical size.
Differential Revision: https://phabricator.services.mozilla.com/D28737
--HG--
extra : moz-landing-system : lando
GetNodeDepth() is a special version for ResizeObserver to get the depth
of node (across Shadow DOM). Based on the comment in D27615, it's better
to move it into ResizeObserver.cpp.
Differential Revision: https://phabricator.services.mozilla.com/D28736
--HG--
extra : moz-landing-system : lando
The patch in bug 1507744 was not sufficient by itself, as the line-breaker could still accumulate a single "current word" across a text-run boundary, and then a single word-break value would be applied to it. We need to flush the line-breaker when word-break changes, so that each part of the word will have break opportunities set according to the appropriate value.
Differential Revision: https://phabricator.services.mozilla.com/D30260
--HG--
extra : moz-landing-system : lando
In order to have one call of `SerializeNodeEnd` for every `SerializeNodeStart`
call. In the current state of the code, the absence of these calls doesn't
cause bugs, but this can change anytime `SerializeNodeEnd` is changed. Moreover,
it makes it simpler to reason about the code.
Differential Revision: https://phabricator.services.mozilla.com/D29987
--HG--
extra : moz-landing-system : lando
Unfortunately, `EventChainVisitor` does not grab the `nsPresContext` with
`RefPtr` by itself. Therefore, there is no guarantee of the lifetime without
checking the origin when its subclasses are instantiated. This patch changes
it and subclasses to `MOZ_STACK_CLASS` since only `EventDispatcher::Dispatch()`
creates them in the stack with given `nsPresContext`. Additionally, it's
already been marked as MOZ_CAN_RUN_SCRIPT_BOUNDARY`. Therefore, the
`nsPresContext` instance has already been guaranteed its lifetime by the
caller. For making this fact stronger, this patch marks their constructors
as `MOZ_CAN_RUN_SCRIPT`. Therefore, nobody can create those instances without
guaranteeing the lifetime of `nsPresContext` and `dom::Event`. Note that
it may look like that `mPresContext` of `EventChainPostVisitor` is not
guaranteed. However, `EventChainPreVisitor` which gives `nsPresContext` to it
is also a stack only class. So, it won't be deleted before
`EventChainPostVisitor` instance.
Differential Revision: https://phabricator.services.mozilla.com/D30010
--HG--
extra : moz-landing-system : lando
We store newInnerGlobal in a Rooted, so as long as we expose on all codepaths
that assign to that variable (which with this patch we do, typically via
GetWrapper() calls), there's no need to expose explicitly.
Differential Revision: https://phabricator.services.mozilla.com/D29718
--HG--
extra : moz-landing-system : lando
Marking GetGlobalJSObject and GetGlobalJSObjectPreserveColor final and inline
on inner/outer windows allows compilers to de-virtualize and inline them, which
makes them just as fast as calling FastGetGlobalJSObject is now (in the case of
GetGlobalJSObjectPreserveColor; GetGlobalJSObject has to do the gray-unmarking,
which is a bit more work).
In WindowDestroyedEvent::Run we want to switch to GetGlobalJSObject(), because
we want to root the object and hence should unmark gray.
In nsGlobalWindowInner::RunTimeoutHandler we likewise want to unmark gray. The
AutoEntryScript constructor likely did that already, but it's not that
expensive when it doesn't need to do any work.
Differential Revision: https://phabricator.services.mozilla.com/D29711
--HG--
extra : moz-landing-system : lando
Consumers that just care about this boolean state should use this instead of
getting the JSObject* directly.
Differential Revision: https://phabricator.services.mozilla.com/D29705
--HG--
extra : moz-landing-system : lando
This can be used in things like assertions or some other rare circumstances
where not exposing the object to active JS is OK.
Differential Revision: https://phabricator.services.mozilla.com/D29704
--HG--
extra : moz-landing-system : lando
Need to write a test for this. Also, as a matter of preventive measure, null out
mOwner when it dies.
That may matter in the case where the controller dies while the observer is
getting notified. In that case, somebody still keeps a reference to the
controller. Right now is fine because nothing will touch it again (the
destructor doesn't), but that's not great, and it's better to just clear the
pointer.
Differential Revision: https://phabricator.services.mozilla.com/D29395
--HG--
extra : moz-landing-system : lando
This patch passes a message through the HangMonitor channel when navigating
through history to cancel content JS that could hang the chrome JS in the
content process responsible for history navigation. If the content JS is
actually canceled, this also disables the BF cache for the current page, since
it could end up in an inconsistent state due to the JS cancellation.
Differential Revision: https://phabricator.services.mozilla.com/D23089
--HG--
extra : moz-landing-system : lando
And also this patch moves some related methods which use the inline methods
and member variables used only by them.
Differential Revision: https://phabricator.services.mozilla.com/D29201
--HG--
rename : layout/base/nsIPresShellInlines.h => layout/base/PresShellInlines.h
extra : moz-landing-system : lando
Additionally, this patch makes `nsContentUtils::DispatchXULCommand()` because
it guarantees the lifetime of **only** `PresShell` in it. So, we need to check
the lifetime of each argument at each caller here.
Differential Revision: https://phabricator.services.mozilla.com/D29199
--HG--
extra : moz-landing-system : lando
There is the following usage of nsIPresShell:
```
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShellWeak);
```
So, for changing this to:
```
RefPtr<PresShell> presShell = do_QueryReferent(mPresShellWeak);
```
PresShell should have its own IID.
Differential Revision: https://phabricator.services.mozilla.com/D29197
--HG--
extra : moz-landing-system : lando
`CapturingContentInfo` struct is used only in `PresShell.cpp` so that we can
make it a private struct of `PresShell` if we move all users of them,
i.e., API to access them, from `nsIPresShell` to `PresShell`.
Differential Revision: https://phabricator.services.mozilla.com/D29111
--HG--
extra : moz-landing-system : lando
`nsIPresShell::ScrollAxis` can be used anywhere and it's used by some
utils actually. So, it should be in `mozilla` namespace and perhaps,
`PresShellForwards.h` is a good place to move it rather than creating
new header file.
Differential Revision: https://phabricator.services.mozilla.com/D29110
--HG--
extra : moz-landing-system : lando
We don't need to flush layout in the parent document if the parent and child
documents can't observe each other.
This will also match our behavior in a Fission world.
I'm not attached to the name of the function, better ideas welcome.
Differential Revision: https://phabricator.services.mozilla.com/D28217
It's possible for front-end references to nsIRemoteTab to outlive the IPDL actor. When
this happens, we should ignore methods and property accesses.
The one special case is that some code expects to be able to
access the TabId after the browser has been destroyed. For this
we can just cache the ID.
Differential Revision: https://phabricator.services.mozilla.com/D31449
--HG--
extra : source : 9b79caa460a01a7bdf9c27ede487de0ec642ae0b
extra : histedit_source : ec32bc78fac57f523b4c1b2aef08fddfccfbe546%2C8770eefa09a764733a09d8256ef9b3e2f04244df
BrowserParent is cycle collected and supported weak references, so this commit adds support
for these things to BrowserHost.
Differential Revision: https://phabricator.services.mozilla.com/D31448
--HG--
extra : source : e65cb2d4c5a55e3049922df02af643337b7a58b2
This commit removes nsIRemoteTab as a parent class from BrowserParent,
so that BrowserHost is the only concrete implementation of nsIRemoteTab.
Some static_cast's are updated to cast to BrowserHost, and other places
have to be updated to pass a BrowserHost instead of a BrowserParent.
WindowGlobalParent had a getter to return it's managing BrowserParent
as a nsIRemoteTab. I couldn't find a use of this in-tree, so I've just
opt-ed to remove it. If there's a use-case, we can add something back
in.
Differential Revision: https://phabricator.services.mozilla.com/D31444
--HG--
extra : source : 810b7371987139844429d0206f9da6a7701a1efc
This commit implements nsIRemoteTab in BrowserHost by delegating to nsIRemoteTab. In a
future commit, these methods will be implemented by BrowserHost.
Differential Revision: https://phabricator.services.mozilla.com/D31443
--HG--
extra : source : ee10a825448133635dbd933c3d60fe427400647b
This commit replaces the direct use of the IPDL actors in nsFrameLoader with
the RemoteBrowser interface. Some special use cases are adapted to still use
the IPDL actors. In the future, we should burn these use cases down.
Differential Revision: https://phabricator.services.mozilla.com/D31442
--HG--
extra : source : 1bcf9f586c5582ddeb822f4c2be3ca314694337e
This prepares nsFrameLoader for replacing mBrowserParent and mBrowserBridgeChild
with a common interface by making special case code use a getter method instead
of direct access.
Differential Revision: https://phabricator.services.mozilla.com/D31437
--HG--
extra : source : 32eeee79d628dade8109454c636d5f8aaff0c93e
This makes it symmetrical to how BrowserParent is created by ContentParent.
Differential Revision: https://phabricator.services.mozilla.com/D31436
--HG--
extra : source : 07678a2fa9e7cb164b2d3b07b8c61653253b7540
This API is only intended to be used in the chrome process and this commit
makes this explicit to simplify a later refactoring.
Differential Revision: https://phabricator.services.mozilla.com/D31434
--HG--
extra : source : b255e0a84e12657a62a2cdfd4a4c2ebb893b2a0d
This appears unused and adds unneeded surface area for these API's to support.
Differential Revision: https://phabricator.services.mozilla.com/D31431
--HG--
extra : source : 9a255864f75ddcf4096b6222d016a914f5a43c8a
This reduces the amount of code that assumes that BrowserParent implements nsIRemoteTab.
Differential Revision: https://phabricator.services.mozilla.com/D31430
--HG--
extra : source : 5f1c1b609ec1ecc28734e1b6daeeb3f6854ded38