[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:59:44 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 808448741ca9a99e0d8b30c1efa4ff1de7e8444d
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 13 22:07:12 2002 +0000
Rewrite cellpadding to not use the style system at all and
to make table cells just get the padding from the table
itself (overriding style).
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::HTMLTableElementImpl):
(HTMLTableElementImpl::attach):
(HTMLTableElementImpl::parseAttribute):
(HTMLTableCellElementImpl::init):
* khtml/html/html_tableimpl.h:
* khtml/rendering/bidi.cpp:
(RenderFlow::layoutInlineChildren):
* khtml/rendering/render_box.cpp:
(RenderBox::contentWidth):
(RenderBox::contentHeight):
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
(RenderFlow::leftOffset):
(RenderFlow::rightOffset):
(RenderFlow::calcMinMaxWidth):
* khtml/rendering/render_object.h:
* khtml/rendering/render_table.cpp:
(RenderTable::RenderTable):
(RenderTableCell::paddingTop):
(RenderTableCell::paddingBottom):
(RenderTableCell::paddingLeft):
(RenderTableCell::paddingRight):
* khtml/rendering/render_table.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 118f206..d468bac 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,34 @@
+2002-11-13 David Hyatt <hyatt at apple.com>
+
+ Rewrite cellpadding to not use the style system at all and
+ to make table cells just get the padding from the table
+ itself (overriding style).
+
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::HTMLTableElementImpl):
+ (HTMLTableElementImpl::attach):
+ (HTMLTableElementImpl::parseAttribute):
+ (HTMLTableCellElementImpl::init):
+ * khtml/html/html_tableimpl.h:
+ * khtml/rendering/bidi.cpp:
+ (RenderFlow::layoutInlineChildren):
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::contentWidth):
+ (RenderBox::contentHeight):
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layoutBlockChildren):
+ (RenderFlow::leftOffset):
+ (RenderFlow::rightOffset):
+ (RenderFlow::calcMinMaxWidth):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::RenderTable):
+ (RenderTableCell::paddingTop):
+ (RenderTableCell::paddingBottom):
+ (RenderTableCell::paddingLeft):
+ (RenderTableCell::paddingRight):
+ * khtml/rendering/render_table.h:
+
2002-11-13 Ken Kocienda <kocienda at apple.com>
Bump WebCore cache to 4 MB (was 1 MB).
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 118f206..d468bac 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,34 @@
+2002-11-13 David Hyatt <hyatt at apple.com>
+
+ Rewrite cellpadding to not use the style system at all and
+ to make table cells just get the padding from the table
+ itself (overriding style).
+
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::HTMLTableElementImpl):
+ (HTMLTableElementImpl::attach):
+ (HTMLTableElementImpl::parseAttribute):
+ (HTMLTableCellElementImpl::init):
+ * khtml/html/html_tableimpl.h:
+ * khtml/rendering/bidi.cpp:
+ (RenderFlow::layoutInlineChildren):
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::contentWidth):
+ (RenderBox::contentHeight):
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layoutBlockChildren):
+ (RenderFlow::leftOffset):
+ (RenderFlow::rightOffset):
+ (RenderFlow::calcMinMaxWidth):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::RenderTable):
+ (RenderTableCell::paddingTop):
+ (RenderTableCell::paddingBottom):
+ (RenderTableCell::paddingLeft):
+ (RenderTableCell::paddingRight):
+ * khtml/rendering/render_table.h:
+
2002-11-13 Ken Kocienda <kocienda at apple.com>
Bump WebCore cache to 4 MB (was 1 MB).
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 118f206..d468bac 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,34 @@
+2002-11-13 David Hyatt <hyatt at apple.com>
+
+ Rewrite cellpadding to not use the style system at all and
+ to make table cells just get the padding from the table
+ itself (overriding style).
+
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::HTMLTableElementImpl):
+ (HTMLTableElementImpl::attach):
+ (HTMLTableElementImpl::parseAttribute):
+ (HTMLTableCellElementImpl::init):
+ * khtml/html/html_tableimpl.h:
+ * khtml/rendering/bidi.cpp:
+ (RenderFlow::layoutInlineChildren):
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::contentWidth):
+ (RenderBox::contentHeight):
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layoutBlockChildren):
+ (RenderFlow::leftOffset):
+ (RenderFlow::rightOffset):
+ (RenderFlow::calcMinMaxWidth):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::RenderTable):
+ (RenderTableCell::paddingTop):
+ (RenderTableCell::paddingBottom):
+ (RenderTableCell::paddingLeft):
+ (RenderTableCell::paddingRight):
+ * khtml/rendering/render_table.h:
+
2002-11-13 Ken Kocienda <kocienda at apple.com>
Bump WebCore cache to 4 MB (was 1 MB).
diff --git a/WebCore/khtml/html/html_tableimpl.cpp b/WebCore/khtml/html/html_tableimpl.cpp
index d3b27b6..87792a4 100644
--- a/WebCore/khtml/html/html_tableimpl.cpp
+++ b/WebCore/khtml/html/html_tableimpl.cpp
@@ -56,6 +56,8 @@ HTMLTableElementImpl::HTMLTableElementImpl(DocumentPtr *doc)
rules = None;
frame = Void;
+ m_cellPadding = -1;
+
incremental = false;
m_noBorder = true;
m_solid = false;
@@ -84,7 +86,12 @@ void HTMLTableElementImpl::attach()
}
}
- return HTMLElementImpl::attach();
+ HTMLElementImpl::attach();
+
+ if (m_render && m_render->isTable()) {
+ RenderTable* table = static_cast<RenderTable*>(m_render);
+ table->setCellPadding(m_cellPadding);
+ }
}
NodeImpl* HTMLTableElementImpl::setCaption( HTMLTableCaptionElementImpl *c )
@@ -415,9 +422,13 @@ void HTMLTableElementImpl::parseAttribute(AttributeImpl *attr)
break;
case ATTR_CELLPADDING:
if (!attr->value().isEmpty())
- cellPadding = attr->value();
- else // XXXdwh Need to update all cells to remove the padding property.
- cellPadding = "";
+ m_cellPadding = attr->value().toInt();
+ else
+ m_cellPadding = -1;
+ if (m_render && m_render->isTable()) {
+ RenderTable* table = static_cast<RenderTable*>(m_render);
+ table->setCellPadding(m_cellPadding);
+ }
break;
case ATTR_COLS:
{
@@ -744,13 +755,6 @@ void HTMLTableCellElementImpl::init()
if (!m_solid)
addCSSProperty(CSS_PROP_BORDER_COLOR, "inherit");
}
-
- if (!table->cellPadding.isEmpty()) {
- addCSSLength(CSS_PROP_PADDING_TOP, table->cellPadding);
- addCSSLength(CSS_PROP_PADDING_LEFT, table->cellPadding);
- addCSSLength(CSS_PROP_PADDING_BOTTOM, table->cellPadding);
- addCSSLength(CSS_PROP_PADDING_RIGHT, table->cellPadding);
- }
}
}
diff --git a/WebCore/khtml/html/html_tableimpl.h b/WebCore/khtml/html/html_tableimpl.h
index 6f622d4..17a3039 100644
--- a/WebCore/khtml/html/html_tableimpl.h
+++ b/WebCore/khtml/html/html_tableimpl.h
@@ -101,6 +101,8 @@ public:
virtual void init();
+ int cellPadding() { return m_cellPadding; }
+
protected:
HTMLTableSectionElementImpl *head;
HTMLTableSectionElementImpl *foot;
@@ -110,7 +112,7 @@ protected:
Frame frame;
Rules rules;
- DOMString cellPadding;
+ int m_cellPadding;
bool incremental : 1;
bool m_noBorder : 1;
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 4fa5b47..f5b257f 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -995,7 +995,7 @@ void RenderFlow::layoutInlineChildren()
int toAdd = style()->borderBottomWidth();
m_height = style()->borderTopWidth();
- if(style()->hasPadding())
+ if(hasPadding())
{
m_height += paddingTop();
toAdd += paddingBottom();
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 06bc2da..638fe1f 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -106,7 +106,7 @@ void RenderBox::detach(RenderArena* renderArena)
short RenderBox::contentWidth() const
{
short w = m_width - style()->borderLeftWidth() - style()->borderRightWidth();
- if(style()->hasPadding())
+ if (hasPadding())
w -= paddingLeft() + paddingRight();
//kdDebug( 6040 ) << "RenderBox::contentWidth(2) = " << w << endl;
@@ -116,7 +116,7 @@ short RenderBox::contentWidth() const
int RenderBox::contentHeight() const
{
int h = m_height - style()->borderTopWidth() - style()->borderBottomWidth();
- if(style()->hasPadding())
+ if (hasPadding())
h -= paddingTop() + paddingBottom();
return h;
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 4e26865..16cdb1e 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -361,7 +361,7 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
m_height += borderTop();
toAdd += borderBottom();
}
- if(style()->hasPadding())
+ if (hasPadding())
{
xPos += paddingLeft();
m_height += paddingTop();
@@ -881,9 +881,9 @@ RenderFlow::leftOffset() const
{
int left = 0;
- if(style()->hasBorder())
+ if (style()->hasBorder())
left += borderLeft();
- if(style()->hasPadding())
+ if (hasPadding())
left += paddingLeft();
if ( firstLine && style()->direction() == LTR ) {
@@ -925,9 +925,9 @@ RenderFlow::rightOffset() const
{
int right = m_width;
- if(style()->hasBorder())
+ if (style()->hasBorder())
right -= borderRight();
- if(style()->hasPadding())
+ if (hasPadding())
right -= paddingRight();
if ( firstLine && style()->direction() == RTL ) {
@@ -1563,7 +1563,7 @@ void RenderFlow::calcMinMaxWidth()
int toAdd = 0;
if(style()->hasBorder())
toAdd = borderLeft() + borderRight();
- if(style()->hasPadding())
+ if (hasPadding())
toAdd += paddingLeft() + paddingRight();
m_minWidth += toAdd;
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index fd61bee..75d297d 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -407,11 +407,13 @@ public:
virtual short marginLeft() const { return 0; }
virtual short marginRight() const { return 0; }
- int paddingTop() const;
- int paddingBottom() const;
- int paddingLeft() const;
- int paddingRight() const;
-
+ // Virtual since table cells override
+ virtual int paddingTop() const;
+ virtual int paddingBottom() const;
+ virtual int paddingLeft() const;
+ virtual int paddingRight() const;
+ virtual bool hasPadding() const { return style()->hasPadding(); }
+
int borderTop() const { return style()->borderTopWidth(); }
int borderBottom() const { return style()->borderBottomWidth(); }
int borderLeft() const { return style()->borderLeftWidth(); }
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 63c9815..7ab2733 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -78,6 +78,8 @@ RenderTable::RenderTable(DOM::NodeImpl* node)
rules = None;
frame = Void;
+ m_cellPadding = -1;
+
row = 0;
col = 0;
@@ -2138,6 +2140,33 @@ void RenderTableCell::close()
#endif
}
+int RenderTableCell::paddingTop() const
+{
+ if (m_table && m_table->cellPadding() != -1)
+ return m_table->cellPadding();
+ return RenderFlow::paddingTop();
+}
+
+int RenderTableCell::paddingBottom() const
+{
+ if (m_table && m_table->cellPadding() != -1)
+ return m_table->cellPadding();
+ return RenderFlow::paddingBottom();
+}
+
+int RenderTableCell::paddingLeft() const
+{
+ if (m_table && m_table->cellPadding() != -1)
+ return m_table->cellPadding();
+ return RenderFlow::paddingLeft();
+}
+
+int RenderTableCell::paddingRight() const
+{
+ if (m_table && m_table->cellPadding() != -1)
+ return m_table->cellPadding();
+ return RenderFlow::paddingRight();
+}
void RenderTableCell::repaintRectangle(int x, int y, int w, int h, bool f)
{
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index 8011378..109dc83 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -114,6 +114,9 @@ public:
virtual void setCellWidths( );
+ int cellPadding() { return m_cellPadding; }
+ void setCellPadding(int cellPadding) { m_cellPadding = cellPadding; }
+
int getBaseline(int row) {return rowInfo[row].baseline;}
virtual void position(int x, int y, int from, int len, int width, bool reverse, bool firstLine, int);
@@ -253,6 +256,8 @@ protected:
Frame frame;
Rules rules;
+ int m_cellPadding;
+
RenderTableCol *_oldColElem;
int _currentCol; // keeps track of current col for col/colgroup stuff
int spacing;
@@ -375,7 +380,17 @@ public:
virtual void setWidth( int width );
virtual void setStyle( RenderStyle *style );
virtual void repaint();
-
+
+ virtual int paddingTop() const;
+ virtual int paddingBottom() const;
+ virtual int paddingLeft() const;
+ virtual int paddingRight() const;
+ virtual bool hasPadding() const {
+ if (m_table && m_table->cellPadding() != -1)
+ return true;
+ return style()->hasPadding();
+ }
+
virtual void updateFromElement();
void setRowHeight(int h) { rowHeight = h; }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list