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

Unified Diff: Source/core/rendering/RootInlineBox.cpp

Issue 331303004: Fix selection rect calculation for inline elements with padding (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 6 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
« no previous file with comments | « Source/core/rendering/RootInlineBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RootInlineBox.cpp
diff --git a/Source/core/rendering/RootInlineBox.cpp b/Source/core/rendering/RootInlineBox.cpp
index 5b0a8fde96c9de57f6bdd3874e087c44abdcd503..e698bd267175e22ecbcd73f7a3f038e09da18b01 100644
--- a/Source/core/rendering/RootInlineBox.cpp
+++ b/Source/core/rendering/RootInlineBox.cpp
@@ -38,7 +38,7 @@ using namespace std;
namespace WebCore {
struct SameSizeAsRootInlineBox : public InlineFlowBox {
- unsigned variables[5];
+ unsigned variables[6];
void* pointers[4];
};
@@ -55,6 +55,7 @@ RootInlineBox::RootInlineBox(RenderBlockFlow& block)
, m_lineBottom(0)
, m_lineTopWithLeading(0)
, m_lineBottomWithLeading(0)
+ , m_selectionBottom(0)
{
setIsHorizontal(block.isHorizontalWritingMode());
}
@@ -194,6 +195,7 @@ void RootInlineBox::adjustPosition(float dx, float dy)
m_lineBottom += blockDirectionDelta;
m_lineTopWithLeading += blockDirectionDelta;
m_lineBottomWithLeading += blockDirectionDelta;
+ m_selectionBottom += blockDirectionDelta;
if (hasEllipsisBox())
ellipsisBox()->adjustPosition(dx, dy);
}
@@ -238,17 +240,18 @@ LayoutUnit RootInlineBox::alignBoxesInBlockDirection(LayoutUnit heightOfBlock, G
LayoutUnit lineBottom = heightOfBlock;
LayoutUnit lineTopIncludingMargins = heightOfBlock;
LayoutUnit lineBottomIncludingMargins = heightOfBlock;
+ LayoutUnit selectionBottom = heightOfBlock;
bool setLineTop = false;
bool hasAnnotationsBefore = false;
bool hasAnnotationsAfter = false;
- placeBoxesInBlockDirection(heightOfBlock, maxHeight, maxAscent, noQuirksMode, lineTop, lineBottom, setLineTop,
+ placeBoxesInBlockDirection(heightOfBlock, maxHeight, maxAscent, noQuirksMode, lineTop, lineBottom, selectionBottom, setLineTop,
lineTopIncludingMargins, lineBottomIncludingMargins, hasAnnotationsBefore, hasAnnotationsAfter, baselineType());
m_hasAnnotationsBefore = hasAnnotationsBefore;
m_hasAnnotationsAfter = hasAnnotationsAfter;
maxHeight = max<LayoutUnit>(0, maxHeight); // FIXME: Is this really necessary?
- setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock + maxHeight);
+ setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock + maxHeight, selectionBottom);
if (block().view()->layoutState()->isPaginated())
setPaginatedLineWidth(block().availableLogicalWidthForContent());
@@ -450,7 +453,7 @@ LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const
LayoutUnit RootInlineBox::selectionBottom() const
{
- LayoutUnit selectionBottom = m_lineBottom;
+ LayoutUnit selectionBottom = m_selectionBottom;
if (m_hasAnnotationsAfter)
selectionBottom += !renderer().style()->isFlippedLinesWritingMode() ? computeUnderAnnotationAdjustment(m_lineBottom) : computeOverAnnotationAdjustment(m_lineBottom);
« no previous file with comments | « Source/core/rendering/RootInlineBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698