Closed Bug 1846982 Opened 11 months ago Closed 10 months ago

baseline-source: first behaves oddly on textarea

Categories

(Core :: Layout: Block and Inline, defect, P3)

Firefox 116
defect

Tracking

()

VERIFIED FIXED
118 Branch
Tracking Status
firefox118 --- verified
firefox119 --- verified

People

(Reporter: tobias.buschor, Assigned: dshin)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0

Steps to reproduce:

create a textarea element
vertical-align it to baseline
baseline-source to first

https://developer.mozilla.org/en-US/play?id=EQGrOj1Pc2MOkeE0VuODfkLKxvtZtwkrhH%2FytAkXxoOZO7aoJjshrfppjECwPK1zghfpYghXozFEVK8D

Actual results:

the baseline is not align with the first text-line in the textarea

Expected results:

The first textline should act as baseline-source. chromium does it that way.

Funnily enough, firefox without baseline-source does exacly that and I integrated "textarea {baseline-source:first}" into my css-normalize to make chrome act the same as firefox.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Attached file Test-case

Yeah this behavior looks rather odd. David can you take a look?

Flags: needinfo?(dshin)
Severity: -- → S3
Component: CSS Parsing and Computation → Layout: Block and Inline
Priority: -- → P3
Summary: baseline-source and textarea → baseline-source: first behaves oddly on textarea
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → dshin
Flags: needinfo?(dshin)

Interestingly enough, we explicitly don't give baseline for multi-line nsTextControlFrame.

Not specifying gives the cached baseline during reflow, which happens to be the first line, hence the second textarea working.

Tests go to mozilla-specific WPT tests, because behaviour when there's no content,
or when there's placeholder text, seem very differnt for each browser.

Pushed by dshin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/928b78db7b30
Baseline calculation for textarea. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41428 for changes under testing/web-platform/tests

Backed out for causing reftest failures on display-block-baselines-3.html.

Flags: needinfo?(dshin)
Upstream PR was closed without merging

Test expectation adjusted - textarea did not used to give baseline for the enclosing block frame, now it gives the border-end edge as the baseline, which matches the that of scrolled frames.

Flags: needinfo?(dshin)
Pushed by dshin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2187935f6d78
Baseline calculation for textarea. r=emilio

:dshin - I suspect Firefox is doing some rounding in the line-height calculations for this test. The current expectations have the offsetTop of the textarea's as "11" , but there is only "10px" padding from the container?

Ah, I missed that we apply 1px block-dir margin to textarea in our stylesheet.
We should be ok to specify margin: 0 for textarea for the purpose of this test, and I see that brings offsetTop to 10 in Gecko, Blink & WebKit.
I think at this point, the best course of action is to make the change upstream (Unless this gets backed out for another failure, in which case I'll adjust it here).

Flags: needinfo?(dshin)
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Upstream PR merged by moz-wptsync-bot

(In reply to David Shin[:dshin] from comment #12)

Ah, I missed that we apply 1px block-dir margin to textarea in our stylesheet.
We should be ok to specify margin: 0 for textarea for the purpose of this test, and I see that brings offsetTop to 10 in Gecko, Blink & WebKit.
I think at this point, the best course of action is to make the change upstream (Unless this gets backed out for another failure, in which case I'll adjust it here).

Upstream review: https://github.com/web-platform-tests/wpt/pull/41491

Flags: needinfo?(dshin)
Flags: qe-verify+

Reproducible on a 2023-08-03 Nightly build on Windows 10.
Verified as fixed on Firefox 118.0b2(20230829180158) and Nightly 119.0a1(20230830212731) on Windows 10, macOS 12, Ubuntu 22.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
See Also: → 1854598
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: