summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp b/chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp
index 4cbcf05b99a..5ca0c17e93e 100644
--- a/chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp
+++ b/chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp
@@ -29,10 +29,12 @@
#include "HTMLNames.h"
#include "core/dom/Document.h"
#include "core/html/HTMLTableElement.h"
-#include "core/page/FrameView.h"
+#include "core/frame/FrameView.h"
#include "core/rendering/AutoTableLayout.h"
#include "core/rendering/FixedTableLayout.h"
+#include "core/rendering/GraphicsContextAnnotator.h"
#include "core/rendering/HitTestResult.h"
+#include "core/rendering/LayoutRectRecorder.h"
#include "core/rendering/LayoutRepainter.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderTableCaption.h"
@@ -41,8 +43,8 @@
#include "core/rendering/RenderTableSection.h"
#include "core/rendering/RenderView.h"
#include "core/rendering/SubtreeLayoutScope.h"
-#include "core/rendering/style/CollapsedBorderValue.h"
#include "core/rendering/style/StyleInheritedData.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
using namespace std;
@@ -88,6 +90,9 @@ void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
m_columnPos[0] = m_hSpacing;
if (!m_tableLayout || style()->tableLayout() != oldTableLayout) {
+ if (m_tableLayout)
+ m_tableLayout->willChangeTableLayout();
+
// According to the CSS2 spec, you only use fixed table layout if an
// explicit width is specified on the table. Auto width implies auto table layout.
if (style()->tableLayout() == TFIXED && !style()->logicalWidth().isAuto())
@@ -267,7 +272,7 @@ void RenderTable::updateLogicalWidth()
LayoutUnit availableContentLogicalWidth = max<LayoutUnit>(0, containerWidthInInlineDirection - marginTotal);
if (shrinkToAvoidFloats() && cb->containsFloats() && !hasPerpendicularContainingBlock) {
// FIXME: Work with regions someday.
- availableContentLogicalWidth = shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, cb, 0);
+ availableContentLogicalWidth = shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, toRenderBlockFlow(cb), 0);
}
// Ensure we aren't bigger than our available width.
@@ -365,17 +370,17 @@ void RenderTable::layoutCaption(RenderTableCaption* caption)
if (caption->needsLayout()) {
// The margins may not be available but ensure the caption is at least located beneath any previous sibling caption
// so that it does not mistakenly think any floats in the previous caption intrude into it.
- caption->setLogicalLocation(LayoutPoint(caption->marginStart(), caption->marginBefore() + logicalHeight()));
+ caption->setLogicalLocation(LayoutPoint(caption->marginStart(), collapsedMarginBeforeForChild(caption) + logicalHeight()));
// If RenderTableCaption ever gets a layout() function, use it here.
caption->layoutIfNeeded();
}
// Apply the margins to the location now that they are definitely available from layout
- caption->setLogicalLocation(LayoutPoint(caption->marginStart(), caption->marginBefore() + logicalHeight()));
+ caption->setLogicalLocation(LayoutPoint(caption->marginStart(), collapsedMarginBeforeForChild(caption) + logicalHeight()));
if (!selfNeedsLayout() && caption->checkForRepaintDuringLayout())
caption->repaintDuringLayoutIfMoved(captionRect);
- setLogicalHeight(logicalHeight() + caption->logicalHeight() + caption->marginBefore() + caption->marginAfter());
+ setLogicalHeight(logicalHeight() + caption->logicalHeight() + collapsedMarginBeforeForChild(caption) + collapsedMarginAfterForChild(caption));
}
void RenderTable::distributeExtraLogicalHeight(int extraLogicalHeight)
@@ -404,6 +409,8 @@ void RenderTable::layout()
{
ASSERT(needsLayout());
+ LayoutRectRecorder recorder(*this);
+
if (simplifiedLayout())
return;
@@ -453,6 +460,11 @@ void RenderTable::layout()
} else if (child->isRenderTableCol()) {
child->layoutIfNeeded();
ASSERT(!child->needsLayout());
+ } else {
+ // FIXME: We should never have other type of children (they should be wrapped in an
+ // anonymous table section) but our code is too crazy and this can happen in practice.
+ // Until this is fixed, let's make sure we don't leave non laid out children in the tree.
+ child->layoutIfNeeded();
}
}
@@ -718,15 +730,7 @@ void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& p
LayoutRect rect(paintOffset, size());
subtractCaptionRect(rect);
-
- BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(paintInfo.context);
- if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance))
- paintBoxShadow(paintInfo, rect, style(), Normal);
- paintBackground(paintInfo, rect, bleedAvoidance);
- paintBoxShadow(paintInfo, rect, style(), Inset);
-
- if (style()->hasBorder() && !collapseBorders())
- paintBorder(paintInfo, rect, style());
+ paintBoxDecorationsWithRect(paintInfo, paintOffset, rect);
}
void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -844,10 +848,6 @@ RenderTableCol* RenderTable::firstColumn() const
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (child->isRenderTableCol())
return toRenderTableCol(child);
-
- // We allow only table-captions before columns or column-groups.
- if (!child->isTableCaption())
- return 0;
}
return 0;