-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-display][css-position] Computed value of float with absolute positioning when there is no box? #1436
Comments
There is also the case of being inside a <div style="display: none">
<div id="test3" style="position: absolute; float: left"></div>
</div> getComputedStyle(test3).float; // "none" on Firefox, Chrome and Edge I don't see why this should be different than when having |
Proposed resolution is that an element with Possible edits:
|
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Computed value of float with absolute positioning when there is no box?<dael> Github: https://github.com//issues/1436 <dael> fantasai: The issue is about if display has value of none 2.1 rules say position and flow don't apply and this short circuts the rest of display conputations. Normally if you have position absolute and float left float computes to none. If you have display none the computation doesn't happen. However, this becomes interesting with display: contents. What do we do for that one. <dael> TabAtkins: This is where display: contents is the same problem as none, it's just someone is more freshly looking. <dael> fantasai: Anything display: none due to parents the float computes to none. We propose any element with display: none , chidl of display: none or display: contents they all behave the same in respect to these transformations. <fantasai> https://github.com//issues/1436#issuecomment-313215820 <dael> fantasai: We proposed specific edits in the issue. We'ld like a resolution to make them consistant and then a second for people tor eview the proposed edits. <dael> dbaron: Idea is you make them consistant by always applying the rule where if position is absolute float is none. <dael> TabAtkins: It's bad that it's inconsistant. <dael> Rossen_: We already do...in all cases we would applyt hte rules and it seems FF and Chrome from reading the issue have a half and half where you do it for display: content but not display: none so you ahve branching somewhere. <dael> dbaron: I'd be hesitant to have special rules for decendants. <fantasai> dbaron: But I'd be okay to make them all float: none <dael> Rossen_: There shouldn't be any special casing for decendants. I was highlighting that in this case you're not going to apply float computation rules, but with display: contents you will. If we all align and make it always apply then it will be more itnernally consistant and interop <dael> TabAtkins: It matches IE always and Chrome & FF except in cases with display: none. Always applies is a small change. <dbaron> s/float is none./float is none?/ <dael> Rossen_: I'm fine making the changes to css position. fantasai you said there might be changes to css 2? <dael> Rossen_: Or is it css display? <dael> fantasai: Yes for css2. There are edits in the issue. IT would be good for someone to check those <dael> Rossen_: I did check, but those edits appear in css2.1 section 9.7 and in css position. I can reflect the position changes. Q is do we need to do anything on css-display <dael> TabAtkins: I don't think so. Algo is only in 2.1 and position. There's nothing special in display. <dael> Rossen_: Sounds good. <dael> astearns: sounds like we need to resolve to make edits in css position. WOuld it make sense to make the edits, round of review, and then backport to css2? <dael> TabAtkins: We were operating off 2.1 algo so we know what needs to be changed. <ChrisL> we resolved to request CR on css display in February. Is there some issue with the disposition of comments of the transition request? bert was handling it <dael> astearns: So we'd resolve the change for both position & 2.1 <dael> TabAtkins: Yeah. <dael> astearns: Obj? <dael> RESOLVED: Make the changes listed in css2.1 and position |
Could somebody:
(I think it's reasonable to ask that when we're proposing changes to 2.1.) |
…o box should be "none" w3c/csswg-drafts#1436
Hey, just fwiw, I started making the process of filing this kind of small tests more friction-less; here is the current workflow:
I will spend a couple of my cycles improving this workflow even further in the near future, so if you have feedback please feel free to reach out :) @tabatkins @fantasai @frivoal in particular; cc @gregwhitworth @foolip @lukebjerring |
…o box should be "none" (#13958) w3c/csswg-drafts#1436
Just realized I hadn't included the url of the site, so for those who didn't know already, the url to try the new tool is https://wptest.center/ |
…e positioning when there is no box should be "none", a=testonly Automatic update from web-platform-testsThe computed value of float with absolute positioning when there is no box should be "none" (#13958) w3c/csswg-drafts#1436 -- wpt-commits: 4477b9d2fadaca4314a9fc7d88ab6db6ad47a321 wpt-pr: 13958
…e positioning when there is no box should be "none", a=testonly Automatic update from web-platform-testsThe computed value of float with absolute positioning when there is no box should be "none" (#13958) w3c/csswg-drafts#1436 -- wpt-commits: 4477b9d2fadaca4314a9fc7d88ab6db6ad47a321 wpt-pr: 13958
Even when there's no box, according to spec change in w3c/csswg-drafts#1436, computed value of float with absolulte position should be "none". Bug: 903275 Change-Id: I7df8eb39eb4c5f22cadbfdbe7a96227eb61a09b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546732 Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: hyunjune kim <hyunjune.kim@samsung.com> Cr-Commit-Position: refs/heads/master@{#646261}
…e positioning when there is no box should be "none", a=testonly Automatic update from web-platform-testsThe computed value of float with absolute positioning when there is no box should be "none" (#13958) w3c/csswg-drafts#1436 -- wpt-commits: 4477b9d2fadaca4314a9fc7d88ab6db6ad47a321 wpt-pr: 13958 UltraBlame original commit: 3e881588a828a6b0620d5b2914b3207c0b0ce4c3
…e positioning when there is no box should be "none", a=testonly Automatic update from web-platform-testsThe computed value of float with absolute positioning when there is no box should be "none" (#13958) w3c/csswg-drafts#1436 -- wpt-commits: 4477b9d2fadaca4314a9fc7d88ab6db6ad47a321 wpt-pr: 13958 UltraBlame original commit: 3e881588a828a6b0620d5b2914b3207c0b0ce4c3
…e positioning when there is no box should be "none", a=testonly Automatic update from web-platform-testsThe computed value of float with absolute positioning when there is no box should be "none" (#13958) w3c/csswg-drafts#1436 -- wpt-commits: 4477b9d2fadaca4314a9fc7d88ab6db6ad47a321 wpt-pr: 13958 UltraBlame original commit: 3e881588a828a6b0620d5b2914b3207c0b0ce4c3
CSS 2.1 and CSS Position say
But does this affect the computed value of
position
orfloat
?Both Firefox and Chrome seem to think that the computed value should be the specified one. However, if you specify both absolute positioning and floating, Edge computes
float
tonone
, according toAnyways, the interesting case is
display: contents
, which didn't exist in CSS 2.1. I guess it should interact withposition
andfloat
just likedisplay: none
does.However, in this case Firefox and Chrome also compute
float
tonone
when an element withdisplay: contents
has both both absolute positioning and floating.What is the expected behavior?
The text was updated successfully, but these errors were encountered: