Skip to content

Add tests for UA styles of text-transform - #17152

Merged
annevk merged 5 commits into
web-platform-tests:masterfrom
bocoup:form-control-text-transform
Aug 29, 2019
Merged

annevk merged 5 commits into
web-platform-tests:masterfrom
bocoup:form-control-text-transform

Conversation

@jugglinmike

Copy link
Copy Markdown
Contributor

No description provided.

jugglinmike added a commit to bocoup/html that referenced this pull request Jun 3, 2019
This behavior has been implemented by many user agents and supported by
web developers via various "CSS normalizing" libraries.

Motivating issue: whatwg#1310

Tests: web-platform-tests/wpt#17152
@wpt-pr-bot wpt-pr-bot added the html label Jun 3, 2019
@jugglinmike

Copy link
Copy Markdown
Contributor Author

Spec patch here: whatwg/html#4672

@zcorpan

zcorpan commented Jun 4, 2019

Copy link
Copy Markdown
Member

The test could pass if there was no effect of text-transform at all on these elements.

You could add a test that sets text-transform explicitly on the elements. The reference could use actual uppercase letters instead of relying on CSS.

In addition, a testharness.js test that tests getComputedStyle() would be useful.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 23, 2019
…hrough for input, textarea, button and select, for compat with other UAs. r=mats

There should be no change in behavior for <input> and <textarea>. Tests need to
be written for <button> and <select>.

Tests are at web-platform-tests/wpt#17152

Differential Revision: https://phabricator.services.mozilla.com/D43221

--HG--
extra : moz-landing-system : lando
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Aug 23, 2019
…hrough for input, textarea, button and select, for compat with other UAs. r=mats

There should be no change in behavior for <input> and <textarea>. Tests need to
be written for <button> and <select>.

Tests are at web-platform-tests/wpt#17152

Differential Revision: https://phabricator.services.mozilla.com/D43221
@zcorpan

zcorpan commented Aug 27, 2019

Copy link
Copy Markdown
Member

@emilio can you review?

@emilio emilio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const refStyle = getComputedStyle(clone);
for (const prop of props) {
test(() => {
assert_equals(testStyle.getPropertyValue(prop), refStyle.getPropertyValue(prop));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda over-complicated compared to just checking the value with and without property: initial matches, but I guess this is ok.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is generalizes to any value, not just initial though. My idea is to try to test most of the rendering section like this. See #5625 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good :)

FWIW, there's some failures when I run this test locally in both Chrome and Firefox (<select multiple> has white-space: nowrap for example).

I haven't checked WebKit, but if they match Blink it may be worth fixing this test before landing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some common failures, I mean.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2fb4683

@zcorpan
zcorpan force-pushed the form-control-text-transform branch from b4dcbf1 to 3ac7cc5 Compare August 28, 2019 13:28
@zcorpan

zcorpan commented Aug 28, 2019

Copy link
Copy Markdown
Member

Rebased to see if that makes the Taskcluster check green.

@annevk
annevk merged commit 16ddb73 into web-platform-tests:master Aug 29, 2019
zcorpan pushed a commit to whatwg/html that referenced this pull request Aug 29, 2019
This behavior for text-transform has been implemented by many user agents and supported by
web developers via various "CSS normalizing" libraries.

Also align with WebKit and Blink on resetting other properties in the UA stylesheet, and align with WebKit/Blink/Gecko with having text-align: center on buttons.

Fixes #1310, fixes #4676.

Tests: web-platform-tests/wpt#17152
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 4, 2019
…hrough for input, textarea, button and select, for compat with other UAs. r=mats

There should be no change in behavior for <input> and <textarea>. Tests need to
be written for <button> and <select>.

Tests are at web-platform-tests/wpt#17152

Differential Revision: https://phabricator.services.mozilla.com/D43221

UltraBlame original commit: 3db1abb6e436926e67d3dedefeed38fbb1faca01
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 4, 2019
…hrough for input, textarea, button and select, for compat with other UAs. r=mats

There should be no change in behavior for <input> and <textarea>. Tests need to
be written for <button> and <select>.

Tests are at web-platform-tests/wpt#17152

Differential Revision: https://phabricator.services.mozilla.com/D43221

UltraBlame original commit: 3db1abb6e436926e67d3dedefeed38fbb1faca01
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 4, 2019
…hrough for input, textarea, button and select, for compat with other UAs. r=mats

There should be no change in behavior for <input> and <textarea>. Tests need to
be written for <button> and <select>.

Tests are at web-platform-tests/wpt#17152

Differential Revision: https://phabricator.services.mozilla.com/D43221

UltraBlame original commit: 3db1abb6e436926e67d3dedefeed38fbb1faca01
zcorpan pushed a commit to whatwg/html that referenced this pull request Nov 6, 2019
This behavior for text-transform has been implemented by many user agents and supported by
web developers via various "CSS normalizing" libraries.

Also align with WebKit and Blink on resetting other properties in the UA stylesheet, and align with WebKit/Blink/Gecko with having text-align: center on buttons.

Fixes #1310, fixes #4676.

Tests: web-platform-tests/wpt#17152
gcp pushed a commit to gcp/enterprise-firefox-old that referenced this pull request Feb 18, 2026
…hrough for input, textarea, button and select, for compat with other UAs. r=mats

There should be no change in behavior for <input> and <textarea>. Tests need to
be written for <button> and <select>.

Tests are at web-platform-tests/wpt#17152

Differential Revision: https://phabricator.services.mozilla.com/D43221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants