Changeset 285783 in webkit
- Timestamp:
- Nov 13, 2021, 3:21:41 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285782 r285783 1 2021-11-13 Alan Bujtas <zalan@apple.com> 2 3 [LFC][Integration] Add support for optional bidi character coverage checking 4 https://bugs.webkit.org/show_bug.cgi?id=233049 5 6 Reviewed by Antti Koivisto. 7 8 This is in preparation for enabling bidi for IFC. 9 10 * layout/formattingContexts/inline/InlineItemsBuilder.cpp: 11 * layout/integration/LayoutIntegrationCoverage.cpp: 12 (WebCore::LayoutIntegration::canUseForFontAndText): 13 (WebCore::LayoutIntegration::canUseForRenderInlineChild): 14 (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): 15 1 16 2021-11-13 Alan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
r284857 r285783 46 46 #if ENABLE(LAYOUT_FORMATTING_CONTEXT) 47 47 48 #define ALLOW_BIDI_CONTENT 0 49 #define ALLOW_BIDI_CONTENT_WITH_INLINE_BOX 0 50 48 51 #ifndef NDEBUG 49 52 #define SET_REASON_AND_RETURN_IF_NEEDED(reason, reasons, includeReasons) { \ … … 389 392 } 390 393 391 static OptionSet<AvoidanceReason> canUseForFontAndText(const RenderBoxModelObject& container, IncludeReasons includeReasons) 394 enum class CheckForBidiCharacters { Yes, No }; 395 static OptionSet<AvoidanceReason> canUseForFontAndText(const RenderBoxModelObject& container, CheckForBidiCharacters checkForBidiCharacters, IncludeReasons includeReasons) 392 396 { 393 397 OptionSet<AvoidanceReason> reasons; … … 419 423 } 420 424 421 auto textReasons = canUseForText(textRenderer.stringView(), includeReasons); 422 if (textReasons) 423 ADD_REASONS_AND_RETURN_IF_NEEDED(textReasons, reasons, includeReasons); 425 if (checkForBidiCharacters == CheckForBidiCharacters::Yes) { 426 if (auto textReasons = canUseForText(textRenderer.stringView(), includeReasons)) 427 ADD_REASONS_AND_RETURN_IF_NEEDED(textReasons, reasons, includeReasons); 428 } 424 429 } 425 430 return reasons; … … 485 490 if (renderInline.containingBlock()->style().lineBoxContain() != RenderStyle::initialLineBoxContain()) 486 491 SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineBoxContainProperty, reasons, includeReasons); 487 auto fontAndTextReasons = canUseForFontAndText(renderInline, includeReasons); 492 auto checkForBidiCharacters = CheckForBidiCharacters::Yes; 493 #if ALLOW_BIDI_CONTENT_WITH_INLINE_BOX 494 checkForBidiCharacters = CheckForBidiCharacters::No; 495 #endif 496 auto fontAndTextReasons = canUseForFontAndText(renderInline, checkForBidiCharacters, includeReasons); 488 497 if (fontAndTextReasons) 489 498 ADD_REASONS_AND_RETURN_IF_NEEDED(fontAndTextReasons, reasons, includeReasons); 499 490 500 auto styleReasons = canUseForStyle(style, includeReasons); 491 501 if (styleReasons) … … 633 643 // This currently covers <blockflow>#text</blockflow>, <blockflow>#text<br></blockflow> and mutiple (sibling) RenderText cases. 634 644 // The <blockflow><inline>#text</inline></blockflow> case is also popular and should be relatively easy to cover. 645 auto hasSeenInlineBox = false; 635 646 for (auto walker = InlineWalker(flow); !walker.atEnd(); walker.advance()) { 636 647 if (auto childReasons = canUseForChild(flow, *walker.current(), includeReasons)) 637 648 ADD_REASONS_AND_RETURN_IF_NEEDED(childReasons, reasons, includeReasons); 649 hasSeenInlineBox = hasSeenInlineBox || is<RenderInline>(*walker.current()); 638 650 } 639 651 auto styleReasons = canUseForStyle(flow.style(), includeReasons); … … 650 662 } 651 663 } 652 auto fontAndTextReasons = canUseForFontAndText(flow, includeReasons); 664 auto checkForBidiCharacters = CheckForBidiCharacters::Yes; 665 #if ALLOW_BIDI_CONTENT 666 if (!hasSeenInlineBox) 667 checkForBidiCharacters = CheckForBidiCharacters::No; 668 #endif 669 #if ALLOW_BIDI_CONTENT_WITH_INLINE_BOX 670 checkForBidiCharacters = CheckForBidiCharacters::No; 671 #endif 672 auto fontAndTextReasons = canUseForFontAndText(flow, checkForBidiCharacters, includeReasons); 653 673 if (fontAndTextReasons) 654 674 ADD_REASONS_AND_RETURN_IF_NEEDED(fontAndTextReasons, reasons, includeReasons);
Note:
See TracChangeset
for help on using the changeset viewer.