summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderNamedFlowFragment.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/RenderNamedFlowFragment.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/rendering/RenderNamedFlowFragment.h')
-rw-r--r--Source/WebCore/rendering/RenderNamedFlowFragment.h75
1 files changed, 46 insertions, 29 deletions
diff --git a/Source/WebCore/rendering/RenderNamedFlowFragment.h b/Source/WebCore/rendering/RenderNamedFlowFragment.h
index 98c549729..d44fe8a38 100644
--- a/Source/WebCore/rendering/RenderNamedFlowFragment.h
+++ b/Source/WebCore/rendering/RenderNamedFlowFragment.h
@@ -27,8 +27,7 @@
* SUCH DAMAGE.
*/
-#ifndef RenderNamedFlowFragment_h
-#define RenderNamedFlowFragment_h
+#pragma once
#include "RenderRegion.h"
@@ -49,16 +48,26 @@ class RenderStyle;
class RenderNamedFlowFragment final : public RenderRegion {
public:
- RenderNamedFlowFragment(Document&, PassRef<RenderStyle>);
+ RenderNamedFlowFragment(Document&, RenderStyle&&);
virtual ~RenderNamedFlowFragment();
- static PassRef<RenderStyle> createStyle(const RenderStyle& parentStyle);
+ static RenderStyle createStyle(const RenderStyle& parentStyle);
- virtual bool isRenderNamedFlowFragment() const override final { return true; }
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
+ void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
- virtual LayoutUnit pageLogicalHeight() const;
+ 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(); }
@@ -66,20 +75,19 @@ public:
// parent renderer instead.
// This method returns that renderer holding the layer.
// The return value cannot be null because CSS Regions create Stacking Contexts (which means they create layers).
- RenderLayerModelObject& layerOwner() const { return *toRenderLayerModelObject(parent()); }
+ RenderLayerModelObject& layerOwner() const { return downcast<RenderLayerModelObject>(*parent()); }
bool hasCustomRegionStyle() const { return m_hasCustomRegionStyle; }
- void setHasCustomRegionStyle(bool hasCustomRegionStyle) { m_hasCustomRegionStyle = hasCustomRegionStyle; }
- void clearObjectStyleInRegion(const RenderObject*);
+ void clearObjectStyleInRegion(const RenderElement&);
void setRegionObjectsRegionStyle();
void restoreRegionObjectsOriginalStyle();
- virtual LayoutRect visualOverflowRect() const override;
+ LayoutRect visualOverflowRect() const override;
RenderNamedFlowThread* namedFlowThread() const;
- virtual bool hasAutoLogicalHeight() const override { return m_hasAutoLogicalHeight; }
+ bool hasAutoLogicalHeight() const override { return m_hasAutoLogicalHeight; }
LayoutUnit computedAutoHeight() const { return m_computedAutoHeight; }
@@ -97,21 +105,29 @@ public:
bool hasComputedAutoHeight() const { return m_hasComputedAutoHeight; }
- virtual void attachRegion() override;
- virtual void detachRegion() override;
+ RegionOversetState regionOversetState() const;
- virtual void updateLogicalHeight() override;
+ void attachRegion() override;
+ void detachRegion() override;
-// FIXME: Temporarily public until we move all the CSSRegions functionality from RenderRegion to here.
-public:
- void checkRegionStyle();
+ void updateLogicalHeight() override;
+
+ void updateRegionFlags();
+
+ void absoluteQuadsForBoxInRegion(Vector<FloatQuad>&, bool*, const RenderBox*, float, float) override;
+
+ void invalidateRegionIfNeeded();
private:
- virtual const char* renderName() const override { return "RenderNamedFlowFragment"; }
+ 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);
- PassRefPtr<RenderStyle> computeStyleInRegion(const RenderObject*);
- void computeChildrenStyleInRegion(const RenderElement*);
- void setObjectStyleInRegion(RenderObject*, PassRefPtr<RenderStyle>, bool objectRegionStyleCached);
+ void checkRegionStyle();
+ void setHasCustomRegionStyle(bool hasCustomRegionStyle) { m_hasCustomRegionStyle = hasCustomRegionStyle; }
void updateRegionHasAutoLogicalHeightFlag();
@@ -120,7 +136,10 @@ private:
bool shouldHaveAutoLogicalHeight() const;
- virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
+ void updateOversetState();
+ void setRegionOversetState(RegionOversetState);
+
+ void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
struct ObjectRegionStyleInfo {
// Used to store the original style of the object in region
@@ -128,13 +147,13 @@ private:
// Also used to store computed style of the object in region between
// region paintings, so that the style in region is computed only
// when necessary.
- RefPtr<RenderStyle> style;
+ std::unique_ptr<RenderStyle> style;
// True if the computed style in region is cached.
bool cached;
};
- typedef HashMap<const RenderObject*, ObjectRegionStyleInfo > RenderObjectRegionStyleMap;
- RenderObjectRegionStyleMap m_renderObjectRegionStyle;
+ using RendererRegionStyleMap = HashMap<const RenderElement*, ObjectRegionStyleInfo>;
+ RendererRegionStyleMap m_rendererRegionStyle;
bool m_hasCustomRegionStyle : 1;
bool m_hasAutoLogicalHeight : 1;
@@ -143,8 +162,6 @@ private:
LayoutUnit m_computedAutoHeight;
};
-RENDER_OBJECT_TYPE_CASTS(RenderNamedFlowFragment, isRenderNamedFlowFragment())
-
} // namespace WebCore
-#endif // RenderNamedFlowFragment_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderNamedFlowFragment, isRenderNamedFlowFragment())