Removes nsIDOMHTMLEmbedElement and all references. HTML elements are
now handled by WebIDL. With the deprecation of extensions, XPCOM
interfaces to HTML elements are no longer needed.
MozReview-Commit-ID: DI4XVvdgPDI
--HG--
extra : rebase_source : 74bd92619e3d1db04c3dd40ec3022474fe1d647c
nsXPIDLStrings are marked as VOIDED upon initialization. Most of these local
nsXPIDLString variables are immediately set via getter_Copies(), which will
either assign a string value (using Adopt()) or do SetIsVoid(). These can be
trivially converted to nsString, which will get the same treatment.
The patch suitably converts the remaining nsXPIDLString local variable as well.
--HG--
extra : rebase_source : 5fff9f2c6844559198f601853f8db08564add7d5
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.
The patch also removes a couple of unused declarations from
nsIStringBundle.idl.
Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.
--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
According to the crash reports, nsPrintEngine::AfterNetworkPrint() may be called after nsPrintEngine::Destroy() is called. In this case, the method should do nothing because it's already been destroyed.
MozReview-Commit-ID: IwY9fR1OUwU
--HG--
extra : rebase_source : 6fb2e23a1e30da59c4c8823e72b8a4460c8adb28
This patch makes callers of nsPrintEngine::Print() and
nsPrintEngine::PrintPreview() grab the nsPrintEngine instance with local
variable before calling them. That guarantees that instance of nPrintEngine
won't be deleted during the calls. (We already had a RefPtr in CommonPrint
that basically did this. This patch moves it out to the callers to strengthen
its guarantee.)
MozReview-Commit-ID: 2jlYC4RKAg6
--HG--
extra : rebase_source : e6eac8df88e1d81d67a879786a2403ca00e84036
nsPrintEngine::FinishPrintPreview() may be called when nsAutoScriptBlocker is destroyed in nsPrintEngine::DoCommonPrint(). That means that the owner stopped print preview with the instance. In this case, nsPrintEngine::DoCommonPrint() doesn't need to keep initializing the instance anymore.
MozReview-Commit-ID: DRQfmyW9FEL
--HG--
extra : rebase_source : a49c0f5c74c24710334559496d173c3bae08db01
nsPrintObject::mPresShell and nsPrintObject::mPresContext are initialized by
nsPrintEngine::ReflowPrintObject(). However, while
nsPrintEngine::DoCommonPrint() is initializing mPrt and mPrintObject,
destroying nsAutoScriptBlocker may cause calling nsDocumentViewer::Destroy()
or nsPrintEngine::FinishPrintPreview() directly. Then,
nsPrintEngine::SetupToPrintContent() will be called. Therefore,
nsPrintEngine::SetupToPrintContent() sometimes see uninitialized mPrt, or
mPrt->mPrintObject->mPresShell and mPrt->mPrintObject->mPresContext.
Therefore, this patch makes nsPrintEngine::SetupToPrintContent() check whether
the necessary objects are already initialized. When one of them is not
initialized as expected, it won't to do anything.
Note that mPrt->mPrintObject is never nullptr with current design, but this
patch makes the method check it for preventing similar crash which might be
regressed with other bug fix in the future.
MozReview-Commit-ID: JKfObRm5enm
--HG--
extra : rebase_source : 977e9ffd7fc43fbeb3fac7dbd640df5a426a7427
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
nsRange::DoSetRange() adds/remove its root to/from mutation observer, initializes common ancestor, registers itself to the common ancestor, unregisters itself from old common ancestor, and notifies selection listeners of selection change.
However, those runtime cost is expensive but on the other hand, a lot of callers set both start and end of the range and that causes calling DoSetRange() twice.
This patch renames Set() to SetStartAndEnd() for easier to understand the meaning and make it call DoSetRange() only once.
MozReview-Commit-ID: FRV55tuBAgg
--HG--
extra : rebase_source : 67adf929cf119e2425f7d3741651217522094590
Although, this should be rewritten with range-based for loop, this patch just making them use nsCOMPtr to refer the objects.
MozReview-Commit-ID: IJBWs8CTyCF
For example, mPrt->mPrintObject is owned by mPrt. When nsPrintEngine needs to
call a method which takes a reference to mPrt->mPrintObject, the caller should
grab the mPrt instance for guaranteeing that mPrt->mPrintObject won't be deleted
during the method-call.
MozReview-Commit-ID: BiOQwVKdWM1
This function is arguably nicer than calling NS_ProcessNextEvent
manually, is slightly more efficient, and will enable better auditing
for NS_ProcessNextEvent when we do Quantum DOM scheduling changes.
Also, rewrite some for-loops as range-based.
Other APIs still using nsPrintObject* involve with
nsPrintData::mPrintDocList or nsPagePrintTimer::mPrintObj.
nsPrintEngine::FindPrintObjectByDOMWin() could have its argument converted
to UniquePtr, but it needs to return nullptr to represent "found nothing."
Therefore, I leave its argument as it was for consistency.
MozReview-Commit-ID: 7hXaVy5IKHQ
--HG--
extra : rebase_source : 6be730b85d5566446942b8cdc31b49846384bc25
This is the bulk of the changes.
- DisplayItemScrollClip is removed. Instead, we will have 1) ActiveScrolledRoot
and 2) DisplayItemClipChain.
- ActiveScrolledRoot points to a scroll frame and allows traversing up the
scroll frame chain.
- DisplayItemClipChain is a linked list of clips, each clip being associated
with the ActiveScrolledRoot that moves this clip.
- Each display item has an ActiveScrolledRoot and a clip chain.
- nsDisplayItem::GetClip returns the item of the clip chain that scrolls with
the item's ASR. The separation between "regular clip" and "scroll clips"
mostly goes away.
- Tracking clips in the display list builder's clip state happens very
similarly to how regular clips used to be tracked - there's a clip chain for
content descendants and a clip chain for containing block descendants. These
clip chains are intersected to create the combined clip chain.
- There are strict rules for the ASR of a container item: A container item's
ASR should be the innermost ASR which the item has finite clipped bounds with
respect to.
- At some point in the future, ASRs and AGRs should be reunified, but I haven't
done that yet, because I needed to limit the scope of the change.
MozReview-Commit-ID: KYEpWY7qgf2
--HG--
extra : rebase_source : c727f6300a35463750639e165bfa37374c06b851