Changeset 77267 in webkit
- Timestamp:
- Feb 1, 2011 12:02:06 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r77263 r77267 1 2011-02-01 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by David Hyatt. 4 5 Fix a text rendering problem when enclosing block is RTL and text runs 6 are in different directionality. 7 https://bugs.webkit.org/show_bug.cgi?id=34176 8 9 The problem happens in the following example scenario (ABC represents 10 Hebrew characters): 11 <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div> 12 13 The line consists of 3 text runs -- TextRun1 TextRun2 TextRun3. In which 14 TextRun1 and TextRun2's bidi level are 2, and TextRun3's bidi level is 1. 15 TextRun2 and TextRun3's least common ancestor is not a sibling of TextRun1. 16 17 The visual bidi run order of the text runs is TextRun3 TextRun1 TextRun2. 18 19 Inside RenderBlock::constructLine(), when RenderBlock::createLineBoxes() 20 creates InlineFlowBox for TextRun2, it should check an InlineFlowBox for 21 the run's render object's ancestor (not only its parent) has already 22 been constructed or has something following it on the line, in which 23 case, create a new box for TextRun2 instead of sharing the same box with 24 TextRun3. 25 26 In other words, the following 2 div should render the same results 27 (ABC represents Hebrew characters). 28 <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div> 29 <div dir=rtl>this is a <span>Test <span>ABC</span></span></div> 30 31 * fast/dom/34176.html: Added. 32 * platform/mac/fast/dom/34176-expected.checksum: Added. 33 * platform/mac/fast/dom/34176-expected.png: Added. 34 * platform/mac/fast/dom/34176-expected.txt: Added. 35 1 36 2011-02-01 Mihai Parparita <mihaip@chromium.org> 2 37 -
trunk/Source/WebCore/ChangeLog
r77262 r77267 1 2011-02-01 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by David Hyatt. 4 5 Fix a text rendering problem when enclosing block is RTL and text runs 6 are in different directionality. 7 https://bugs.webkit.org/show_bug.cgi?id=34176 8 9 The problem happens in the following example scenario (ABC represents 10 Hebrew characters): 11 <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div> 12 13 The line consists of 3 text runs -- TextRun1 TextRun2 TextRun3. In which 14 TextRun1 and TextRun2's bidi level are 2, and TextRun3's bidi level is 1. 15 TextRun2 and TextRun3's least common ancestor is not a sibling of TextRun1. 16 17 The visual bidi run order of the text runs is TextRun3 TextRun1 TextRun2. 18 19 Inside RenderBlock::constructLine(), when RenderBlock::createLineBoxes() 20 creates InlineFlowBox for TextRun2, it should check an InlineFlowBox for 21 the run's render object's ancestor (not only its parent) has already 22 been constructed or has something following it on the line, in which 23 case, create a new box for TextRun2 instead of sharing the same box with 24 TextRun3. 25 26 In other words, the following 2 div should render the same results 27 (ABC represents Hebrew characters). 28 <div dir=rtl>this is a <span><span>test <span>ABC</span></span></span></div> 29 <div dir=rtl>this is a <span>Test <span>ABC</span></span></div> 30 31 Test: fast/dom/34176.html 32 33 * rendering/RenderBlockLineLayout.cpp: 34 (WebCore::parentIsConstructedOrHaveNext): 35 (WebCore::RenderBlock::createLineBoxes): 36 1 37 2011-02-01 Abhishek Arya <inferno@chromium.org> 2 38 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r77153 r77267 185 185 } 186 186 187 static bool parentIsConstructedOrHaveNext(InlineFlowBox* parentBox) 188 { 189 do { 190 if (parentBox->isConstructed() || parentBox->nextOnLine()) 191 return true; 192 parentBox = parentBox->parent(); 193 } while (parentBox); 194 return false; 195 } 196 187 197 InlineFlowBox* RenderBlock::createLineBoxes(RenderObject* obj, bool firstLine) 188 198 { … … 199 209 parentBox = obj->isRenderInline() ? toRenderInline(obj)->lastLineBox() : toRenderBlock(obj)->lastLineBox(); 200 210 201 // If this box is constructed then it is from a previous line, and we need202 // to make a new box for our line. If this box is unconstructed but it has211 // If this box or its ancestor is constructed then it is from a previous line, and we need 212 // to make a new box for our line. If this box or its ancestor is unconstructed but it has 203 213 // something following it on the line, then we know we have to make a new box 204 214 // as well. In this situation our inline has actually been split in two on 205 215 // the same line (this can happen with very fancy language mixtures). 206 216 bool constructedNewBox = false; 207 if (!parentBox || parent Box->isConstructed() || parentBox->nextOnLine()) {217 if (!parentBox || parentIsConstructedOrHaveNext(parentBox)) { 208 218 // We need to make a new box for this render object. Once 209 219 // made, we need to place it at the end of the current line.
Note: See TracChangeset
for help on using the changeset viewer.