Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1197)

Unified Diff: Source/core/rendering/RenderBlock.h

Issue 22972002: Finish making FloatingObject a real class with private members (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.h
diff --git a/Source/core/rendering/RenderBlock.h b/Source/core/rendering/RenderBlock.h
index 06300e892bb4b4e7c19f4ab1b45816a955a21822..4f348febc97a9b801a102beba0becb984448f100 100644
--- a/Source/core/rendering/RenderBlock.h
+++ b/Source/core/rendering/RenderBlock.h
@@ -654,7 +654,7 @@ private:
bool everHadLayout;
};
- struct FloatingObject {
+ class FloatingObject {
WTF_MAKE_NONCOPYABLE(FloatingObject); WTF_MAKE_FAST_ALLOCATED;
public:
// Note that Type uses bits so you can use FloatLeftRight as a mask to query for both left and right.
@@ -726,6 +726,9 @@ private:
const LayoutRect& frameRect() const { ASSERT(isPlaced()); return m_frameRect; }
void setFrameRect(const LayoutRect& frameRect) { ASSERT(!isInPlacedTree()); m_frameRect = frameRect; }
+ int paginationStrut() const { return m_paginationStrut; }
+ void setPaginationStrut(int strut) { m_paginationStrut = strut; }
+
#ifndef NDEBUG
bool isInPlacedTree() const { return m_isInPlacedTree; }
void setIsInPlacedTree(bool value) { m_isInPlacedTree = value; }
@@ -736,12 +739,17 @@ private:
bool isDescendant() const { return m_isDescendant; }
void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; }
+ // FIXME: Callers of these methods are dangerous and should be whitelisted explicitly or removed.
+ void setRenderer(RenderBox* renderer) { m_renderer = renderer; }
+ RootInlineBox* originatingLine() const { return m_originatingLine; }
+ void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; }
+
+ private:
RenderBox* m_renderer;
RootInlineBox* m_originatingLine;
LayoutRect m_frameRect;
- int m_paginationStrut;
+ int m_paginationStrut; // FIXME: Is this class size-sensitive? Does this need 32-bits?
- private:
unsigned m_type : 2; // Type (left or right aligned)
unsigned m_shouldPaint : 1;
unsigned m_isDescendant : 1;
@@ -1149,13 +1157,13 @@ public:
protected:
struct FloatingObjectHashFunctions {
- static unsigned hash(FloatingObject* key) { return DefaultHash<RenderBox*>::Hash::hash(key->m_renderer); }
- static bool equal(FloatingObject* a, FloatingObject* b) { return a->m_renderer == b->m_renderer; }
+ static unsigned hash(FloatingObject* key) { return DefaultHash<RenderBox*>::Hash::hash(key->renderer()); }
+ static bool equal(FloatingObject* a, FloatingObject* b) { return a->renderer() == b->renderer(); }
static const bool safeToCompareToEmptyOrDeleted = true;
};
struct FloatingObjectHashTranslator {
static unsigned hash(RenderBox* key) { return DefaultHash<RenderBox*>::Hash::hash(key); }
- static bool equal(FloatingObject* a, RenderBox* b) { return a->m_renderer == b; }
+ static bool equal(FloatingObject* a, RenderBox* b) { return a->renderer() == b; }
};
typedef ListHashSet<FloatingObject*, 4, FloatingObjectHashFunctions> FloatingObjectSet;
typedef FloatingObjectSet::const_iterator FloatingObjectSetIterator;
« no previous file with comments | « no previous file | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698