Skip to content
Permalink
Browse files
[LFC][Integration] Enable <wbr> content
https://bugs.webkit.org/show_bug.cgi?id=217065

Reviewed by Antti Koivisto.

Source/WebCore:

Enable <wbr> content now that IFC fully supports it.

Test: fast/text/wbr-simple.html

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):

LayoutTests:

* fast/text/wbr-simple-expected.html: Added.
* fast/text/wbr-simple.html: Added.


Canonical link: https://commits.webkit.org/229921@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Sep 30, 2020
1 parent b78ec3e commit c0ad2e5b7fc50e7e71c8a6fed32c37a21d878bd4
Showing 6 changed files with 52 additions and 11 deletions.
@@ -1,3 +1,13 @@
2020-09-30 Zalan Bujtas <zalan@apple.com>

[LFC][Integration] Enable <wbr> content
https://bugs.webkit.org/show_bug.cgi?id=217065

Reviewed by Antti Koivisto.

* fast/text/wbr-simple-expected.html: Added.
* fast/text/wbr-simple.html: Added.

2020-09-30 Ryan Haddad <ryanhaddad@apple.com>

Unreviewed, reverting r267788.
@@ -0,0 +1,7 @@
<style>
div {
font-family: Ahem;
font-size: 20px;
}
</style>
<div>this<br>is<br>a<br>simple<br>test<br>for<br>word<br>break<br>opportunity</div>
@@ -0,0 +1,8 @@
<style>
div {
width: 0px;
font-family: Ahem;
font-size: 20px;
}
</style>
<div>this<wbr>is<wbr>a<wbr>simple<wbr>test<wbr>for<wbr>word<wbr>break<wbr>opportunity</div>
@@ -1,3 +1,17 @@
2020-09-30 Zalan Bujtas <zalan@apple.com>

[LFC][Integration] Enable <wbr> content
https://bugs.webkit.org/show_bug.cgi?id=217065

Reviewed by Antti Koivisto.

Enable <wbr> content now that IFC fully supports it.

Test: fast/text/wbr-simple.html

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):

2020-09-30 Youenn Fablet <youenn@apple.com>

Handle deprecation warnings from libwebrtc headers
@@ -366,16 +366,18 @@ LineBuilder::CommittedContent LineBuilder::placeInlineContent(const InlineItemRa
auto inlineContentIsFullyCommitted = inlineContent.continuousContent().runs().size() == result.committedCount.value && !result.partialContent;
auto isEndOfLine = result.isEndOfLine == InlineContentBreaker::IsEndOfLine::Yes;

if (auto* wordBreakOpportunity = inlineContent.trailingWordBreakOpportunity()) {
// <wbr> needs to be on the line as an empty run so that we can construct an inline box and compute basic geometry.
++committedInlineItemCount;
m_line.append(*wordBreakOpportunity, { });
}
if (inlineContentIsFullyCommitted && inlineContent.trailingLineBreak()) {
// Fully committed (or empty) content followed by a line break means "end of line".
m_line.append(*inlineContent.trailingLineBreak(), { });
++committedInlineItemCount;
isEndOfLine = true;
if (inlineContentIsFullyCommitted) {
if (auto* wordBreakOpportunity = inlineContent.trailingWordBreakOpportunity()) {
// <wbr> needs to be on the line as an empty run so that we can construct an inline box and compute basic geometry.
++committedInlineItemCount;
m_line.append(*wordBreakOpportunity, { });
}
if (inlineContent.trailingLineBreak()) {
// Fully committed (or empty) content followed by a line break means "end of line".
m_line.append(*inlineContent.trailingLineBreak(), { });
++committedInlineItemCount;
isEndOfLine = true;
}
}
if (isEndOfLine) {
// We can't place any more items on the current line.
@@ -307,7 +307,7 @@ OptionSet<AvoidanceReason> canUseForLineLayoutWithReason(const RenderBlockFlow&
child = child->nextSibling();
continue;
}
if (is<RenderLineBreak>(child) && !downcast<RenderLineBreak>(*child).isWBR() && child->style().clear() == Clear::None) {
if (is<RenderLineBreak>(child) && child->style().clear() == Clear::None) {
child = child->nextSibling();
continue;
}

0 comments on commit c0ad2e5

Please sign in to comment.