summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderRegion.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderRegion.h')
-rw-r--r--Source/WebCore/rendering/RenderRegion.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/Source/WebCore/rendering/RenderRegion.h b/Source/WebCore/rendering/RenderRegion.h
index f82d1b045..0150ff72e 100644
--- a/Source/WebCore/rendering/RenderRegion.h
+++ b/Source/WebCore/rendering/RenderRegion.h
@@ -27,18 +27,16 @@
* SUCH DAMAGE.
*/
-#ifndef RenderRegion_h
-#define RenderRegion_h
+#pragma once
+#include "LayerFragment.h"
#include "RenderBlockFlow.h"
#include "StyleInheritedData.h"
#include "VisiblePosition.h"
+#include <memory>
namespace WebCore {
-struct LayerFragment;
-typedef Vector<LayerFragment, 1> LayerFragments;
-
class Element;
class RenderBox;
class RenderBoxRegionInfo;
@@ -47,17 +45,13 @@ class RenderNamedFlowThread;
class RenderRegion : public RenderBlockFlow {
public:
- virtual bool isRenderRegion() const override final { return true; }
-
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+ void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
void setFlowThreadPortionRect(const LayoutRect& rect) { m_flowThreadPortionRect = rect; }
LayoutRect flowThreadPortionRect() const { return m_flowThreadPortionRect; }
LayoutRect flowThreadPortionOverflowRect();
LayoutPoint flowThreadPortionLocation() const;
-
- RenderLayer* regionContainerLayer() const;
virtual void attachRegion();
virtual void detachRegion();
@@ -72,16 +66,14 @@ public:
RenderBoxRegionInfo* renderBoxRegionInfo(const RenderBox*) const;
RenderBoxRegionInfo* setRenderBoxRegionInfo(const RenderBox*, LayoutUnit logicalLeftInset, LayoutUnit logicalRightInset,
bool containingBlockChainIsInset);
- OwnPtr<RenderBoxRegionInfo> takeRenderBoxRegionInfo(const RenderBox*);
- void removeRenderBoxRegionInfo(const RenderBox*);
+ std::unique_ptr<RenderBoxRegionInfo> takeRenderBoxRegionInfo(const RenderBox*);
+ void removeRenderBoxRegionInfo(const RenderBox&);
void deleteAllRenderBoxRegionInfo();
bool isFirstRegion() const;
bool isLastRegion() const;
-
- RegionOversetState regionOversetState() const;
- void setRegionOversetState(RegionOversetState);
+ virtual bool shouldClipFlowThreadContent() const;
// These methods represent the width and height of a "page" and for a RenderRegion they are just the
// content width and content height of a region. For RenderRegionSets, however, they will be the width and
@@ -94,8 +86,6 @@ public:
LayoutUnit logicalTopForFlowThreadContent() const { return logicalTopOfFlowThreadContentRect(flowThreadPortionRect()); };
LayoutUnit logicalBottomForFlowThreadContent() const { return logicalBottomOfFlowThreadContentRect(flowThreadPortionRect()); };
- void getRanges(Vector<RefPtr<Range>>&) const;
-
// This method represents the logical height of the entire flow thread portion used by the region or set.
// For RenderRegions it matches logicalPaginationHeight(), but for sets it is the height of all the pages
// or columns added together.
@@ -105,44 +95,44 @@ public:
// flow thread portion we contain. For sets, we have to figure out the top of the nearest column or
// page.
virtual LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const;
-
- virtual void expandToEncompassFlowThreadContentsIfNeeded() { };
// Whether or not this region is a set.
virtual bool isRenderRegionSet() const { return false; }
- virtual void repaintFlowThreadContent(const LayoutRect& repaintRect, bool immediate);
+ virtual void repaintFlowThreadContent(const LayoutRect& repaintRect);
virtual void collectLayerFragments(LayerFragments&, const LayoutRect&, const LayoutRect&) { }
- virtual void adjustRegionBoundsFromFlowThreadPortionRect(const IntPoint& layerOffset, IntRect& regionBounds); // layerOffset is needed for multi-column.
+ virtual void adjustRegionBoundsFromFlowThreadPortionRect(LayoutRect& regionBounds) const;
void addLayoutOverflowForBox(const RenderBox*, const LayoutRect&);
void addVisualOverflowForBox(const RenderBox*, const LayoutRect&);
LayoutRect layoutOverflowRectForBox(const RenderBox*);
- LayoutRect visualOverflowRectForBox(const RenderBoxModelObject*);
+ LayoutRect visualOverflowRectForBox(const RenderBoxModelObject&);
LayoutRect layoutOverflowRectForBoxForPropagation(const RenderBox*);
- LayoutRect visualOverflowRectForBoxForPropagation(const RenderBoxModelObject*);
+ LayoutRect visualOverflowRectForBoxForPropagation(const RenderBoxModelObject&);
LayoutRect rectFlowPortionForBox(const RenderBox*, const LayoutRect&) const;
void setRegionObjectsRegionStyle();
void restoreRegionObjectsOriginalStyle();
- virtual bool canHaveChildren() const override { return false; }
- virtual bool canHaveGeneratedChildren() const override { return true; }
- virtual VisiblePosition positionForPoint(const LayoutPoint&) override;
+ bool canHaveChildren() const override { return false; }
+ bool canHaveGeneratedChildren() const override { return true; }
+ VisiblePosition positionForPoint(const LayoutPoint&, const RenderRegion*) override;
virtual bool hasAutoLogicalHeight() const { return false; }
+ virtual void absoluteQuadsForBoxInRegion(Vector<FloatQuad>&, bool*, const RenderBox*, float, float) { }
+
protected:
- RenderRegion(Element&, PassRef<RenderStyle>, RenderFlowThread*);
- RenderRegion(Document&, PassRef<RenderStyle>, RenderFlowThread*);
+ RenderRegion(Element&, RenderStyle&&, RenderFlowThread*);
+ RenderRegion(Document&, RenderStyle&&, RenderFlowThread*);
void ensureOverflowForBox(const RenderBox*, RefPtr<RenderOverflow>&, bool);
- virtual void computePreferredLogicalWidths() override;
- virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
+ void computePreferredLogicalWidths() override;
+ void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
enum OverflowType {
LayoutOverflow = 0,
@@ -150,15 +140,16 @@ protected:
};
LayoutRect overflowRectForFlowThreadPortion(const LayoutRect& flowThreadPortionRect, bool isFirstPortion, bool isLastPortion, OverflowType);
- void repaintFlowThreadContentRectangle(const LayoutRect& repaintRect, bool immediate, const LayoutRect& flowThreadPortionRect, const LayoutPoint& regionLocation, const LayoutRect* flowThreadPortionClipRect = 0);
+ void repaintFlowThreadContentRectangle(const LayoutRect& repaintRect, const LayoutRect& flowThreadPortionRect, const LayoutPoint& regionLocation, const LayoutRect* flowThreadPortionClipRect = 0);
void computeOverflowFromFlowThread();
private:
- virtual const char* renderName() const { return "RenderRegion"; }
+ bool isRenderRegion() const final { return true; }
+ const char* renderName() const override { return "RenderRegion"; }
- virtual void insertedIntoTree() override;
- virtual void willBeRemovedFromTree() override;
+ void insertedIntoTree() override;
+ void willBeRemovedFromTree() override;
virtual void installFlowThread();
@@ -178,14 +169,23 @@ private:
// A RenderBoxRegionInfo* tells us about any layout information for a RenderBox that
// is unique to the region. For now it just holds logical width information for RenderBlocks, but eventually
// it will also hold a custom style for any box (for region styling).
- typedef HashMap<const RenderBox*, OwnPtr<RenderBoxRegionInfo>> RenderBoxRegionInfoMap;
+ typedef HashMap<const RenderBox*, std::unique_ptr<RenderBoxRegionInfo>> RenderBoxRegionInfoMap;
RenderBoxRegionInfoMap m_renderBoxRegionInfo;
bool m_isValid : 1;
};
-RENDER_OBJECT_TYPE_CASTS(RenderRegion, isRenderRegion())
+class CurrentRenderRegionMaintainer {
+ WTF_MAKE_NONCOPYABLE(CurrentRenderRegionMaintainer);
+public:
+ CurrentRenderRegionMaintainer(RenderRegion&);
+ ~CurrentRenderRegionMaintainer();
+
+ RenderRegion& region() const { return m_region; }
+private:
+ RenderRegion& m_region;
+};
} // namespace WebCore
-#endif // RenderRegion_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderRegion, isRenderRegion())