forked from mirrors/gecko-dev
It's unused on mozilla-central, and Thunderbird can just use the canvas frame as regular (X)HTML documents, so just use a canvas frame instead of an nsRootBoxFrame for XUL as well. nsRootBoxFrame was needed because of various XUL-specific things like tooltips and so on lived there. But with the move away from XUL, that functionality has been added to nsCanvasFrame already, behind a principal check instead. This also allows simplifying our background propagation setup, which was only half-working for XUL documents (this bug is a consequence of that). With this, most of the callers of nsCSSRendering::IsCanvasFrame can go. They're only two of the frames that would return true for that that actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the codepaths in display list building and painting can just check frame->IsCanvasFrame() instead. The remaining caller to that function is nsContainerFrame::SyncWindowProperties, and the change is also legit, in the sense that the only thing SyncWindowProperties() really cares about is propagating the max/min-width constraints from the root element's style to the view/widget, and the only frame that would return true from IsCanvasFrame and have a view is the viewport frame which is the root of the frame tree. Differential Revision: https://phabricator.services.mozilla.com/D90846
61 lines
2 KiB
C++
61 lines
2 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
#include "mozilla/PresShell.h"
|
|
#include "mozilla/dom/Document.h"
|
|
#include "mozilla/dom/Element.h"
|
|
#include "mozilla/dom/FromParser.h"
|
|
#include "mozilla/dom/NodeInfo.h"
|
|
#include "nsHTMLParts.h"
|
|
#include "nsContainerFrame.h"
|
|
#include "nsCSSRendering.h"
|
|
#include "nsPageFrame.h"
|
|
#include "nsStyleConsts.h"
|
|
#include "nsGkAtoms.h"
|
|
#include "nsBoxFrame.h"
|
|
#include "nsNodeInfoManager.h"
|
|
#include "nsContentCreatorFunctions.h"
|
|
|
|
using namespace mozilla;
|
|
using namespace mozilla::dom;
|
|
|
|
class nsDocElementBoxFrame final : public nsBoxFrame {
|
|
public:
|
|
friend nsIFrame* NS_NewBoxFrame(mozilla::PresShell* aPresShell,
|
|
ComputedStyle* aStyle);
|
|
|
|
explicit nsDocElementBoxFrame(ComputedStyle* aStyle,
|
|
nsPresContext* aPresContext)
|
|
: nsBoxFrame(aStyle, aPresContext, kClassID, true) {}
|
|
|
|
NS_DECL_FRAMEARENA_HELPERS(nsDocElementBoxFrame)
|
|
|
|
bool IsFrameOfType(uint32_t aFlags) const override {
|
|
// Override nsBoxFrame.
|
|
if (aFlags & (nsIFrame::eReplacedContainsBlock | nsIFrame::eReplaced))
|
|
return false;
|
|
return nsBoxFrame::IsFrameOfType(aFlags);
|
|
}
|
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
|
nsresult GetFrameName(nsAString& aResult) const override;
|
|
#endif
|
|
};
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
nsContainerFrame* NS_NewDocElementBoxFrame(PresShell* aPresShell,
|
|
ComputedStyle* aStyle) {
|
|
return new (aPresShell)
|
|
nsDocElementBoxFrame(aStyle, aPresShell->GetPresContext());
|
|
}
|
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsDocElementBoxFrame)
|
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
|
nsresult nsDocElementBoxFrame::GetFrameName(nsAString& aResult) const {
|
|
return MakeFrameName(u"DocElementBox"_ns, aResult);
|
|
}
|
|
#endif
|