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

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

Issue 294783004: Use tighter typing in table rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo / bug and update copyrights Created 6 years, 7 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
Index: Source/core/rendering/RenderTableRow.h
diff --git a/Source/core/rendering/RenderTableRow.h b/Source/core/rendering/RenderTableRow.h
index 24bd496b513835ee6ea4a73134ea0777e22e121e..8dc3550ed974297db59e00ac5303634b55c0db40 100644
--- a/Source/core/rendering/RenderTableRow.h
+++ b/Source/core/rendering/RenderTableRow.h
@@ -4,7 +4,7 @@
* (C) 1998 Waldo Bastian (bastian@kde.org)
* (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -36,8 +36,11 @@ class RenderTableRow FINAL : public RenderBox {
public:
explicit RenderTableRow(Element*);
- RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
- RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); return children()->lastChild(); }
+ RenderTableCell* firstCell() const;
+ RenderTableCell* lastCell() const;
+
+ RenderTableRow* previousRow() const;
+ RenderTableRow* nextRow() const;
const RenderObjectChildList* children() const { return &m_children; }
RenderObjectChildList* children() { return &m_children; }
@@ -88,6 +91,8 @@ public:
const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const;
const BorderValue& borderAdjoiningEndCell(const RenderTableCell*) const;
+ virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
+
private:
virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children(); }
virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { return children(); }
@@ -100,7 +105,6 @@ private:
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OVERRIDE;
virtual void layout() OVERRIDE;
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
virtual LayerType layerTypeRequired() const OVERRIDE
{
@@ -119,12 +123,37 @@ private:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
+ void nextSibling() const WTF_DELETED_FUNCTION;
+ void previousSibling() const WTF_DELETED_FUNCTION;
+
RenderObjectChildList m_children;
unsigned m_rowIndex : 31;
};
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTableRow, isTableRow());
+inline RenderTableRow* RenderTableRow::previousRow() const
+{
+ return toRenderTableRow(RenderObject::previousSibling());
+}
+
+inline RenderTableRow* RenderTableRow::nextRow() const
+{
+ return toRenderTableRow(RenderObject::nextSibling());
+}
+
+inline RenderTableRow* RenderTableSection::firstRow() const
+{
+ ASSERT(children() == virtualChildren());
+ return toRenderTableRow(children()->firstChild());
+}
+
+inline RenderTableRow* RenderTableSection::lastRow() const
+{
+ ASSERT(children() == virtualChildren());
+ return toRenderTableRow(children()->lastChild());
+}
+
} // namespace WebCore
#endif // RenderTableRow_h

Powered by Google App Engine
This is Rietveld 408576698