summaryrefslogtreecommitdiffstats
path: root/layout/base/nsCSSFrameConstructor.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-16 17:51:36 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-16 17:52:30 -0400
commit1f5c67934f05d036de575c3d8172587fa6d398bc (patch)
tree2b9107c18edfe1752152febbc68f938050136d84 /layout/base/nsCSSFrameConstructor.cpp
parent32c3ee92b8b9b1640d346761b36c642f9a968ce3 (diff)
downloadUXP-1f5c67934f05d036de575c3d8172587fa6d398bc.tar
UXP-1f5c67934f05d036de575c3d8172587fa6d398bc.tar.gz
UXP-1f5c67934f05d036de575c3d8172587fa6d398bc.tar.lz
UXP-1f5c67934f05d036de575c3d8172587fa6d398bc.tar.xz
UXP-1f5c67934f05d036de575c3d8172587fa6d398bc.zip
Bug 1343937 - Fix a crash in nsWrapperCache.h
* Implement and use GetInFlowParent * Exempt scrollbar NAC from the new NAC semantics Tag #1375
Diffstat (limited to 'layout/base/nsCSSFrameConstructor.cpp')
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index a2dec55e1..e88b2d62c 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -10730,6 +10730,12 @@ nsCSSFrameConstructor::AddFCItemsForAnonymousContent(
// first element that is not itself NAC (distinct from whether it happens
// to be in a NAC subtree).
//
+ // The one exception to all of this is scrollbar content, which we parent
+ // directly to the scrollframe. This is because the special-snowflake
+ // construction of scroll frames doesn't result in the placeholder frame
+ // being constructed until later, which means that GetInFlowParent() doesn't
+ // work right in the case of out-of-flow scrollframes.
+ //
// To implement all this, we need to pass the correct parent style context
// here because SetPrimaryFrame() may not have been called on the content
// yet and thus ResolveStyleContext can't find it otherwise.
@@ -10739,9 +10745,12 @@ nsCSSFrameConstructor::AddFCItemsForAnonymousContent(
// to worry about anonymous boxes, which CorrectStyleParentFrame handles
// for us.
nsIFrame* inheritFrame = aFrame;
- while (inheritFrame->GetContent()->IsNativeAnonymous()) {
- inheritFrame = inheritFrame->GetParent();
+ if (!content->IsNativeScrollbarContent()) {
+ while (inheritFrame->GetContent()->IsNativeAnonymous()) {
+ inheritFrame = inheritFrame->GetInFlowParent();
+ }
}
+
if (inheritFrame->GetType() == nsGkAtoms::canvasFrame) {
// CorrectStyleParentFrame returns nullptr if the prospective parent is
// the canvas frame, so avoid calling it in that situation.