Closed
Bug 1322698
Opened 8 years ago
Closed 8 years ago
[css-align] The checkbox/radio baseline is derived from its content-box with 'appearance:none'
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
Details
(Keywords: testcase, Whiteboard: [parity-chrome][parity-edge][parity-safari])
Attachments
(5 files, 1 obsolete file)
632 bytes,
text/html
|
Details | |
20.22 KB,
image/png
|
Details | |
605 bytes,
text/html
|
Details | |
3.36 KB,
patch
|
Details | Diff | Splinter Review | |
1.63 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
Edge, Chrome and Safari are using the margin-box (in a block context). I think that is what the spec says: https://drafts.csswg.org/css-align-3/#baseline-terms We should do the same for compatibility.
Assignee | ||
Comment 1•8 years ago
|
||
Assignee | ||
Comment 2•8 years ago
|
||
Apparently, that behavior ONLY applies when 'appearance' is 'none'.
Assignee | ||
Updated•8 years ago
|
Summary: [css-align] The checkbox/radio baseline is derived from its content-box → [css-align] The checkbox/radio baseline is derived from its content-box with 'appearance:none'
Assignee | ||
Comment 3•8 years ago
|
||
Note: this is lower prio to review since it's not necessary for v52 (IMO). The baseline behavior here is quite bizarre, if a checkbox/radio is themed then it uses its content-box, otherwise (appearance:none) then it uses the margin-box (in a block context - it will be the border-box if it's a flex/grid item). But this is what other UAs do so... I had to keep the old behavior intact for Android though, because checkbox/radio controls have 'appearance:none' *by default* there. I suspect that might cause web-compat problems if we change it to use the margin-box by default. (Which implies that our Android browser probably is *already* displaying this edge case differently from desktop UAs. (I haven't tested mobile UAs from other vendors though, so I don't know if they have similar issues.))
Attachment #8818004 -
Flags: review?(dholbert)
Assignee | ||
Comment 4•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2f85fdd77882dbc83f96763f95ac0207772fc631&exclusion_profile=false
Comment 5•8 years ago
|
||
Comment on attachment 8818004 [details] [diff] [review] Synthesize an 'appearance:none' checkbox/radio baseline from its margin-box by default (in an inline context). Review of attachment 8818004 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/forms/nsFormControlFrame.cpp @@ +107,5 @@ > + // so the different layout for appearance:none we have on other platforms > + // doesn't work here. *shrug* > + || true > +#endif > + ) { I think this might be better if you reversed the logic? Both from an understandability & from a code-churn perspective. (And it'd be nice to avoid the "|| true" hack in the if-condition.) How about something like: #if !defined(MOZ_WIDGET_ANDROID) if (StyleDisplay()->mAppearance == NS_THEME_NONE) { [...appearance:none-specific code here...] } #endif [...old code here...]
Updated•8 years ago
|
Flags: needinfo?(mats)
Comment 6•8 years ago
|
||
(This conveniently would mean you could avoid reindenting all of the existing code, which is nice for blame-preservation. That's not the chief goal here, but it's a happy side-effect of flipping the logic.)
Assignee | ||
Comment 7•8 years ago
|
||
Yeah, that's better, thanks.
Attachment #8818004 -
Attachment is obsolete: true
Attachment #8818004 -
Flags: review?(dholbert)
Flags: needinfo?(mats)
Attachment #8820480 -
Flags: review?(dholbert)
Comment 8•8 years ago
|
||
Comment on attachment 8820480 [details] [diff] [review] Synthesize an 'appearance:none' checkbox/radio baseline from its margin-box by default (in an inline context). Review of attachment 8820480 [details] [diff] [review]: ----------------------------------------------------------------- r=me
Attachment #8820480 -
Flags: review?(dholbert) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c718681647c7 Synthesize an 'appearance:none' checkbox/radio baseline from its margin-box by default (in an inline context). r=dholbert https://hg.mozilla.org/integration/mozilla-inbound/rev/326d947d6bb6 Reftest for 'appearance:none' checkbox/radio baseline alignment.
Comment 10•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c718681647c7 https://hg.mozilla.org/mozilla-central/rev/326d947d6bb6
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•