Skip to content

Commit

Permalink
[LFC][IFC] Inline boxes with collapsible content only should not be c…
Browse files Browse the repository at this point in the history
…onsidered opaque bidi items

https://bugs.webkit.org/show_bug.cgi?id=235447

Reviewed by Antti Koivisto.

Source/WebCore:

We don't normally submit inline boxes with content to ubidi re-ordering since their content drives the visual
position unless they are empty. While empty inline boxes do not usually produce visual artifacts (except ones with decoration)
they still need to be able to answer "bounding box" type of questions.

So in order to have geometry generated for inline boxes, they either
1, need to have some content so that while processing their content, we also compute their geometries
2, have to participate in ubidi's visual re-ordering so that they show up in the visual list (which is the input to the display box create function)

This patch treats inline boxes with fully collapsible content empty so that they fall into group #2.

* layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::breakAndComputeBidiLevels):

LayoutTests:

* TestExpectations:



Canonical link: https://commits.webkit.org/246272@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbaradlay committed Jan 21, 2022
1 parent ce1789d commit 4a272d5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
9 changes: 9 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2022-01-21 Alan Bujtas <zalan@apple.com>

[LFC][IFC] Inline boxes with collapsible content only should not be considered opaque bidi items
https://bugs.webkit.org/show_bug.cgi?id=235447

Reviewed by Antti Koivisto.

* TestExpectations:

2022-01-21 Robert Jenner <Jenner@apple.com>

[ iOS EWS ] imported/w3c/web-platform-tests/dom/events/focus-event-document-move.html is a constant text failure
Expand Down
1 change: 0 additions & 1 deletion LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -2745,7 +2745,6 @@ webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/white-space/tab
webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/white-space/tab-stop-threshold-006.html [ ImageOnlyFailure ]
webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/white-space/control-chars-000.html [ ImageOnlyFailure ]
webkit.org/b/195275 imported/w3c/web-platform-tests/css/css-text/white-space/text-space-collapse-preserve-breaks-001.xht [ ImageOnlyFailure ]
webkit.org/b/214290 [ Debug ] imported/w3c/web-platform-tests/css/css-text/white-space/eol-spaces-bidi-001.html [ Skip ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-018.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/white-space/seg-break-transformation-019.html [ ImageOnlyFailure ]
webkit.org/b/214290 imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-012.html [ ImageOnlyFailure ]
Expand Down
20 changes: 20 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
2022-01-21 Alan Bujtas <zalan@apple.com>

[LFC][IFC] Inline boxes with collapsible content only should not be considered opaque bidi items
https://bugs.webkit.org/show_bug.cgi?id=235447

Reviewed by Antti Koivisto.

We don't normally submit inline boxes with content to ubidi re-ordering since their content drives the visual
position unless they are empty. While empty inline boxes do not usually produce visual artifacts (except ones with decoration)
they still need to be able to answer "bounding box" type of questions.

So in order to have geometry generated for inline boxes, they either
1, need to have some content so that while processing their content, we also compute their geometries
2, have to participate in ubidi's visual re-ordering so that they show up in the visual list (which is the input to the display box create function)

This patch treats inline boxes with fully collapsible content empty so that they fall into group #2.

* layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::InlineItemsBuilder::breakAndComputeBidiLevels):

2022-01-21 Antti Koivisto <antti@apple.com>

WPT version of css/css-cascade/parsing/layer-import-parsing.html crashes with nullptr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ void InlineItemsBuilder::breakAndComputeBidiLevels(InlineItems& inlineItems)
continue;
}
// Mark the inline box stack with "content yes", when we come across a content type of inline item.
inlineBoxContentFlagStack.fill(InlineBoxHasContent::Yes);
if (!inlineItem.isText() || !downcast<InlineTextItem>(inlineItem).isWhitespace() || TextUtil::shouldPreserveSpacesAndTabs(inlineItem.layoutBox()))
inlineBoxContentFlagStack.fill(InlineBoxHasContent::Yes);
}
};
setBidiLevelForOpaqueInlineItems();
Expand Down

0 comments on commit 4a272d5

Please sign in to comment.