diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-03-18 13:16:26 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-20 15:55:39 +0100 |
commit | 3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch) | |
tree | 92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp | |
parent | e90d7c4b152c56919d963987e2503f9909a666d2 (diff) | |
download | qtwebengine-chromium-3f0f86b0caed75241fa71c95a5d73bc0164348c5.tar.gz |
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies
needed on Windows.
Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/rendering/RenderTable.cpp | 38 |
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; |