WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
[fast-cq]Patch
bug-248200-20221123144437.patch (text/plain), 8.59 KB, created by
alan
on 2022-11-23 14:44:38 PST
(
hide
)
Description:
[fast-cq]Patch
Filename:
MIME Type:
Creator:
alan
Created:
2022-11-23 14:44:38 PST
Size:
8.59 KB
patch
obsolete
>From 4572cf79d658864e11cc5009f59c4d4082055331 Mon Sep 17 00:00:00 2001 >From: Alan Baradlay <zalan@apple.com> >Date: Wed, 23 Nov 2022 14:42:22 -0800 >Subject: [PATCH] [IFC][Line clamp] Enable line-clamp for simple flex item > https://bugs.webkit.org/show_bug.cgi?id=248200 > >Reviewed by Antti Koivisto. > >Let's enable (deprecated)flex boxes with one simple, non-nested flex items. > >* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-line-clamp-001.tentative-expected.txt: >* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-line-clamp-001.tentative-expected.txt: >* LayoutTests/platform/ios/fast/overflow/line-clamp-expected.txt: >* LayoutTests/platform/mac/fast/overflow/line-clamp-expected.txt: >* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp: >(WebCore::LayoutIntegration::canUseForStyle): >--- > .../integration/LayoutIntegrationCoverage.cpp | 23 +++++++++++++++++-- > ...line-line-clamp-001.tentative-expected.txt | 8 ++----- > ...line-line-clamp-001.tentative-expected.txt | 8 ++----- > .../ios/fast/overflow/line-clamp-expected.txt | 11 ++++----- > .../mac/fast/overflow/line-clamp-expected.txt | 9 +++----- > 5 files changed, 32 insertions(+), 27 deletions(-) > >diff --git a/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp b/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp >index 8e9db5111ace..c47b421a5969 100644 >--- a/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp >+++ b/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp >@@ -327,8 +327,27 @@ static OptionSet<AvoidanceReason> canUseForStyle(const RenderElement& renderer, > } > return nullptr; > }; >- if (auto* ancestor = deprecatedFlexBoxAncestor(); ancestor && !ancestor->style().lineClamp().isNone()) >- SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineClamp, reasons, includeReasons); >+ if (auto* ancestor = deprecatedFlexBoxAncestor(); ancestor && !ancestor->style().lineClamp().isNone()) { >+ auto isSupportedLineClamp = [&] { >+ if (ancestor->style().lineClamp().isPercentage()) >+ return false; >+ auto* firstFlexItem = ancestor->firstChild(); >+ // Only support one flex item with no nested content. >+ if (!is<RenderBlockFlow>(firstFlexItem) || ancestor->firstChild() != ancestor->lastChild()) >+ return false; >+ auto* firstInFlowChild = downcast<RenderBlockFlow>(*firstFlexItem).firstChild(); >+ if (!firstInFlowChild || !firstInFlowChild->isInline()) >+ return false; >+ // No anchor box support either (let's just disable content with links). >+ for (auto* inFlowChild = downcast<RenderBlockFlow>(*firstFlexItem).lastChild(); inFlowChild; inFlowChild = inFlowChild->previousInFlowSibling()) { >+ if (inFlowChild->style().isLink()) >+ return false; >+ } >+ return true; >+ }; >+ if (!isSupportedLineClamp()) >+ SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineClamp, reasons, includeReasons); >+ } > return reasons; > } > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-line-clamp-001.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-line-clamp-001.tentative-expected.txt >index ef3c4c7e3b5f..ea359fca3a2d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-line-clamp-001.tentative-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-line-clamp-001.tentative-expected.txt >@@ -35,9 +35,7 @@ > > PASS .target > * 1 > PASS .target > * 2 >-FAIL .target > * 3 assert_equals: >-<div data-offset-y="110"><span></span></div> >-offsetTop expected 110 but got 190 >+PASS .target > * 3 > PASS .target > * 4 > PASS .target > * 5 > PASS .target > * 6 >@@ -49,9 +47,7 @@ PASS .target > * 11 > PASS .target > * 12 > PASS .target > * 13 > PASS .target > * 14 >-FAIL .target > * 15 assert_equals: >-<div data-offset-y="110"><span></span></div> >-offsetTop expected 110 but got 190 >+PASS .target > * 15 > PASS .target > * 16 > PASS .target > * 17 > PASS .target > * 18 >diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-line-clamp-001.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-line-clamp-001.tentative-expected.txt >index ef3c4c7e3b5f..ea359fca3a2d 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-line-clamp-001.tentative-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-line-clamp-001.tentative-expected.txt >@@ -35,9 +35,7 @@ > > PASS .target > * 1 > PASS .target > * 2 >-FAIL .target > * 3 assert_equals: >-<div data-offset-y="110"><span></span></div> >-offsetTop expected 110 but got 190 >+PASS .target > * 3 > PASS .target > * 4 > PASS .target > * 5 > PASS .target > * 6 >@@ -49,9 +47,7 @@ PASS .target > * 11 > PASS .target > * 12 > PASS .target > * 13 > PASS .target > * 14 >-FAIL .target > * 15 assert_equals: >-<div data-offset-y="110"><span></span></div> >-offsetTop expected 110 but got 190 >+PASS .target > * 15 > PASS .target > * 16 > PASS .target > * 17 > PASS .target > * 18 >diff --git a/LayoutTests/platform/ios/fast/overflow/line-clamp-expected.txt b/LayoutTests/platform/ios/fast/overflow/line-clamp-expected.txt >index 51c097b78086..82fd16d58c0d 100644 >--- a/LayoutTests/platform/ios/fast/overflow/line-clamp-expected.txt >+++ b/LayoutTests/platform/ios/fast/overflow/line-clamp-expected.txt >@@ -102,18 +102,15 @@ layer at (432,103) size 102x41 clip at (433,104) size 100x39 scrollHeight 159 > text run at (0,100) width 51: "ellipsis-" > text run at (0,120) width 83: "truncation of" > text run at (0,140) width 96: "multi-line text." >-layer at (538,83) size 102x61 clip at (539,84) size 100x59 scrollHeight 119 >- RenderDeprecatedFlexibleBox {DIV} at (530,75) size 102x61 [border: (1px solid #808080)] >- RenderBlock (anonymous) at (1,1) size 100x59 >- RenderText {#text} at (0,0) size 99x119 >+layer at (538,88) size 102x62 clip at (539,89) size 100x60 >+ RenderDeprecatedFlexibleBox {DIV} at (530,80) size 102x62 [border: (1px solid #808080)] >+ RenderBlock (anonymous) at (1,1) size 100x60 >+ RenderText {#text} at (0,0) size 99x59 > text run at (0,0) width 51: "3 lines. " > text run at (50,0) width 49: "No link" > text run at (0,20) width 71: "at the end. " > text run at (70,20) width 29: "This" > text run at (0,40) width 88: "is an example" >- text run at (0,60) width 68: "of ellipsis-" >- text run at (0,80) width 83: "truncation of" >- text run at (0,100) width 96: "multi-line text." > layer at (644,48) size 102x102 clip at (645,49) size 100x100 > RenderDeprecatedFlexibleBox {DIV} at (636,40) size 102x102 [border: (1px solid #808080)] > RenderBlock (anonymous) at (1,1) size 100x100 >diff --git a/LayoutTests/platform/mac/fast/overflow/line-clamp-expected.txt b/LayoutTests/platform/mac/fast/overflow/line-clamp-expected.txt >index 243c5407d76d..75a74d7547cf 100644 >--- a/LayoutTests/platform/mac/fast/overflow/line-clamp-expected.txt >+++ b/LayoutTests/platform/mac/fast/overflow/line-clamp-expected.txt >@@ -102,18 +102,15 @@ layer at (432,93) size 102x38 clip at (433,94) size 100x36 scrollHeight 144 > text run at (0,90) width 51: "ellipsis-" > text run at (0,108) width 83: "truncation of" > text run at (0,126) width 96: "multi-line text." >-layer at (538,75) size 102x56 clip at (539,76) size 100x54 scrollHeight 108 >- RenderDeprecatedFlexibleBox {DIV} at (530,67) size 102x56 [border: (1px solid #808080)] >+layer at (538,80) size 102x56 clip at (539,81) size 100x54 >+ RenderDeprecatedFlexibleBox {DIV} at (530,72) size 102x56 [border: (1px solid #808080)] > RenderBlock (anonymous) at (1,1) size 100x54 >- RenderText {#text} at (0,0) size 99x108 >+ RenderText {#text} at (0,0) size 99x54 > text run at (0,0) width 51: "3 lines. " > text run at (50,0) width 49: "No link" > text run at (0,18) width 71: "at the end. " > text run at (70,18) width 29: "This" > text run at (0,36) width 88: "is an example" >- text run at (0,54) width 68: "of ellipsis-" >- text run at (0,72) width 83: "truncation of" >- text run at (0,90) width 96: "multi-line text." > layer at (644,44) size 102x92 clip at (645,45) size 100x90 > RenderDeprecatedFlexibleBox {DIV} at (636,36) size 102x92 [border: (1px solid #808080)] > RenderBlock (anonymous) at (1,1) size 100x90
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 248200
:
463649
| 463698