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-266599-20231218152448.patch (text/plain), 6.23 KB, created by
alan
on 2023-12-18 15:24:48 PST
(
hide
)
Description:
[fast-cq]Patch
Filename:
MIME Type:
Creator:
alan
Created:
2023-12-18 15:24:48 PST
Size:
6.23 KB
patch
obsolete
>From 7d978af2702e45b9111791753104b68ce6174484 Mon Sep 17 00:00:00 2001 >From: Alan Baradlay <zalan@apple.com> >Date: Mon, 18 Dec 2023 13:43:03 -0800 >Subject: [PATCH] [Deprecated flexbox] Do not try to float position direct > inflow children https://bugs.webkit.org/show_bug.cgi?id=266599 > >Reviewed by NOBODY (OOPS!). > >Direct children with "float: left/right" are (correctly) laid out as if they were not float positioned. However at paint time, we treat them as floats >but don't find them in RenderBlockFlow::m_floatingObjects (since we don't populate this list in flex layout). > >* LayoutTests/TestExpectations: >* LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item-expected.html: Added. >* LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item.html: Added. >* Source/WebCore/style/StyleAdjuster.cpp: >(WebCore::Style::Adjuster::adjust const): >--- > Source/WebCore/rendering/style/RenderStyle.h | 1 + > .../rendering/style/RenderStyleInlines.h | 3 ++- > Source/WebCore/style/StyleAdjuster.cpp | 12 +++++++---- > ...lex-box-with-float-flex-item-expected.html | 9 +++++++++ > ...recated-flex-box-with-float-flex-item.html | 20 +++++++++++++++++++ > 5 files changed, 40 insertions(+), 5 deletions(-) > create mode 100644 LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item-expected.html > create mode 100644 LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item.html > >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index 5f2bad83a2ab..5988e763cd84 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -1744,6 +1744,7 @@ public: > constexpr bool isDisplayInlineType() const; > constexpr bool isOriginalDisplayInlineType() const; > constexpr bool isDisplayFlexibleOrGridBox() const; >+ constexpr bool isDisplayDeprecatedFlexibleBox() const; > constexpr bool isDisplayFlexibleBoxIncludingDeprecatedOrGridBox() const; > constexpr bool isDisplayRegionType() const; > constexpr bool isDisplayBlockLevel() const; >diff --git a/Source/WebCore/rendering/style/RenderStyleInlines.h b/Source/WebCore/rendering/style/RenderStyleInlines.h >index badb08317aa4..da4d602486b1 100644 >--- a/Source/WebCore/rendering/style/RenderStyleInlines.h >+++ b/Source/WebCore/rendering/style/RenderStyleInlines.h >@@ -508,7 +508,8 @@ inline bool RenderStyle::isRowFlexDirection() const { return flexDirection() == > constexpr bool RenderStyle::isDisplayBlockLevel() const { return isDisplayBlockType(display()); } > constexpr bool RenderStyle::isDisplayDeprecatedFlexibleBox(DisplayType display) { return display == DisplayType::Box || display == DisplayType::InlineBox; } > constexpr bool RenderStyle::isDisplayFlexibleBox(DisplayType display) { return display == DisplayType::Flex || display == DisplayType::InlineFlex; } >-constexpr bool RenderStyle::isDisplayFlexibleBoxIncludingDeprecatedOrGridBox() const { return isDisplayFlexibleOrGridBox() || isDisplayDeprecatedFlexibleBox(display()); } >+constexpr bool RenderStyle::isDisplayDeprecatedFlexibleBox() const { return isDisplayDeprecatedFlexibleBox(display()); } >+constexpr bool RenderStyle::isDisplayFlexibleBoxIncludingDeprecatedOrGridBox() const { return isDisplayFlexibleOrGridBox() || isDisplayDeprecatedFlexibleBox(); } > constexpr bool RenderStyle::isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); } > constexpr bool RenderStyle::isDisplayFlexibleOrGridBox(DisplayType display) { return isDisplayFlexibleBox(display) || isDisplayGridBox(display); } > constexpr bool RenderStyle::isDisplayGridBox(DisplayType display) { return display == DisplayType::Grid || display == DisplayType::InlineGrid; } >diff --git a/Source/WebCore/style/StyleAdjuster.cpp b/Source/WebCore/style/StyleAdjuster.cpp >index 15d0885d7013..e4a2b16e869b 100644 >--- a/Source/WebCore/style/StyleAdjuster.cpp >+++ b/Source/WebCore/style/StyleAdjuster.cpp >@@ -452,11 +452,15 @@ void Adjuster::adjust(RenderStyle& style, const RenderStyle* userAgentAppearance > || style.display() == DisplayType::TableCell) > style.setWritingMode(m_parentStyle.writingMode()); > >- // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting >- // of block-flow to anything other than WritingMode::HorizontalTb. >- // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. >- if (style.writingMode() != WritingMode::HorizontalTb && (style.display() == DisplayType::Box || style.display() == DisplayType::InlineBox)) >+ if (style.isDisplayDeprecatedFlexibleBox()) { >+ // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting >+ // of block-flow to anything other than WritingMode::HorizontalTb. >+ // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. > style.setWritingMode(WritingMode::HorizontalTb); >+ } >+ >+ if (m_parentBoxStyle.isDisplayDeprecatedFlexibleBox()) >+ style.setFloating(Float::None); > > // https://www.w3.org/TR/css-display/#transformations > // "A parent with a grid or flex display value blockifies the boxâs display type." >diff --git a/LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item-expected.html b/LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item-expected.html >new file mode 100644 >index 000000000000..b9e68f55b77d >--- /dev/null >+++ b/LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item-expected.html >@@ -0,0 +1,9 @@ >+<style> >+div { >+ background-color: green; >+ width: 100px; >+ height: 100px; >+} >+</style> >+PASS if the green box is visible. >+<div></div> >diff --git a/LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item.html b/LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item.html >new file mode 100644 >index 000000000000..404adb2a6233 >--- /dev/null >+++ b/LayoutTests/fast/flexbox/deprecated-flex-box-with-float-flex-item.html >@@ -0,0 +1,20 @@ >+<style> >+.content { >+ display: -webkit-box; >+} >+.float { >+ float: left; >+ background-color: green; >+ width: 100px; >+ height: 100px; >+} >+.flex_item { >+ width: 100px; >+ height: 100px; >+} >+</style> >+PASS if the green box is visible. >+<div class=content> >+ <div class=float></div> >+ <div class=flex_item></div> >+</div>
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 266599
:
469116
| 469117