Some tests were using "secret" APIs to get at telemetry knowledge from various
processes in various ways. Adjust them so that they work with the new ways of
doing things.
MozReview-Commit-ID: 2iBL00HVGyg
Revert "Bug 1379762 part 3. Don't mess about with load blockers if our document is already in the COMPLETE readyState. r=smaug"
This reverts commit 942614f701b47b4a650a0ec3d206d6c5921aba84.
--HG--
extra : rebase_source : 64b3ac9c9d23f176b3c04dd218fac5c6c5733237
Some tests were using "secret" APIs to get at telemetry knowledge from various
processes in various ways. Adjust them so that they work with the new ways of
doing things.
MozReview-Commit-ID: 2iBL00HVGyg
Some tests were using "secret" APIs to get at telemetry knowledge from various
processes in various ways. Adjust them so that they work with the new ways of
doing things.
MozReview-Commit-ID: 2iBL00HVGyg
`nsRange` registers mutation observers to adjust the range when content
changes. However, there are some cases where we adjust the start and/or
end offsets but don't notify selection listeners (i.e. we don't call
`nsRange::DoSetRange` to set the new range points, contrary to what the
comment above `nsRange::DoSetRange` says). This patch makes us call
`nsRange::DoSetRange` in those cases. The patch adds a testcase in
test_selectevents.html, and changes a few unexpected-pass cases in
test_composition_text_querycontent.xul that this patch fixed.
MozReview-Commit-ID: 73D8RYMS3MS
--HG--
extra : rebase_source : da0cc3073e4b8ad23c6f6eab42da5aa8b269cae9
When the start node is a non-container node (i.e. <br>), and the start
offset is 0, we should not include a newline character for the node. For
example, for this range,
> <br/>hello
> \___/
the start node/offset is (<br/>, 0) and end node/offset is ("hello", 1).
The calculated range offset should be 0, and the range length should be
2: 1 for the <br/> newline character plus 1 for "h".
The patch also ensures this behavior for pre-mode nsContentIterator, for
both start and end node adjustments. For start nodes, we include any
non-container nodes with offset 0 in the range. For end node, we exclude
any non-container nodes with offset 0 from the range.
MozReview-Commit-ID: Lt2tCLbapq7
--HG--
extra : rebase_source : 7d86b6cf04581f1cd71fa85f8c8586541b3a84e9
This commit changes async keyboard scrolling to be enabled only if the content to
scroll is from a selection. This works around the problem of detecting whether
an arbitrary element has key listeners that should prevent async key scrolling,
because when they have the focus we will have disabled async key scrolling.
MozReview-Commit-ID: 6HhSuGZNsMX
--HG--
extra : rebase_source : 98a6449dd1e913136ca66532a67df8e0bb717e52
In the frontend we need to know if XUL buttons in the toolbar were
triggered by a touch event, so we're passing on the inputSource
in the command event.
MozReview-Commit-ID: DMvgZULk9hT
--HG--
extra : rebase_source : c455c8ec77e439bf02c1e3e8d34a36e1fb5e3bd0
Also, one unused include of nsIProgrammingLanguage, which is unrelated.
MozReview-Commit-ID: LJf2NSwmaYG
--HG--
extra : rebase_source : 63dfca9185535dbfa695cf2f383d81a14ce423c0
We make the NodeInfoInner members raw pointers, and AddRef/Release
them manally in the constructor/destructor of NodeInfo, and in the
cases where NodeInfoInner objects are created for hashtable lookups,
no further refcounting is performed.
The test helper_touch_action_regions.html uses nsDOMWindowUtils to synthesize native input events and creates some runnables to trigger the test. It expects the runnables which synthesize native input events are processed first, then the runnables to continue the test, and finally the input events are forwarded from chrome process to content process. Enabling event prioritization may change the execution order.
Wraps those runnables to synthesize native input events as priority=input and dispatches those runnables to continue the test with priority=input to make sure the execution order is as expected.
MozReview-Commit-ID: 8hkaB1FRW9T
This patch is mainly to make IdleTaskRunner reusable by nsHtml5TreeOpExecutor.
The only necessary work to that purpose is to remove the dependency of
sShuttingDown, which was a static variable in nsJSEnvironment.cpp.
The idea is to have a "ShouldCancel" as a callback for the consumer to
return sShuttingDown.
In addition to sShuttingDown, we use std::function<bool()> as the runner
main callback type.
MozReview-Commit-ID: FT2X1unSvPS
--HG--
extra : rebase_source : dc9bcf669a95dda5c40bccde2cbc836099536eb5
Nothing is changed in this patch except for renaming and code move around.
The strategy is to have the final file setup in this patch without any
detail change. The actual code change will be in the next patch so that
we can focus on reviewing the diff in the next patch regarding IdleTaskRunner.
MozReview-Commit-ID: 4Bul9mZ7z1n
--HG--
extra : rebase_source : 22aeb5dca58501ec335ef8bc7b0efb6aea565bbf
This combines the GhostWindowsReporter with the nsWindowMemoryReporter. It has
the benefit of removing a reporter of a single value and also guarantees that
we use the latests ghost windows value that is calculated in
|nsWindowMemoryReporter::CollectReports| rather than a possibly cached value
from a previous run.
Avoid hitting the rather slow effective TLD service by caching results when
mapping URLs to their base domains. In testing the cache ranged from a 1:1 to
a 3:1 hit:miss ratio.
We already periodically calculate the ghost window amount after cycle
collection, this just uses a cached value of that for the distinguished amount.
This avoids the overhead of a recalculating the value when reporting telemetry.
Most of these changes are just replacements of GetNativeOfWrapper with
UnwrapReflectorToISupports, which is all it did under the hood.
The other changes are as follows:
* In nsDOMClassInfo, we really care whether we have a window, so we can just
UNWRAP_OBJECT to the Window interface, since Window is always on Web IDL
bindings now. Also, the weird compartment check hasn't been needed ever since
GetNativeOfWrapper stopped returning things off the passed-in object's
prototype chain (Firefox 22, bug 658909).
* The only use of do_QueryWrapper was to get a Window in nsDocument; again we
can UNWRAP_OBJECT.
* In XPCJSRuntime, we again just want to check for a Window, so UNWRAP_OBJECT.
Allow for either the usual 3 base process count or with activity-stream both 3 or 4 counts.
MozReview-Commit-ID: 2VQuq4KpBPK
--HG--
extra : rebase_source : 1c846f3d07da477ebf6564532116c6dc1ceaf882
When loading a style sheet, if the SourceMap (or legacy X-SourceMap)
response header was seen, record it and make it available to chrome
scripts.
MozReview-Commit-ID: 3wtUADzgrI3
--HG--
extra : rebase_source : 25ed09e264d4b3a679ae970c709dedd4d50e2324
Given that elements in anonymous subtree have already been excluded from
participating in auto direction, it shouldn't make anything worse to
also exclude anonymous text node from that.
MozReview-Commit-ID: DJKiHqkvVvJ
--HG--
extra : rebase_source : 408347f62ce1d25e9ee5606109b489ded9231a4d
When changing selection into a contenteditable element in non-focused document, new focused editor shouldn't be scrolled into the view for compatibility with the other browsers.
MozReview-Commit-ID: FabqizyJrPW
--HG--
extra : rebase_source : 5bd2a017ec4c4f4fc0a6f7644fba2769b3ffca2c
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:
- a 16-bit C string literal, which is then converted to an 8-bit string in
order for the lookup to occur;
- an 8-bit C string literal converted to a 16-bit string, which is then
converted back to an 8-bit string in order for the lookup to occur.
This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.
The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.
Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.
The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)
--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
DOM Standard defines that offset of Range is unsigned long. However, nsRange uses int32_t to them.
This patch makes nsRange use uint32_t instead. However, this patch does NOT allow to set over INT32_MAX as offset values since a lot of users of nsRange cannot treat the values as over INT32_MAX because a lot of internal APIs take int32_t as offsets.
For easier to search such points, this patch adds static_cast<int32_t> to uint32_t variables when they are used for int32_t arguments.
And note that nsContentUtils::ComparePoints() behaves odd. It accepts negative offset and compares such value with valid offset simply. This patch still uses int32_t offset variables in nsRange::CompareNodeToRange() even though it may be negative value if nsINode::IndexOf() returns -1 because the caller of it depends on this behavior.
MozReview-Commit-ID: 8RbOgA86JuT
--HG--
extra : rebase_source : 46d526c6d50dfa2f104439b19b8691477b17a4af
This does NOT change variable names like |endNode| because it's not odd and somebody use it for nsINode and endContent for nsIContent. So, changing them needs more work.
MozReview-Commit-ID: 22imUltlu5R
--HG--
extra : rebase_source : 6c93069d0586b37c5084eaa71861085c01da7a7d
This does NOT change variable names like |startNode| because it's not odd and somebody use it for nsINode and startContent for nsIContent. So, changing them needs more work.
MozReview-Commit-ID: H19pTDprRuT
--HG--
extra : rebase_source : 7a7454ac14da48a597ff19a50c863d04dcaddd6e
Web standards use "Container" instead of "Parent". So, nsRange shouldn't use "Parent" for its members and methods.
MozReview-Commit-ID: Ho6N0diuWtE
--HG--
extra : rebase_source : ee4eb7068a68b118c7fe98e9e9e7fa9c9e7f13e2
nsIURI.originCharset had two use cases:
1) Dealing with the spec-incompliant feature of escapes in the hash
(reference) part of the URL.
2) For UI display of non-UTF-8 URLs.
For hash part handling, we use the document charset instead. For pretty
display of query strings on legacy-encoded pages, we no longer care to them
(see bug 817374 comment 18).
Also, the URL Standard has no concept of "origin charset". This patch
removes nsIURI.originCharset for reducing complexity and spec compliance.
MozReview-Commit-ID: 3tHd0VCWSqF
--HG--
extra : rebase_source : b2caa01f75e5dd26078a7679fd7caa319a65af14
Create states::CURRENT and add it to the list of "universal" (global)
ARIA states. Map states::CURRENT to ATK_STATE_ACTIVE and emit accessible
state-change notifications when the value of aria-current is modified.
I don't bother to label the runnables in the parent process being fired by
VisitedQuery, as we are not planning to perform scheduling in the parent process
if I remember correctly. It would be possible to label those runnables as well.
This also adds a mSeen boolean to the mObservers array, to fix a race caused
when a link is being registered as an observer between NotifyVisited and
NotifyVisitedForDocument being run.
MozReview-Commit-ID: EosNOu62fEV
It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)
This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.
--HG--
extra : rebase_source : 0f781bca68b5bf3c4c191e09e277dfc8becffa09
Deduct timeout execution time from a continuously regenerating
execution budget. Then throttle timeouts by using that budget in
TimeoutManager::MinSchedulingDelay to adjust the minimum value if
the budget is negative. The minimum value is adjusted to be a
value where the budget would have regenerated to be +0 ms.
The execution budget is clamped by values in ms defined in prefs:
* dom.timeout.background_throttling_max_budget: 50
* dom.timeout.foreground_throttling_max_budget: -1
A value equal or less than 0 means that the budget is infinite.
The regeneration rate can be controlled by the following prefs:
* dom.timeout.background_budget_regeneration_rate
* dom.timeout.foreground_budget_regeneration_rate
one each for foreground and background throttling.
To not starve timeouts indefinitely we clamp the minimum delay using
the pref:
* dom.timeout.budget_throttling_max_delay: 15000
The feature is behind the pref:
* dom.timeout.enable_budget_timer_throttling
Fire upload.onabort and upload.onloadend when abort() called. Original code
won't fire onabort if mUploadComplete is true.
Per https://xhr.spec.whatwg.org/#request-error-steps xhr.upload.onabort fires before .onabort
We never actually use this, and it causes assertions with fuzzing, so
just delete it.
MozReview-Commit-ID: 595M09mD0K2
--HG--
extra : rebase_source : 7fdcbeaa6db0c92b5818eae48624f0c74e660505