Changeset 171882 in webkit
- Timestamp:
- Jul 31, 2014 12:50:45 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r171865 r171882 1 2014-07-31 Andrei Bucur <abucur@adobe.com> 2 3 REGRESSION: Search highlight is broken in RTL multicolumn content 4 https://bugs.webkit.org/show_bug.cgi?id=135452 5 6 Reviewed by Simon Fraser. 7 8 A test that verifies the bounding boxes for content inside a RTL multi-column element are correctly computed: 9 - for static elements 10 - for relative positioned elements 11 - for absolutely positioned elements 12 13 * fast/multicol/content-bounding-box-rtl-expected.txt: Added. 14 * fast/multicol/content-bounding-box-rtl.html: Added. 15 1 16 2014-07-31 Bear Travis <betravis@adobe.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r171871 r171882 1 2014-07-31 Andrei Bucur <abucur@adobe.com> 2 3 REGRESSION: Search highlight is broken in RTL multicolumn content 4 https://bugs.webkit.org/show_bug.cgi?id=135452 5 6 Reviewed by Simon Fraser. 7 8 The offsets for elements inside RTL multi-column elements are incorrectly computed because 9 the columns don't calculate their left position according to the writing direction. 10 11 The patch extracts the column position computation in two helper functions (for top and left) 12 so they can be used when needed in different parts of the code. In our case, the |columnLogicalLeft| 13 function should be used inside |columnTranslationForOffset|. 14 15 Test: fast/multicol/content-bounding-box-rtl.html 16 17 * rendering/RenderMultiColumnSet.cpp: 18 (WebCore::RenderMultiColumnSet::columnLogicalLeft): Return the logical left of a column relative to the set. 19 (WebCore::RenderMultiColumnSet::columnLogicalTop): Return the logical top of a column relative to the set. 20 (WebCore::RenderMultiColumnSet::columnRectAt): Split the code between columnLogicalLeft and columnLogicalTop. 21 (WebCore::RenderMultiColumnSet::collectLayerFragments): Make code clearer by adding a new line. 22 (WebCore::RenderMultiColumnSet::columnTranslationForOffset): Use columnLogicalLeft instead of duplicating logic. 23 * rendering/RenderMultiColumnSet.h: 24 1 25 2014-07-31 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> 2 26 -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r170774 r171882 445 445 } 446 446 447 Layout Rect RenderMultiColumnSet::columnRectAt(unsigned index) const447 LayoutUnit RenderMultiColumnSet::columnLogicalLeft(unsigned index) const 448 448 { 449 449 LayoutUnit colLogicalWidth = computedColumnWidth(); 450 LayoutUnit colLogicalHeight = computedColumnHeight();451 LayoutUnit colLogicalTop = borderAndPaddingBefore();452 450 LayoutUnit colLogicalLeft = borderAndPaddingLogicalLeft(); 453 451 LayoutUnit colGap = columnGap(); 454 452 455 453 bool progressionReversed = multiColumnFlowThread()->progressionIsReversed(); 456 454 bool progressionInline = multiColumnFlowThread()->progressionIsInline(); 457 455 458 456 if (progressionInline) { 459 457 if (style().isLeftToRightDirection() ^ progressionReversed) … … 461 459 else 462 460 colLogicalLeft += contentLogicalWidth() - colLogicalWidth - index * (colLogicalWidth + colGap); 463 } else { 461 } 462 463 return colLogicalLeft; 464 } 465 466 LayoutUnit RenderMultiColumnSet::columnLogicalTop(unsigned index) const 467 { 468 LayoutUnit colLogicalHeight = computedColumnHeight(); 469 LayoutUnit colLogicalTop = borderAndPaddingBefore(); 470 LayoutUnit colGap = columnGap(); 471 472 bool progressionReversed = multiColumnFlowThread()->progressionIsReversed(); 473 bool progressionInline = multiColumnFlowThread()->progressionIsInline(); 474 475 if (!progressionInline) { 464 476 if (!progressionReversed) 465 477 colLogicalTop += index * (colLogicalHeight + colGap); … … 467 479 colLogicalTop += contentLogicalHeight() - colLogicalHeight - index * (colLogicalHeight + colGap); 468 480 } 469 481 482 return colLogicalTop; 483 } 484 485 LayoutRect RenderMultiColumnSet::columnRectAt(unsigned index) const 486 { 487 LayoutUnit colLogicalWidth = computedColumnWidth(); 488 LayoutUnit colLogicalHeight = computedColumnHeight(); 489 470 490 if (isHorizontalWritingMode()) 471 return LayoutRect(col LogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight);472 return LayoutRect(col LogicalTop, colLogicalLeft, colLogicalHeight, colLogicalWidth);491 return LayoutRect(columnLogicalLeft(index), columnLogicalTop(index), colLogicalWidth, colLogicalHeight); 492 return LayoutRect(columnLogicalTop(index), columnLogicalLeft(index), colLogicalHeight, colLogicalWidth); 473 493 } 474 494 … … 767 787 } 768 788 translationOffset.setWidth(inlineOffset); 789 769 790 LayoutUnit blockOffset = initialBlockOffset + logicalTop() - flowThread()->logicalTop() + (isHorizontalWritingMode() ? -flowThreadPortion.y() : -flowThreadPortion.x()); 770 791 if (!progressionIsInline) { … … 808 829 809 830 LayoutUnit colGap = columnGap(); 810 LayoutUnit colLogicalWidth = computedColumnWidth();811 831 812 832 LayoutRect flowThreadPortion = flowThreadPortionRectAt(startColumn); … … 818 838 LayoutUnit initialBlockOffset = initialBlockOffsetForPainting(); 819 839 820 LayoutUnit inlineOffset = progressionIsInline ? startColumn * (colLogicalWidth + colGap) : LayoutUnit(); 821 822 bool leftToRight = style().isLeftToRightDirection() ^ progressionReversed; 823 if (!leftToRight) { 824 inlineOffset = -inlineOffset; 825 if (progressionReversed) 826 inlineOffset += contentLogicalWidth() - colLogicalWidth; 827 } 828 translationOffset.setX(inlineOffset); 840 translationOffset.setX(columnLogicalLeft(startColumn)); 841 829 842 LayoutUnit blockOffset = initialBlockOffset - (isHorizontalWritingMode() ? flowThreadPortion.y() : flowThreadPortion.x()); 830 843 if (!progressionIsInline) { -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r168113 r171882 161 161 LayoutUnit columnGap() const; 162 162 163 LayoutUnit columnLogicalLeft(unsigned) const; 164 LayoutUnit columnLogicalTop(unsigned) const; 165 163 166 LayoutRect flowThreadPortionRectAt(unsigned index) const; 164 167 LayoutRect flowThreadPortionOverflowRect(const LayoutRect& flowThreadPortion, unsigned index, unsigned colCount, LayoutUnit colGap);
Note: See TracChangeset
for help on using the changeset viewer.