Commit 4a0e7885 authored by mstensho's avatar mstensho Committed by Commit bot

Translate the clip rect correctly when iterating over fragmentainers.

The clip rect is visual, so we need to shift each fragmentainer group by its
visual translation. This matters for nested multicol.

BUG=642325

Review-Url: https://codereview.chromium.org/2321333002
Cr-Commit-Position: refs/heads/master@{#417563}
parent ac9d3f8a
<!DOCTYPE html>
<p>The word "PASS" should be seen below.</p>
<div style="line-height:20px;">
PASS
</div>
<!DOCTYPE html>
<p>The word "PASS" should be seen below.</p>
<div style="columns:3; column-fill:auto; column-gap:0; margin-left:-100px; width:300px; height:60px; line-height:20px; orphans:1; widows:1;">
<br>
<br>
<div style="columns:2;">
<br>
<br>
PASS<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
...@@ -99,10 +99,14 @@ bool FragmentainerIterator::setFragmentainersOfInterest() ...@@ -99,10 +99,14 @@ bool FragmentainerIterator::setFragmentainersOfInterest()
// might not have to walk the entire fragmentainer group. // might not have to walk the entire fragmentainer group.
group.columnIntervalForBlockRangeInFlowThread(m_logicalTopInFlowThread, m_logicalBottomInFlowThread, m_currentFragmentainerIndex, m_endFragmentainerIndex); group.columnIntervalForBlockRangeInFlowThread(m_logicalTopInFlowThread, m_logicalBottomInFlowThread, m_currentFragmentainerIndex, m_endFragmentainerIndex);
// Now intersect with the fragmentainers that actually intersect with the clip rect, to narrow // Now intersect with the fragmentainers that actually intersect with the visual clip rect, to
// it down even further. // narrow it down even further. The clip rect needs to be relative to the current fragmentainer
// group.
LayoutRect clipRect = m_clipRectInMulticolContainer;
LayoutSize offset = group.flowThreadTranslationAtOffset(group.logicalTopInFlowThread(), CoordinateSpaceConversion::Visual);
clipRect.move(-offset);
unsigned firstFragmentainerInClipRect, lastFragmentainerInClipRect; unsigned firstFragmentainerInClipRect, lastFragmentainerInClipRect;
group.columnIntervalForVisualRect(m_clipRectInMulticolContainer, firstFragmentainerInClipRect, lastFragmentainerInClipRect); group.columnIntervalForVisualRect(clipRect, firstFragmentainerInClipRect, lastFragmentainerInClipRect);
// If the two fragmentainer intervals are disjoint, there's nothing of interest in this // If the two fragmentainer intervals are disjoint, there's nothing of interest in this
// fragmentainer group. // fragmentainer group.
if (firstFragmentainerInClipRect > m_endFragmentainerIndex || lastFragmentainerInClipRect < m_currentFragmentainerIndex) if (firstFragmentainerInClipRect > m_endFragmentainerIndex || lastFragmentainerInClipRect < m_currentFragmentainerIndex)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment