From 00812e30dfa70f9b1a752cf0d09de00f6d401c85 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Wed, 26 Jun 2019 01:51:45 +0300 Subject: Attach FrameProperties to each frame instead of using a shared hashtable Dispense the shared hashtable and instead attach the frame property list directly to nsIFrame. --- layout/base/nsPresShell.cpp | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'layout/base/nsPresShell.cpp') diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index d4fbebbf2..dacc6603b 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1306,19 +1306,6 @@ PresShell::Destroy() // Destroy the frame manager. This will destroy the frame hierarchy mFrameConstructor->WillDestroyFrameTree(); - // Destroy all frame properties (whose destruction was suppressed - // while destroying the frame tree, but which might contain more - // frames within the properties. - if (mPresContext) { - // Clear out the prescontext's property table -- since our frame tree is - // now dead, we shouldn't be looking up any more properties in that table. - // We want to do this before we call DetachShell() on the prescontext, so - // property destructors can usefully call GetPresShell() on the - // prescontext. - mPresContext->PropertyTable()->DeleteAll(); - } - - NS_WARNING_ASSERTION(!mWeakFrames, "Weak frames alive after destroying FrameManager"); while (mWeakFrames) { @@ -2047,7 +2034,7 @@ PresShell::NotifyDestroyingFrame(nsIFrame* aFrame) } // Remove frame properties - mPresContext->NotifyDestroyingFrame(aFrame); + aFrame->DeleteAllProperties(); if (aFrame == mCurrentEventFrame) { mCurrentEventContent = aFrame->GetContent(); @@ -2076,8 +2063,7 @@ PresShell::NotifyDestroyingFrame(nsIFrame* aFrame) // frame from FrameLayerBuilder::DisplayItemData::mFrameList -- otherwise // the DisplayItemData destructor will use the destroyed frame when it // tries to remove it from the (array) value of this property. - mPresContext->PropertyTable()-> - Delete(aFrame, FrameLayerBuilder::LayerManagerDataProperty()); + aFrame->DeleteProperty( FrameLayerBuilder::LayerManagerDataProperty()); } } @@ -10929,11 +10915,12 @@ PresShell::GetRootPresShell() void PresShell::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, - nsArenaMemoryStats *aArenaObjectsSize, - size_t *aPresShellSize, - size_t *aStyleSetsSize, - size_t *aTextRunsSize, - size_t *aPresContextSize) + nsArenaMemoryStats* aArenaObjectsSize, + size_t* aPresShellSize, + size_t* aStyleSetsSize, + size_t* aTextRunsSize, + size_t* aPresContextSize, + size_t* aFramePropertiesSize) { mFrameArena.AddSizeOfExcludingThis(aMallocSizeOf, aArenaObjectsSize); *aPresShellSize += aMallocSizeOf(this); @@ -10953,6 +10940,12 @@ PresShell::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, *aTextRunsSize += SizeOfTextRuns(aMallocSizeOf); *aPresContextSize += mPresContext->SizeOfIncludingThis(aMallocSizeOf); + + nsIFrame* rootFrame = mFrameConstructor->GetRootFrame(); + if (rootFrame) { + *aFramePropertiesSize += + rootFrame->SizeOfFramePropertiesForTree(aMallocSizeOf); + } } size_t -- cgit v1.2.3 From 7979df5512bef6e1a67fbcc390817128fd4e7743 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 18 Jul 2019 19:09:05 +0200 Subject: Revert "Capture delayed events and cancel as necessary." Tag #1052 (backout). Backed out for creating issues like #1191 and other issue-less problems with e.g. losing the caret from text boxes. Of note: this was also backed out from m-c for similar reasons in Bug 1332433. This fixes #1191. This reverts commit 3424afccaebc71c4acd4fa9eadf519c408c5965b. --- layout/base/nsPresShell.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'layout/base/nsPresShell.cpp') diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index dacc6603b..264b52b18 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -8178,9 +8178,6 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, } } } - if (aEvent->mMessage == eKeyDown) { - mIsLastKeyDownCanceled = aEvent->mFlags.mDefaultPrevented; - } break; } case eMouseUp: @@ -8970,9 +8967,6 @@ PresShell::FireOrClearDelayedEvents(bool aFireEvents) !doc->EventHandlingSuppressed()) { nsAutoPtr ev(mDelayedEvents[0].forget()); mDelayedEvents.RemoveElementAt(0); - if (ev->IsKeyPressEvent() && mIsLastKeyDownCanceled) { - continue; - } ev->Dispatch(); } if (!doc->EventHandlingSuppressed()) { @@ -9767,12 +9761,6 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) : mEvent = keyEvent; } -bool -PresShell::DelayedKeyEvent::IsKeyPressEvent() -{ - return mEvent->mMessage == eKeyPress; -} - // Start of DEBUG only code #ifdef DEBUG -- cgit v1.2.3