diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-14 21:50:13 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-14 21:50:13 -0400 |
commit | bebec8fcb84dba6b684dfe1cc6c8a1e7741df374 (patch) | |
tree | 682329072ca4d617d06295c6576ba1c45c3db78e /dom/base/nsContentUtils.cpp | |
parent | 5352b69a9286223272c0ed072900b4c78ba2ed7c (diff) | |
download | UXP-bebec8fcb84dba6b684dfe1cc6c8a1e7741df374.tar UXP-bebec8fcb84dba6b684dfe1cc6c8a1e7741df374.tar.gz UXP-bebec8fcb84dba6b684dfe1cc6c8a1e7741df374.tar.lz UXP-bebec8fcb84dba6b684dfe1cc6c8a1e7741df374.tar.xz UXP-bebec8fcb84dba6b684dfe1cc6c8a1e7741df374.zip |
Bug 1321284 - Crash in nsCSSFrameConstructor::GetInsertionPrevSibling when trying to reframe native anonymous content
* Make StyleChildrenIterator skip NAC generated by root element primary frame ancestors.
* Add nsINode::GetFlattenedTreeParentNodeForStyle.
* Add iterator class to find all restyle roots.
NOTE: Parts 1, 2, and "4.2"
Tag #1375
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r-- | dom/base/nsContentUtils.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 4f7b71b19..6a819818c 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -103,6 +103,7 @@ #include "nsHtml5Module.h" #include "nsHtml5StringParser.h" #include "nsIAddonPolicyService.h" +#include "nsIAnonymousContentCreator.h" #include "nsIAsyncVerifyRedirectCallback.h" #include "nsICategoryManager.h" #include "nsIChannelEventSink.h" @@ -9837,6 +9838,24 @@ nsContentUtils::AttemptLargeAllocationLoad(nsIHttpChannel* aChannel) return reloadSucceeded; } +/* static */ void +nsContentUtils::AppendDocumentLevelNativeAnonymousContentTo( + nsIDocument* aDocument, + nsTArray<nsIContent*>& aElements) +{ + MOZ_ASSERT(aDocument); + + // XXXheycam This probably needs to find the nsCanvasFrame's NAC too. + if (nsIPresShell* presShell = aDocument->GetShell()) { + if (nsIFrame* scrollFrame = presShell->GetRootScrollFrame()) { + nsIAnonymousContentCreator* creator = do_QueryFrame(scrollFrame); + MOZ_ASSERT(creator, + "scroll frame should always implement nsIAnonymousContentCreator"); + creator->AppendAnonymousContentTo(aElements, 0); + } + } +} + /* static */ bool nsContentUtils::IsLocalRefURL(const nsString& aString) { |