diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-03-12 14:11:15 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-03-12 14:11:15 +0100 |
commit | dd91e772430dc294e3bf478c119ef8d43c0a3358 (patch) | |
tree | 6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Source/WebCore/rendering/RenderReplaced.cpp | |
parent | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff) | |
download | qtwebkit-dd91e772430dc294e3bf478c119ef8d43c0a3358.tar.gz |
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Source/WebCore/rendering/RenderReplaced.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderReplaced.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp index 6bdb1831c..39bacfa7f 100644 --- a/Source/WebCore/rendering/RenderReplaced.cpp +++ b/Source/WebCore/rendering/RenderReplaced.cpp @@ -137,11 +137,6 @@ void RenderReplaced::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) drawSelectionTint = false; } - if (Frame* frame = this->frame()) { - if (Page* page = frame->page()) - page->addRelevantRepaintedObject(this, paintInfo.rect); - } - bool completelyClippedOut = false; if (style()->hasBorderRadius()) { LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size()); @@ -196,10 +191,12 @@ bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO bottom = max(selBottom, bottom); } - LayoutUnit os = 2 * maximalOutlineSize(paintInfo.phase); - if (adjustedPaintOffset.x() + minXVisualOverflow() >= paintInfo.rect.maxX() + os || adjustedPaintOffset.x() + maxXVisualOverflow() <= paintInfo.rect.x() - os) + LayoutRect localRepaintRect = paintInfo.rect; + localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase)); + if (adjustedPaintOffset.x() + minXVisualOverflow() >= localRepaintRect.maxX() || adjustedPaintOffset.x() + maxXVisualOverflow() <= localRepaintRect.x()) return false; - if (top >= paintInfo.rect.maxY() + os || bottom <= paintInfo.rect.y() - os) + + if (top >= localRepaintRect.maxY() || bottom <= localRepaintRect.y()) return false; return true; @@ -440,9 +437,7 @@ void RenderReplaced::computePreferredLogicalWidths() if (style()->maxWidth().isFixed()) m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : zeroLayoutUnit)); - if (style()->width().isPercent() || style()->height().isPercent() - || style()->maxWidth().isPercent() || style()->maxHeight().isPercent() - || style()->minWidth().isPercent() || style()->minHeight().isPercent()) + if (hasRelativeDimensions()) m_minPreferredLogicalWidth = 0; else m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth; @@ -500,7 +495,7 @@ IntRect RenderReplaced::localSelectionRect(bool checkWhetherSelected) const if (!m_inlineBoxWrapper) // We're a block-level replaced element. Just return our own dimensions. - return IntRect(0, 0, width(), height()); + return IntRect(IntPoint(), size()); RootInlineBox* root = m_inlineBoxWrapper->root(); int newLogicalTop = root->block()->style()->isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - root->selectionBottom() : root->selectionTop() - m_inlineBoxWrapper->logicalTop(); @@ -509,14 +504,14 @@ IntRect RenderReplaced::localSelectionRect(bool checkWhetherSelected) const return IntRect(newLogicalTop, 0, root->selectionHeight(), height()); } -void RenderReplaced::setSelectionState(SelectionState s) +void RenderReplaced::setSelectionState(SelectionState state) { - RenderBox::setSelectionState(s); // The selection state for our containing block hierarchy is updated by the base class call. - if (m_inlineBoxWrapper) { - RootInlineBox* line = m_inlineBoxWrapper->root(); - if (line) - line->setHasSelectedChildren(isSelected()); - } + // The selection state for our containing block hierarchy is updated by the base class call. + RenderBox::setSelectionState(state); + + if (m_inlineBoxWrapper && canUpdateSelectionOnRootLineBoxes()) + if (RootInlineBox* root = m_inlineBoxWrapper->root()) + root->setHasSelectedChildren(isSelected()); } bool RenderReplaced::isSelected() const |