This way we don't have to deal with QI to get a Selection out of a weakref.
mfbt weakrefs don't have a SizeOfOnlyThis. In any case, the memory used by the
weakref itself is pretty minor...
I've kept the nsAutoStrings in the StyleSheetInfo class on the hopes that the
compiler does RVO, but if it doesn't I can remove I guess.
MozReview-Commit-ID: 2vN6BSEhYcw
This is sound because the unlink implementation of the stylesheet drops the
preserved wrapper, and there are no strong references back to any node from the
stylesheet or any of the non-unlinked members.
This almost is the same setup that works for document sheets. We need to account
for a double reference in case the sheet is applicable because Servo keeps
another reference to it in that case, instead of in the StyleSet / PresShell.
Added the testcase as a crashtest, in the hopes that if it regresses leak
reporting on automation will catch it.
MozReview-Commit-ID: Kcc5oaOvP9A
The main thing to have into account is that the styleset to use is either
mLastStyleSheetSet, or mPreferredStyleSheetSet.
This last one gets set from Loader::IsAlternateSheet, which is quite nasty and
what I'm trying to remove.
MozReview-Commit-ID: BI4P1Chqtli
As part of applet/java plugin removal in bug 1279218, classid checking
was removed, as it was not obvious that this was used anywhere other
than java plugins. The classid is still a valid attribute on object
tags (and is sometimes used on tags for flash embedding). We want
to use a fallback strategy when we find objects with classid
attributes, as we don't support them, meaning we need to revert our
prior removal of the check.
MozReview-Commit-ID: BKQ34HGTkvt
--HG--
extra : rebase_source : 671bc831a7b500ba1a5643a8dbae69dd0c44acf4
I think it's harmless security-wise, since Text and char data are both
nsIContent, so the vtable offset should be the same.
I could also just do AsContent(), which may be cleaner but involve a virtual
call, or add AsCharacterData(), just let me know.
MozReview-Commit-ID: 79I9CuCmioF
--HG--
extra : rebase_source : 59bcd64ee4ae4d444a4dbeed9b5ecf97455c4422
We can directly get WebRenderBridgeChild by the function.
MozReview-Commit-ID: 6o4ZJMN2xAn
--HG--
extra : rebase_source : ba410297ad30f0bec00b1c65123b722d0b2869dd
This also removes any redundant Ci.nsISupports elements in the interface
lists.
This was done using the following script:
acecb401b7/processors/chromeutils-generateQI.jsm
MozReview-Commit-ID: AIx10P8GpZY
--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
Test changes for removal of PopupBoxObject and popup.xml methods, some reflow tests now have different stacks now that they are not going through popup.xml binding methods, test_popupanchor.xul changes due to need to wait for popuppositioned event after resizing. The old code would just adjust the arrow directly when sizeTo was called, but the new code does this through an asynchronous popuppositioned event. Changes to some places that check for XULElement class.
--HG--
rename : dom/webidl/PopupBoxObject.webidl => dom/webidl/XULPopupElement.webidl
rename : layout/xul/PopupBoxObject.cpp => dom/xul/XULPopupElement.cpp
rename : layout/xul/PopupBoxObject.h => dom/xul/XULPopupElement.h
Returning the same type and UpdateStyleSheet.
This hopefully helps seeing how the data flows between the methods, instead of
the messy bits we had before.
MozReview-Commit-ID: C6THNRi8bbg
The rules set in place in bug 839886 and bug 1377826 prevents any native
anonymous content to participate in auto-direction, both on having dir=auto
to work on it and have it to affect the direction of non-anonymous dir=auto
parent.
This patch relax the rules a little bit by allowing the anonymous element with
dir=auto to particiate in auto-direction. For simplicity, it would allow the
text node in to affact auto-direction only if the text node is the direct
children of the dir=auto parent.
This patch is needed for HTML-based in-content widget to display RTL
labels correctly. It shouldn't change any UI on its own; the purpose of
the fix here is to display RTL-text filenames correctly when bug 1446830
is fixed.
The change is needed in ResetDirectionSetByTextNode() because
when CC clean-up the document, the function is called from
nsTextNode::UnbindFromTree(). At that point, IsInAnonymousSubtree()
will cause an assertion error on when calling SubtreeRoot(),
since subtree hierarchy is already broken by earlier UnbindFormTree()
calls to our parent nodes.
Substitute that check with HasTextNodeDirectionalityMap() in and only
in ResetDirectionSetByTextNode() should be ok -- given the function
doesn't really do anything if HasTextNodeDirectionalityMap() is false.
There is no need to call EnsureMapIsClearFor() when the condition is false
either; EnsureMapIsClearFor() itself is a no-op if the condition is false.
MozReview-Commit-ID: GqF5ypDZcbH
--HG--
extra : rebase_source : e6bfd3d5792be73a8bbb768c7d5b122170b2f02a
extra : source : 6aeb0958693ccc51346713faad823debd9cceeae
After discussing with Olli there isn't any kind of severe problem out of this.
Shadow subtrees will be disconnected just like the rest, and they shouldn't
assume that the document hasn't been disconnected first.
MozReview-Commit-ID: CX4fXOqEIFj
--HG--
extra : rebase_source : cd30cb8b8199fb73120c0bcade68986454090005
This is used in JS via instanceof checks, and in C++ only to get the `inputField`
attribute (the actual HTML input or textarea). We can swap out instanceof by checking
the tag name, and we can directly query for the input field from C++.
MozReview-Commit-ID: 7xpHQMYzYhD
--HG--
extra : rebase_source : a5b62928665725133eb52e4df2fb6659a6109ffd
Given that resizer.svg will be loaded in non-chrome documents, we will
need to exclude it from the use counter.
MozReview-Commit-ID: 4ZzidKJUfBW
--HG--
extra : rebase_source : 9ce9d6e6a312695cfd19243499051bf26d91f79b
PerformanceCounters are currently disabled in two ways:
- a preference that's off by default "dom.performance.enable_scheduler_timing"
- calls made only for nightly using #ifndef RELEASE_OR_BETA
In order to simplify the code, let's remove the #ifndef and rely only on the pref.
That will also allows us to use the feature in every version going forward.
The performance will not be impacted since the current code is already using
the (cached) pref value to determine if the counters are used.
MozReview-Commit-ID: 47t2M1O13aH
--HG--
extra : rebase_source : e129e1829f1dc37c019e50e156474c4876d6d6cb
For the async caller, pretty much everything can be extracted out of the loader
/ loadData.
For the sync callers, we need to be a bit more careful because ReparseSheet
tries to get its line number on its own.
I changed the compat mode passed to the reparse stuff to be the document's one
in this case, but that seems a bug fix.
MozReview-Commit-ID: 2wi5HPRAlPi
Thunderbird uses DOMParser from C++ for now. They should ideally migrate that into JS, but we can give them something that works for the moment.
MozReview-Commit-ID: C4D6QuFdbn8
We always have one now. So we can remove all the codepaths that attempted to
handle the !mPrincipal case.
We can also remove the nsContentUtils::IsSystemPrincipal(mPrincipal) codepaths,
because that can never happen: DOMParser::Constructor never creates a DOMParser
with a system principal.
MozReview-Commit-ID: EUrGoiI0o3u
In our test suite, we only run into two calls to this constructor with a system
principal, and both are in test code.
After this, calling the WebIDL constructor from system code is _almost_
equivalent to creating by contract. The one difference is that the resulting
DOMParser (and the documents it creates) will have its script handling object
set to the global the constructor came from instead of being null.
MozReview-Commit-ID: Fe2yMeqoYnB
Some DOM unit tests rely on being able to parse XUL via DOMParser. That was allowed due to them calling init() with a system subject principal. It can be more narrowly allowed by adding an explicit setter for being able to parse XUL/XBL.
MozReview-Commit-ID: 3h0WWGHmYOn
We'll want to use this event to inject scripts before other scripts run
in XUL documents. It already fires in HTML documents.
MozReview-Commit-ID: 7FW0R8r9o9G
--HG--
extra : rebase_source : 28fe9b6a4bcbb6ecf8966a0c059d867bf66285bf
Vibration is the last user of permissions helper functions in
navigation, these can be simplified into the vibrate functionality.
MozReview-Commit-ID: CGA5WL7nObS
--HG--
extra : rebase_source : bdab714b0bd3a5774300ad71c07090a9565b75ea
Rather than recording how many leaked (ghost) windows we see at
various times, I think it will be more useful over all to record what
the maximum number of ghost windows we see during a single
ping. Hopefully this will show up in a way that generates automated
alerts better than GHOST_WINDOWS.
If this works out, I'll make this telemetry measure permanent and
remove GHOST_WINDOWS.
MozReview-Commit-ID: 11ma1lLGz5L
--HG--
extra : rebase_source : dc7705d288d3301fc0a1ec15f8dadfb66fe8820f