Changeset 285780 in webkit
- Timestamp:
- Nov 13, 2021, 1:59:47 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
layout/formattingContexts/inline/InlineItemsBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285771 r285780 1 2021-11-13 Alan Bujtas <zalan@apple.com> 2 3 [LFC][IFC] Inline box end (opaque to bidi) should get the bidi level from its adjacent content 4 https://bugs.webkit.org/show_bug.cgi?id=233082 5 6 Reviewed by Antti Koivisto. 7 8 While the inline box start item (<span>) gets the bidi level from the next (adjacent) content, inline box end (</span>) 9 should get it from the previous content (these are opaque inline items). 10 11 e.g <span>bidi content</span> 12 both the inline box start and the inline box end items get their bidi level from the "bidi content" inline text item. 13 14 * layout/formattingContexts/inline/InlineItemsBuilder.cpp: 15 (WebCore::Layout::InlineItemsBuilder::breakAndComputeBidiLevels): 16 1 17 2021-11-12 Timothy Hatcher <timothy@apple.com> 2 18 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp
r285626 r285780 325 325 auto lastBidiLevel = rootBidiLevel; 326 326 for (auto index = inlineItems.size(); index--;) { 327 if (!inlineItemOffsets[index]) 327 if (inlineItemOffsets[index]) { 328 lastBidiLevel = inlineItems[index].bidiLevel(); 329 continue; 330 } 331 if (inlineItems[index].isInlineBoxStart()) { 332 // Inline box start (e.g <span>) uses its content bidi level (next inline item). 328 333 inlineItems[index].setBidiLevel(lastBidiLevel); 329 else 330 lastBidiLevel = inlineItems[index].bidiLevel(); 334 continue; 335 } 336 if (inlineItems[index].isInlineBoxEnd()) { 337 // Inline box end (e.g. </span>) also uses the content bidi level, but in this case it's the previous content. 338 auto previousBidiLevel = [&]() -> std::optional<UBiDiLevel> { 339 for (auto i = index; i--;) { 340 if (inlineItemOffsets[i]) 341 return inlineItems[i].bidiLevel(); 342 } 343 return { }; 344 }(); 345 inlineItems[index].setBidiLevel(previousBidiLevel.value_or(rootBidiLevel)); 346 continue; 347 } 348 ASSERT_NOT_REACHED(); 331 349 } 332 350 };
Note:
See TracChangeset
for help on using the changeset viewer.