Bug 229093 - Top layer: handle display: contents and non out-of-flow position values
Summary: Top layer: handle display: contents and non out-of-flow position values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
Depends on:
Blocks: dialog-element
  Show dependency treegraph
 
Reported: 2021-08-13 13:51 PDT by Tim Nguyen (:ntim)
Modified: 2021-08-19 11:06 PDT (History)
2 users (show)

See Also:


Attachments
Patch (8.81 KB, patch)
2021-08-13 14:00 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (9.00 KB, patch)
2021-08-13 15:24 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (6.75 KB, patch)
2021-08-19 11:04 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Nguyen (:ntim) 2021-08-13 13:51:35 PDT
In top layer:

display: contents -> display: block;

position: static/relative/sticky -> position: absolute;
Comment 1 Tim Nguyen (:ntim) 2021-08-13 14:00:34 PDT
Created attachment 435506 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-08-13 14:11:32 PDT
Comment on attachment 435506 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=435506&action=review

> Source/WebCore/style/StyleAdjuster.cpp:583
> +    if (!m_element && style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After) {

Would be nice to wrap the PseudoId::Before & PseudoId::After check in a function that is named using a spec-related term; maybe put it as a static function in some pseudo-related code.
Comment 3 Tim Nguyen (:ntim) 2021-08-13 15:24:41 PDT
Created attachment 435522 [details]
Patch
Comment 4 Tim Nguyen (:ntim) 2021-08-13 15:26:46 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 435506 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=435506&action=review
> 
> > Source/WebCore/style/StyleAdjuster.cpp:583
> > +    if (!m_element && style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After) {
> 
> Would be nice to wrap the PseudoId::Before & PseudoId::After check in a
> function that is named using a spec-related term; maybe put it as a static
> function in some pseudo-related code.

non-before/after pseudo element? not sure. I left it as it was, not sure how to improve it really.
Comment 5 Tim Nguyen (:ntim) 2021-08-14 00:23:29 PDT
(In reply to Tim Nguyen (:ntim) from comment #4)
> (In reply to Simon Fraser (smfr) from comment #2)
> > Comment on attachment 435506 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=435506&action=review
> > 
> > > Source/WebCore/style/StyleAdjuster.cpp:583
> > > +    if (!m_element && style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After) {
> > 
> > Would be nice to wrap the PseudoId::Before & PseudoId::After check in a
> > function that is named using a spec-related term; maybe put it as a static
> > function in some pseudo-related code.
> 
> non-before/after pseudo element? not sure. I left it as it was, not sure how
> to improve it really.

hmm maybe non tree-abiding pseudo element
Comment 6 Tim Nguyen (:ntim) 2021-08-14 01:13:44 PDT
(In reply to Tim Nguyen (:ntim) from comment #5)
> (In reply to Tim Nguyen (:ntim) from comment #4)
> > (In reply to Simon Fraser (smfr) from comment #2)
> > > Comment on attachment 435506 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=435506&action=review
> > > 
> > > > Source/WebCore/style/StyleAdjuster.cpp:583
> > > > +    if (!m_element && style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After) {
> > > 
> > > Would be nice to wrap the PseudoId::Before & PseudoId::After check in a
> > > function that is named using a spec-related term; maybe put it as a static
> > > function in some pseudo-related code.
> > 
> > non-before/after pseudo element? not sure. I left it as it was, not sure how
> > to improve it really.
> 
> hmm maybe non tree-abiding pseudo element

Well, this seems inconsistent across browsers, so I filed a spec issue: https://github.com/w3c/csswg-drafts/issues/6518

Will leave this unchanged for now (though there are improvements that could be done to match other browsers).
Comment 7 Tim Nguyen (:ntim) 2021-08-19 11:04:19 PDT
Created attachment 435886 [details]
Patch
Comment 8 Tim Nguyen (:ntim) 2021-08-19 11:05:11 PDT
Committed r281252 (240688@main): <https://commits.webkit.org/240688@main>
Comment 9 Radar WebKit Bug Importer 2021-08-19 11:06:21 PDT
<rdar://problem/82133421>