A lot of files include nsCOMPtr without really needing it in dom/svg. (And a
few files use the nsCOMPtr type without including its header.)
For this patch, I found candidate files by just searching for files that only
had a single line that contained "nsCOMPtr", and I took the following actions:
- If the match is an #include, then remove it (replacing it with the include
for RefPtr or AlreadyAddrefed if the file uses those types instead).
- If the match is a usage of the type, then add an #include for nsCOMPtr (as
well as one for RefPtr, if the file uses that type).
(And in a few cases, I moved an adjacent #include, to get the #include list
closer to sortedness.)
I verified that the dom/svg directory continues to build successfully in
non-unified mode (i.e. if I remove UNIFIED_ from its moz.build file). So, I'm
not removing any includes that files are now inadvertantly leaning on other
compilation units to provide.
Differential Revision: https://phabricator.services.mozilla.com/D17422
--HG--
extra : moz-landing-system : lando
The patch also const-ifies a bunch of nearby fields.
MozReview-Commit-ID: IId52fm3Y7j
--HG--
extra : rebase_source : 8b84842dbb105672cce3cd90eef20290f28feb0e
Various places in dom/ use the pattern:
already_AddRefed<NodeInfo> ni = ...;
which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason. To fix our static analysis code, we need to
eliminate instances of the above pattern.
Unfortunately, eliminating this pattern requires restructuring how Nodes
are created. Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`. We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
This is consistent with most other methods that take a drawTarget parameter r=dholbert
--HG--
extra : amend_source : 77aa7f7d9cb19f9aa08014fff3b209dc151b75f3
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.
The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).
That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.
MozReview-Commit-ID: 2XlnkgdgDCK
In order to tailor certain security checks to the caller that is attempting to
load a particular piece of content, we need to be able to attach an
appropriate triggering principal to the corresponding requests. Since most
HTML content is loaded based on attribute values, that means capturing the
subject principal of the caller who sets those attributes, which means making
it available to AfterSetAttr hooks.
MozReview-Commit-ID: BMDL2Uepg0X
--HG--
extra : rebase_source : 25e438c243700a9368c393e40e3a6002d968d6c8
(Path is actually r=froydnj.)
Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.
MozReview-Commit-ID: 91U22X2NydP
--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
In order to facilitate the movement of code with side-effects called by Element::SetAttr to Element::BeforeSetAttr and Element::AfterSetAttr, Element::AfterSetAttr should have access to the old value of the attribute. This includes information about whether there was previously a value set or not.
Accomplishing this involved passing an additional argument through functions that find and change the old attribute value in order to ensure that we can differentiate between an empty old value and an absent old value (attribute was not set).
Note that while I tried to ensure that accurate values (and their absence) are reported to Element::AfterSetAttr, I largely ignored SVG. While the old value reported for SVG values should be however accurate the value already being reported to SetAttrAndNotify was, SVG elements do not currently report unset values properly because they will never pass a null pointer to SetAttrAndNotify.
MozReview-Commit-ID: K1mha8CNFZP
--HG--
extra : rebase_source : 42776eb01451d371e4aebcc17fe3dd112c8d268b
In the next patch we want to add a method called
GetUnanimatedStyleContextForElementNoFlush but that's much too long. Instead it
seems better to just drop 'ForElement' from all these methods since it should be
fairly obvious we are getting the style context for an element given that the
first argument is an element.
MozReview-Commit-ID: JQKaEuCKV2F
--HG--
extra : rebase_source : 3ba51f3b00d1ec7bc91102629d9c0abb88992fef