WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
206792
[LFC][IFC] Layout logic should be driven by the type of the inline box
https://bugs.webkit.org/show_bug.cgi?id=206792
Summary
[LFC][IFC] Layout logic should be driven by the type of the inline box
alan
Reported
2020-01-24 18:58:07 PST
ssia
Attachments
Patch
(7.77 KB, patch)
2020-01-24 19:02 PST
,
alan
no flags
Details
Formatted Diff
Diff
Patch
(8.30 KB, patch)
2020-01-25 06:36 PST
,
alan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-01-24 18:58:24 PST
<
rdar://problem/58889080
>
alan
Comment 2
2020-01-24 19:02:25 PST
Created
attachment 388753
[details]
Patch
Antti Koivisto
Comment 3
2020-01-24 23:59:20 PST
Comment on
attachment 388753
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=388753&action=review
> Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp:68 > static inline const Box* nextInPreOrder(const Box& layoutBox, const Container& stayWithin) > { > - const Box* nextInPreOrder = nullptr; > - if (!layoutBox.establishesFormattingContext() && is<Container>(layoutBox) && downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) > - return downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); > - > - for (nextInPreOrder = &layoutBox; nextInPreOrder && nextInPreOrder != &stayWithin; nextInPreOrder = nextInPreOrder->parent()) { > - if (auto* nextSibling = nextInPreOrder->nextInFlowOrFloatingSibling()) > - return nextSibling; > + auto opaqueBox = layoutBox.isFloatingPositioned() || layoutBox.isAtomicInlineLevelBox(); > + if (opaqueBox || layoutBox.isAnonymous() || layoutBox.isLineBreakBox()) { > + for (auto* nextInPreOrder = &layoutBox; nextInPreOrder && nextInPreOrder != &stayWithin; nextInPreOrder = nextInPreOrder->parent()) { > + if (auto* nextSibling = nextInPreOrder->nextInFlowOrFloatingSibling()) > + return nextSibling; > + } > + return nullptr; > } > - return nullptr; > + ASSERT(layoutBox.isInlineBox()); > + return downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); > }
I feel this is making previously robust and understandable pre-order traversal code much less so. How de we know at the end this is a Container that is guaranteed to have at least one child?
alan
Comment 4
2020-01-25 04:13:28 PST
(In reply to Antti Koivisto from
comment #3
)
> Comment on
attachment 388753
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=388753&action=review
> > > Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp:68 > > static inline const Box* nextInPreOrder(const Box& layoutBox, const Container& stayWithin) > > { > > - const Box* nextInPreOrder = nullptr; > > - if (!layoutBox.establishesFormattingContext() && is<Container>(layoutBox) && downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) > > - return downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); > > - > > - for (nextInPreOrder = &layoutBox; nextInPreOrder && nextInPreOrder != &stayWithin; nextInPreOrder = nextInPreOrder->parent()) { > > - if (auto* nextSibling = nextInPreOrder->nextInFlowOrFloatingSibling()) > > - return nextSibling; > > + auto opaqueBox = layoutBox.isFloatingPositioned() || layoutBox.isAtomicInlineLevelBox(); > > + if (opaqueBox || layoutBox.isAnonymous() || layoutBox.isLineBreakBox()) { > > + for (auto* nextInPreOrder = &layoutBox; nextInPreOrder && nextInPreOrder != &stayWithin; nextInPreOrder = nextInPreOrder->parent()) { > > + if (auto* nextSibling = nextInPreOrder->nextInFlowOrFloatingSibling()) > > + return nextSibling; > > + } > > + return nullptr; > > } > > - return nullptr; > > + ASSERT(layoutBox.isInlineBox()); > > + return downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); > > } > > I feel this is making previously robust and understandable pre-order > traversal code much less so. How de we know at the end this is a Container > that is guaranteed to have at least one child?
I totally agree. I probably should be doing it the other way around and remove the Container class first since at this point that class is more of a nuisance than an actual help.
alan
Comment 5
2020-01-25 06:36:19 PST
Created
attachment 388772
[details]
Patch
WebKit Commit Bot
Comment 6
2020-01-25 07:57:13 PST
Comment on
attachment 388772
[details]
Patch Clearing flags on attachment: 388772 Committed
r255118
: <
https://trac.webkit.org/changeset/255118
>
WebKit Commit Bot
Comment 7
2020-01-25 07:57:15 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug