This makes DOMException.prototype.toString() throw when it wouldn't have
before. But it throws in other browsers already, so this is presumably web-compatible.
The idea is this:
Offsets, like token positions and scripts' begin/end and
toString{Start,End}, are now always offset from the beginning of the
script's full ScriptSource buffer. That is, when delazifying, if the
buffer we are parsing is an interior pointer into some outer script's
ScriptSource buffer, the token offsets for that parsing session are
still offset from that outer buffer instead of the interior pointer.
The initial column number in CompileOptions will be added to the column
number when an offset maps to the initial line of the ScriptSource.
Columns are computed from offsets, but have no bearing on how to index
into the ScriptSource buffers.
flush() invalidates all buffers so buffer callbacks emitted earlier than that should not proceed when they're executed after.
MozReview-Commit-ID: 3KjCmW2VwTy
--HG--
extra : rebase_source : 11ea4f017e3add355f70762f8f43f82829f9ccd2
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
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
FocusTarget used to be needed in nsIPresShell, but it was moved to PresShell.
MozReview-Commit-ID: HQFpT9OJaUz
--HG--
extra : rebase_source : ddc29462fc71f8a71dd2419823ddf6f7e92a60ce
The simplistic shift-based hashing function creates a lot of collisions
for pointers pointing to arrays as it doesn't do a great job at distributing
the data randomly based on the input bytes.
imgRequestProxy::SyncClone preserves the original behaviour of issuing
synchronous notifications once cloned. Some uses and tests depend on
this behaviour but in an ideal world, it would not be required.
imgRequestProxy::Clone is intended to be the replacement going forward,
which issues asynchronous notifications once cloned.