This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).
It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).
Differential Revision: https://phabricator.services.mozilla.com/D99590
There's no use case for stateful comparators, so they can be just plain
function pointers.
This is used in some hot places like CSS selector matching.
Differential Revision: https://phabricator.services.mozilla.com/D77084
In the common case of using case sensitive matching, improvements come from:
* for attributes backed by nsStringBuffers, not needing to AddRef/Release the
string buffer
* for attributes backed by atoms, not needing to run the destructor of an
nsDependentAtomString
* for prefix and suffix attribute selectors, using memcmp instead of the
slower StringBeginsWith/StringEndsWith (which read a character at a
time and call a virtual function on the comparator object)
* for the substring attribute selector, using std::search(), which also
avoids virtual function calls on a comparator object
Attribute selector performance is important on pages with many links
with ad blocker extensions that use such selectors installed.
On my machine, this drops total time spent loading the single page HTML
spec
* under Gecko_AttrHasPrefix from 2.69 s to 1.25 s
* under Gecko_AttrHasSubstring from 1.06 s to 0.30 s
Differential Revision: https://phabricator.services.mozilla.com/D76643
Now mfbt/Move.h is empty except for that excellent comment about move
semantics... Should we put it somewhere else and delete the header as a
follow-up? Or just delete the header and carry on?
Differential Revision: https://phabricator.services.mozilla.com/D60297
--HG--
extra : moz-landing-system : lando
But don't hook it into style yet, that'll be a follow-up patch.
I had this patch in my local queue for a bit and there was no point in not
landing it I guess.
The value of this attribute could be stored only in the shadow root (as this
only applies to shadow hosts), but that would make invalidation harder, I think,
so do the obvious thing for now.
Differential Revision: https://phabricator.services.mozilla.com/D51963
--HG--
extra : moz-landing-system : lando
In the new setup, if the value is an integer and fits in our restricted integer
range we store it directly; otherwise we just go ahead and store it as a double
in the misc container, since we have a double available there anyway.
Differential Revision: https://phabricator.services.mozilla.com/D36264
--HG--
extra : moz-landing-system : lando
All callers treat '%' being found the same as not having consumed all the input,
so we can just stop consuming it.
Differential Revision: https://phabricator.services.mozilla.com/D36214
--HG--
extra : moz-landing-system : lando
We don't need to parse 'width' on <tr> because we never use the parsed value for
anything and neither does the spec.
We don't need to parse 'charoff' on <col> because we never use that for anything
either, and neither does the spec.
Differential Revision: https://phabricator.services.mozilla.com/D36128
--HG--
extra : moz-landing-system : lando
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
And thus massively speed up ascii-case-insensitive atom comparisons when both
atoms are lowercase (which is the common case by far).
This removes almost all the slow selector-matching in this page, and it seems
an easier fix than storing the lowercased version of all class-names in quirks
mode in elements and selectors...
Differential Revision: https://phabricator.services.mozilla.com/D10945
--HG--
extra : moz-landing-system : lando
Referrer policy argurment is passed from sheet/doc to URLExtraData, default
value is RP_Unset. We use default value in some cases, particularly when there's
no certain spec talks about that (svg for example)
MozReview-Commit-ID: 5VAX1ZUXD3i
Differential Revision: https://phabricator.services.mozilla.com/D1922
--HG--
extra : moz-landing-system : lando
Spinning on setting nsStyledElement::SetInlineStyleDeclaration causes
high malloc/free as MiscContainer is created for nsAttrValue passed to
Element::SetAttrAndNotify before the old one is delete'd.
Keep a cache of one MiscContainer in nsAttrValue to alleviate this
pattern.
MozReview-Commit-ID: 2RGaltPvVOn
--HG--
extra : rebase_source : a517035b1637ec7408b7b39bc7cce85074cabb44
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.
MozReview-Commit-ID: 5UQVHElSpCr
--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
This change stores the subject principal in the URLExtraData when parsing
style attributes, which causes it to be used as the triggering principal for
those loads rather than defaulting to the document principal.
MozReview-Commit-ID: 22tmNRRCgaj
--HG--
extra : rebase_source : d025870431a457a417523ff57bd8eac3b41d65d0
(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
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.
These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.
- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>
- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
- Count() --> Length()
- ObjectAt() --> ElementAt()
- AppendObject() --> AppendElement()
- RemoveObjectAt() --> RemoveElementAt()
- ns*Hashtable<nsISupportsHashKey, ...> -->
ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>
- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
- This requires adding a Get() method to nsRefPtrHashtable that it lacks but
nsInterfaceHashtable has.
- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
- nsArrayBase::Create() --> nsTArray()
- GetLength() --> Length()
- do_QueryElementAt() --> operator[]
The patch also has some changes to Rust code that manipulates nsIAtom.
MozReview-Commit-ID: DykOl8aEnUJ
--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1