RenderNamedFlowFragment.h [plain text]
#pragma once
#include "RenderRegion.h"
namespace WebCore {
class Element;
class RenderStyle;
class RenderNamedFlowFragment final : public RenderRegion {
public:
RenderNamedFlowFragment(Document&, RenderStyle&&);
virtual ~RenderNamedFlowFragment();
static RenderStyle createStyle(const RenderStyle& parentStyle);
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
void getRanges(Vector<RefPtr<Range>>&) const;
LayoutUnit pageLogicalHeight() const override;
LayoutUnit maxPageLogicalHeight() const;
LayoutRect flowThreadPortionRectForClipping(bool isFirstRegionInRange, bool isLastRegionInRange) const;
RenderBlockFlow& fragmentContainer() const;
RenderLayer& fragmentContainerLayer() const;
bool shouldClipFlowThreadContent() const override;
LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const override;
bool isPseudoElementRegion() const { return parent() && parent()->isPseudoElement(); }
RenderLayerModelObject& layerOwner() const { return downcast<RenderLayerModelObject>(*parent()); }
bool hasCustomRegionStyle() const { return m_hasCustomRegionStyle; }
void clearObjectStyleInRegion(const RenderElement&);
void setRegionObjectsRegionStyle();
void restoreRegionObjectsOriginalStyle();
LayoutRect visualOverflowRect() const override;
RenderNamedFlowThread* namedFlowThread() const;
bool hasAutoLogicalHeight() const override { return m_hasAutoLogicalHeight; }
LayoutUnit computedAutoHeight() const { return m_computedAutoHeight; }
void setComputedAutoHeight(LayoutUnit computedAutoHeight)
{
m_hasComputedAutoHeight = true;
m_computedAutoHeight = computedAutoHeight;
}
void clearComputedAutoHeight()
{
m_hasComputedAutoHeight = false;
m_computedAutoHeight = 0;
}
bool hasComputedAutoHeight() const { return m_hasComputedAutoHeight; }
RegionOversetState regionOversetState() const;
void attachRegion() override;
void detachRegion() override;
void updateLogicalHeight() override;
void updateRegionFlags();
void absoluteQuadsForBoxInRegion(Vector<FloatQuad>&, bool*, const RenderBox*, float, float) override;
void invalidateRegionIfNeeded();
private:
bool isRenderNamedFlowFragment() const override { return true; }
const char* renderName() const override { return "RenderNamedFlowFragment"; }
std::unique_ptr<RenderStyle> computeStyleInRegion(RenderElement&, const RenderStyle& parentStyle) const;
void computeChildrenStyleInRegion(RenderElement&);
void setRendererStyleInRegion(RenderElement&, std::unique_ptr<RenderStyle>, bool objectRegionStyleCached);
void checkRegionStyle();
void setHasCustomRegionStyle(bool hasCustomRegionStyle) { m_hasCustomRegionStyle = hasCustomRegionStyle; }
void updateRegionHasAutoLogicalHeightFlag();
void incrementAutoLogicalHeightCount();
void decrementAutoLogicalHeightCount();
bool shouldHaveAutoLogicalHeight() const;
void updateOversetState();
void setRegionOversetState(RegionOversetState);
void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
struct ObjectRegionStyleInfo {
std::unique_ptr<RenderStyle> style;
bool cached;
};
using RendererRegionStyleMap = HashMap<const RenderElement*, ObjectRegionStyleInfo>;
RendererRegionStyleMap m_rendererRegionStyle;
bool m_hasCustomRegionStyle : 1;
bool m_hasAutoLogicalHeight : 1;
bool m_hasComputedAutoHeight : 1;
LayoutUnit m_computedAutoHeight;
};
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderNamedFlowFragment, isRenderNamedFlowFragment())