[webkit-changes] [WebKit/WebKit] cd554a: [IFC][Bidi] Soft (preserved) line break should ini...

Alan Baradlay noreply at github.com
Sun Dec 31 05:44:38 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cd554aafebecc06333809cd98c5b34ec7b4ef68e
      https://github.com/WebKit/WebKit/commit/cd554aafebecc06333809cd98c5b34ec7b4ef68e
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-12-31 (Sun, 31 Dec 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp

  Log Message:
  -----------
  [IFC][Bidi] Soft (preserved) line break should initiate bidi paragraph
https://bugs.webkit.org/show_bug.cgi?id=266944

Reviewed by Antti Koivisto.

This is similar to what we need to do when the inline content has forced line breaks (<br>)
e.g.
  <pre style="unicode-bidi: plaintext">some text
  and more text</pre>

1. Check if \n is preserved (<-initiates bidi paragraph)
2. Process before '\n' text content ('some text')
3. Unwind the current bidi stack (single entry of pre -plaintext)
4. Add 'newlineCharacter' character to the bidi content builder
5. Rewind the bidi stack for the after content ('and more text')

- Move bidi paragraph handling to dedicated helper functions (popping and pushing the bidi stack; see unwind/rewind functions)
- Share code between <br> and preserved \n

* LayoutTests/TestExpectations:
* Source/WebCore/layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::replaceNonPreservedNewLineAndTabCharactersAndAppend):
(WebCore::Layout::unwindBidiContextStack):
(WebCore::Layout::rewindBidiContextStack):
(WebCore::Layout::handleBidiParagraphStart):
(WebCore::Layout::buildBidiParagraph):

Canonical link: https://commits.webkit.org/272541@main




More information about the webkit-changes mailing list