It seems no one actually care about the order of the list, and the order
is completely meaningless if the script insert new @import rules.
Changing the order makes inserting faster, and make it easier for later
patch to get the latest inserted child sheet.
MozReview-Commit-ID: 72eKqVoPbZ7
--HG--
extra : source : 6b2b471b993f33f9d06af01e4863cd6c5d34ce3a
I've propagated quirks mode information on some places. But we needed to pass
quirks mode to some other FFI functions to be able to handle that information
properly.
MozReview-Commit-ID: JovQWjN3YJx
--HG--
extra : rebase_source : bd25ba4276ae21ff4feb80e56b311202019268a0
This is necessary because if we pass in the import rule, we would need
to invoke Servo_ImportRule_GetSheet to get the child sheet. However,
Servo_ImportRule_GetSheet tries to lock the global rwlock with read
access, while Servo_CssRules_InsertRule has already locked the same
rwlock with write access for the CSSOM case.
Since the import rule itself is never needed in the code path, it is
easier to just pass in the child stylesheet.
MozReview-Commit-ID: 4njNyGniPIm
--HG--
extra : rebase_source : ad88929713fdc5a581addc044094fa8130125121
These changes allow us to asynchronously load pre-loaded stylesheets, in a way
that's similar to ChromeUtils.compileScript. The new method returns a Promise
which resolves to the preloaded sheet once it's finished loading.
This will allow us to remove the last remaining use of synchronous channels in
moz-extension: URLs.
MozReview-Commit-ID: 7J52ff93YKT
--HG--
extra : rebase_source : 20fa013cdc7f5fbedb5ce671ede17765a2abbac2
When constructing a Loader without passing a document, we added a DocGroup
parameter so that we could still use it to dispatch events to the DocGroup.
Delete NS_ENSURE_TRUE because new() is infallable.
Use another runnable pointer for calling dispatching because forget() will
nuke the pointer and we need to use evt afterwards.
MozReview-Commit-ID: Ce2K6j4pUhA
--HG--
extra : rebase_source : 2bacf1f856e0700f36b2fefe4d2424719cad77a7
It is a preparation for later patch which moves functions from those
classes into StyleSheet. Some of the functions are better defined in
StyleSheetInlines.h.
This commit is generated by the following command:
find . \( -name '*.h' -or -name '*.cpp' \) -not -name '*StyleSheet*' -exec sed -i -b \
-e '/^#include/ s_/\(CSS\|Servo\)StyleSheet\.h_/StyleSheetInlines.h_' \
-e '1,\_^#include "mozilla/StyleSheetInlines.h"_ ! { \_^#include "mozilla/StyleSheetInlines.h"_d }' {} +
MozReview-Commit-ID: 54H5x27Pmso
--HG--
extra : source : e4fe253a8f82c3c58e5191d6af66fb0e85f2df19
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:
nsAutoCString spec;
uri->GetSpec(spec);
printf("uri: %s", spec.get());
to be changed to this:
printf("uri: %s", uri->GetSpecOrDefault().get());
This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.
I will fold this into part 1 before landing.
--HG--
extra : rebase_source : ddc19a5624354ac098be019ca13cc24b99b80ddc
This makes a lot of code more compact, and also avoids some redundant nsresult
checks.
The patch also removes a handful of redundant checks on infallible setters.
--HG--
extra : rebase_source : f82426e7584d0d5cddf7c2524356f0f318fbea7d