Giving '0' (literal zero) to nsCOMPtr is now ambiguous, as both
nsCOMPtr(decltype(nullptr)) and nsCOMPtr(T*) could be used.
In any case, our coding standards mandate the use of 'nullptr' for pointers.
So I'm changing all zeroes into nullptr's where necessary.
MozReview-Commit-ID: LXiZTu87Ck6
--HG--
extra : rebase_source : f9dcc6b06e9ebf9c30a576f9319f76a51b6dc26f
This allows other UAs to use it, removes duplicated checks, and
increases the chance of us noticing if the spec changes. Some of the
expected values in our mochitest were contrary to the spec.
I checked the new expected failures against the spec and the other UAs.
I filed a spec bug for one group because it was contrary to all UAs
(although IMO the spec makes more sense and the UAs are buggy), and the
others are fixed in the next patch.
MozReview-Commit-ID: 1j11XgfuErB
If we have a creator parser, then we were a parser-inserted script and should
presumably be able to set a valid insertion point when we run or fire our
load/error events. For the error event case, we do this in
nsScriptElement::ScriptAvailable, so that async error events due to things like
bogus script URLs do not end up with a valid insertion point. For the load
event case, we just do this in ScriptEvaluated directly.
ScriptEvaluated is called while the scriptloader has our script set as the
current parser-inserted script. But for the error event case we need to
maintain that state around the ScriptAvailable call that will fire the event.
The new name makes the sense of the condition much clearer. E.g. compare:
NS_WARN_IF_FALSE(!rv.Failed());
with:
NS_WARNING_ASSERTION(!rv.Failed());
The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.
--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
The new behavior matches the specification, web-platform-tests, Chrome,
and Edge. I couldn't figure out any reason for the old behavior.
MozReview-Commit-ID: 6cktZuN1vCV
The patch is generated from following command:
rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,
MozReview-Commit-ID: AtLcWApZfES
--HG--
rename : mfbt/unused.h => mfbt/Unused.h
Slightly less than half (93 / 210) of the NS_METHOD instances in the codebase
are because of the use of NS_CALLBACK in
nsI{Input,Output,UnicharInput},Stream.idl. The use of __stdcall on Win32 isn't
important for these callbacks because they are only used as arguments to
[noscript] methods.
This patch converts them to vanilla |nsresult| functions. It increases the size
of xul.dll by about ~600 bytes, which is about 0.001%.
--HG--
extra : rebase_source : c15d85298e0975fd030cd8f8f8e54501f453959b
This patch makes the following changes on many in-class methods.
- NS_IMETHODIMP F() override; --> NS_IMETHOD F() override;
- NS_IMETHODIMP F() override {...} --> NS_IMETHOD F() override {...}
- NS_IMETHODIMP F() final; --> NS_IMETHOD F() final;
- NS_IMETHODIMP F() final {...} --> NS_IMETHOD F() final {...}
Using NS_IMETHOD is the preferred way of marking in-class virtual methods.
Although these transformations add an explicit |virtual|, they are safe --
there's an implicit |virtual| anyway because |override| and |final| only work
with virtual methods.
--HG--
extra : rebase_source : 386ee4e4ea2ecd8d5001efabc3ac87b4d6c0659f
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.
As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
This patch:
- Removes eTreeOpAddError{Atom,TwoAtoms}, which are unused.
- Adds a MOZ_CRASHing case for eTreeOpUninitialized.
- Reorders the cases in the switch to match the enum declaration order, which
makes it easier to see that all opcodes are now covered.
The web platform tests changes are just a cherrypick of
https://github.com/w3c/web-platform-tests/pull/2926 so I don't have to add
failure annotations until the next test uplift.
I've audited our uses of nsIFormControl, and this patch looks to me like it
preserves existing behavior in all but the following cases:
1) nsXBLPrototypeHandler::DispatchXBLCommand, the case of scrolling when space
is pressed while something inside a <label> is focused. We used to not scroll
in this situation; I think this is a bug, so I'm changing that behavior to
scroll instead.
2) In Accessible::RelationByType for the RelationType::DEFAULT_BUTTON case,
when mContent is a <label> we used to return its form's default submit element.
Now we will just return Relation().