Problem/Motivation

As part of #3094468: [plan] Update core JavaScript (and CSS) dependencies prior to 9.0.0-beta1 we need to update Normalize.css to the most recent version - 8.0.1

Proposed resolution

Update normalize.css from 3.0.3 to 8.0.1.

Since Drupal core themes will not depend on Stable in future (#3110855: Plan for removing dependency to Stable in Bartik/Seven/Claro/Umami), evaluate the changes (which are considerable) and determine which would cause unwanted regressions in core. If the regression is due to a bug/misjudgement in normalize.css, address in a normalize-fixes file. For other regressions, and provide customizations within the core theme experiencing the regression.

Once these regressions have been identified and addressed, add normalize.css version 3.0.3 as a BC layer to Stable. This means that themes depending on Stable (and by extension, Classy), will not be impacted by the update to normalize.css 8.0.1.

User interface changes

Drupal core themes are not impacted until #3094468: [plan] Update core JavaScript (and CSS) dependencies prior to 9.0.0-beta1. Minor regressions are expected in themes not extending Classy or Stable due to changes in normalize.css.

Remaining tasks

Review each difference between normalize 3.0.3 and 8.0.1 to determine what may be impacted
Manually look for regressions and address as needed
Run Wraith regression tests, using the previous steps to determine where efforts should be focused
For regressions surfaced by Wraith, determine if they are acceptable changes. Update themes to address the changes that are not acceptable
Add Normalize 3.0.3 to Stable, including the previous normalize-fixes, which is not necessary with normalize 8.0.1

Original report

Problem/Motivation

Firefox 49 is out and has support for <details> which means our polyfill doesn't kick in. Normalize.css sets <details> and <summary> element as display:block which means Firefox won't display the marker, they fixed this in 5.0.0 (https://github.com/necolas/normalize.css/issues/604).

Checkout comparison aligned by @droplet: (removed comments & unchanged rules, re-reordering to match v3)
https://www.drupal.org/files/issues/diff-manual-aligned-by-%40droplet.patch

Here are the change logs for Normalize.css, starting at 4.0.0 (scroll up): https://github.com/necolas/normalize.css/blob/f06565fe8e0e1ad1b88f273271.... There are a lot of changes due to reorganization/sectioning of the code as well as comment changes.

There is one notable change that causes a regression in, at least, Seven: https://github.com/necolas/normalize.css/commit/02c5c7adbbec1707900fde86..., see the attached screenshot.

There may be regressions upgrading from 3.0.3 to the most recent normalize.css.

Proposed resolution
Upgrade core's Normalize to most recent version.
Normalize 3.0.3 should be copied to Stable. Stable needs to continue using 3.0.3 for BC.

Release note

The Drupal core normalize.css has been updated from 3.0.3 to 8.0.1. Themes that are not extending Stable or Classy should manually test in case they need to update. Stable theme will continue using normalize.css 3.0.3 for backwards compatibility. Read the change record on the normalize.css upgrade for more information.

CommentFileSizeAuthor
#120 2821525-120.patch23.48 KBbnjmnm
#120 interdiff_118-120.txt2.37 KBbnjmnm
#118 interdiff_114-118.txt4.33 KBbnjmnm
#118 2821525-118.patch24.33 KBbnjmnm
#114 interdiff_101-109.txt3.38 KBbnjmnm
#114 2821525-109.patch23 KBbnjmnm
#114 2821525-109_MANUAL-TESTING_do-not-test.patch23 KBbnjmnm
#111 new.png5.92 KBeffulgentsia
#111 current.png6.15 KBeffulgentsia
#109 1280_phantomjs_diff.png137.51 KBdyannenova
#109 1280_phantomjs_new.png211.87 KBdyannenova
#109 1280_phantomjs_current.png213.72 KBdyannenova
#102 form_inputs.zip1.17 MBbnjmnm
#102 add-field-manual-test.png86.41 KBbnjmnm
#100 seven-bummer.png191.48 KBbnjmnm
#96 wraith-patch-92-test.zip38.88 MBdyannenova
#96 spider_paths.yml22.29 KBdyannenova
#92 2821525--92.patch31.01 KBbnjmnm
#92 2821525-92__MANUAL-TESTING_do-not-test.patch31.01 KBbnjmnm
#92 interdiff__89-92.txt851 bytesbnjmnm
#90 VirtualBox_IE11 - Win81_27_02_2020_15_29_47.png27.58 KBlauriii
#89 2821525-89.patch30.49 KBbnjmnm
#89 2821525-89-MANUAL-TEST-do-not-test.patch30.5 KBbnjmnm
#89 interdiff_87-89.txt1.35 KBbnjmnm
#89 interdiff_87-89.txt1.35 KBbnjmnm
#88 Screen Shot 2020-02-25 at 11.27.03.png7.09 KBlauriii
#87 interdiff_84-87.txt3.01 KBbnjmnm
#87 2821525-87.patch31.07 KBbnjmnm
#87 2821525-87-MANUAL-TEST-do-not-test.patch31.07 KBbnjmnm
#86 Screen Shot 2020-02-24 at 16.32.25.png6.25 KBlauriii
#86 Screen Shot 2020-02-24 at 16.31.25.png8.81 KBlauriii
#84 2821525-84-for-testing-do-not-test.patch21.29 KBbnjmnm
#84 2821525-84.patch21.29 KBbnjmnm
#84 interdiff_79-84.txt7.43 KBbnjmnm
#82 umami-without.png176.01 KBbnjmnm
#82 umami-with.png127.65 KBbnjmnm
#79 2821525-79.patch25.08 KBbnjmnm
#79 interdiff_70-79.txt4.2 KBbnjmnm
#78 bartik_fieldset_before.png33.96 KBlauriii
#78 bartik_fieldset_after.png34.67 KBlauriii
#78 quickedit_before.png67.45 KBlauriii
#78 quickedit_after.png60.98 KBlauriii
#78 umami_fieldset_before.png46.95 KBlauriii
#78 umami_fieldset_after.png43.7 KBlauriii
#78 seven_fieldset_after.png377.76 KBlauriii
#78 seven_fieldset_before.png381.78 KBlauriii
#78 seven_select_after_2.png28.94 KBlauriii
#78 seven_select_before_2.png29.18 KBlauriii
#78 seven_select_after.png19.8 KBlauriii
#78 seven_select_before.png19.98 KBlauriii
#78 bartik_table_before.png5.94 KBlauriii
#78 bartik_table_after.png6.14 KBlauriii
#70 safari-seven-cancel-button-fixed.png19.81 KBbnjmnm
#70 safari-seven-cancel-button-notfixed.png19.83 KBbnjmnm
#70 interdiff_68-70.txt2.57 KBbnjmnm
#70 2821525-70.patch26.68 KBbnjmnm
#70 2821525-70-just-for-testing.patch28.28 KBbnjmnm
#70 allbrowsers-seven-table-fixed.png169.19 KBbnjmnm
#70 allbrowsers-seven-table-notfixed.png136.81 KBbnjmnm
#70 chrome-seven-line-height-notfixed.png16.08 KBbnjmnm
#70 chrome-seven-line-height-fixed.png17.39 KBbnjmnm
#70 allbrowsers-claro-table-rules-notfixed.png153.37 KBbnjmnm
#70 allbrowsers-claro-table-rules-fixed.png153.54 KBbnjmnm
#70 safari-bartik-cancel-button-notfixed.png18.56 KBbnjmnm
#70 safari-bartik-cancel-button-fixed.png17.26 KBbnjmnm
#70 chrome-bartik-input-line-height-notfixed.png82.22 KBbnjmnm
#70 chrome-bartik-input-line-height-fixed.png68.02 KBbnjmnm
#68 2821525-68.patch25.63 KBbnjmnm
#68 interdiff_61-68.txt2.81 KBbnjmnm
#65 safari-abbr.png54.15 KBbnjmnm
#65 chrome|FF-abbr.png58.91 KBbnjmnm
#65 fieldset-chrome.png187.38 KBbnjmnm
#65 safari-search.png47.53 KBbnjmnm
#65 chrome-search.png43.39 KBbnjmnm
#65 inlineSVG-v801.png47.78 KBbnjmnm
#65 InlineSVG-v303.png43.3 KBbnjmnm
#65 table-v801.jpg126.36 KBbnjmnm
#65 table-v303.jpg107.47 KBbnjmnm
#62 screenshot-test.patch2.83 KBtedbow
#62 screenshot-9.0.x-1.png114.48 KBtedbow
#62 screenshot-patch-1.png114.34 KBtedbow
#61 2821525-60.patch14.94 KBbnjmnm
#41 update-normalize-css-2821525-41.patch17.5 KBchrisrockwell
#39 interdiff-2821525-21-39.txt2.69 KBchrisrockwell
#39 update-normalize-css-2821525-39.patch17.55 KBchrisrockwell
#31 update_normalize_css-2821525-31.patch15.26 KBchrisrockwell
#31 interdiff-2821525-21-31.txt425 byteschrisrockwell
#21 14-21-interdiff.txt348 bytesalexpott
#21 2821525-21.patch14.92 KBalexpott
#16 diff-manual-aligned-by-@droplet.patch4 KBdroplet
#14 Comment_types___drupal_8_3_x.png26.35 KBchrisrockwell
#12 2821525-12.patch14.92 KBchrisrockwell
#2 update-normalize-css-2821525-2.patch15.52 KBchrisrockwell

Comments

chrisrockwell created an issue. See original summary.

chrisrockwell’s picture

Status: Active » Needs review
StatusFileSize
new15.52 KB
chrisrockwell’s picture

Issue summary: View changes
chrisrockwell’s picture

Issue summary: View changes
droplet’s picture

Drupal still support IEs for awhile.

I think it needs a better comparison to see what style actual changed.

chrisrockwell’s picture

@droplet normalize 5.0.0 still supports IE8+, can you tell me what kind of comparison you'd like to see? I don't have IE8 but I'll see what I can do.

chrisrockwell’s picture

Issue summary: View changes
droplet’s picture

Just list the actual changes (what's added & removed between v3 ~ v5)?

+++ b/core/assets/vendor/normalize-css/normalize.css
@@ -1,154 +1,200 @@
-  font-family: sans-serif; /* 1 */
-  -ms-text-size-adjust: 100%; /* 2 */
-  -webkit-text-size-adjust: 100%; /* 2 */
+  font-family: sans-serif;
...
+  -ms-text-size-adjust: 100%;
...
+  -webkit-text-size-adjust: 100%;

For example these few lines, there're no real changes. And many styles just move up and down.

chrisrockwell’s picture

I added a link to the changelog in the issue summary, do you think they should be copied here?

droplet’s picture

@chrisrockwell,

It doesn't point out every change, all reviewers still have to scan full patch once.

I noticed one thing, do you modify the code style?
https://github.com/necolas/normalize.css/blob/5.0.0/normalize.css

chrisrockwell’s picture

I didn't intentionally modify anything, but it looks like the comments broke to the next line (in other places as well). I'll take a stab at mimicking what you did here: #2217523: Update normalize.css to v3.0.1.

Thanks!

chrisrockwell’s picture

StatusFileSize
new14.92 KB

Fixed issues with comments breaking to next line.

chrisrockwell’s picture

Fixed issues with comments breaking to next line.

chrisrockwell’s picture

Issue summary: View changes
StatusFileSize
new26.35 KB
chrisrockwell’s picture

@droplet are you available on IRC or Slack? With the exception of the border-collapse I'm struggling to come up with a "Notable Changes" section that isn't a mirror of the change log. What I've done below is tried to highlight the "opinionated" changes, since it appears normalize.css is trying to move opinionated changes into another css file (sanitize.css I believe)

  1. +++ b/core/assets/vendor/normalize-css/normalize.css
    @@ -1,154 +1,183 @@
    +  outline-width: 0;
    

    Update of opinionated style

  2. +++ b/core/assets/vendor/normalize-css/normalize.css
    @@ -167,86 +197,57 @@ sup {
    -  overflow: auto;
    

    Removal of opinionated

  3. +++ b/core/assets/vendor/normalize-css/normalize.css
    @@ -254,171 +255,208 @@ input,
    -  cursor: pointer; /* 3 */
    

    Removed opinionated cursor

  4. +++ b/core/assets/vendor/normalize-css/normalize.css
    @@ -254,171 +255,208 @@ input,
    +summary {
    

    Fix summary (not opinionated but helps since FF now supports details

droplet’s picture

Issue summary: View changes
StatusFileSize
new4 KB

Here's a better comparison. Manual aligned. Never want to do it again.

It seems not so possible to add to CORE though. Apparently, some changes will break the designs.

chrisrockwell’s picture

Thanks @droplet. There is a declaration missing: [hidden] { display: none } but I didn't review it all.

I guess the more important question that we need feedback on is, is this even viable? As someone that is very new to trying to contribute my take on this would be:
We have adopted a library into core. There will inevitably be revisions to that library as browsers add support for elements, bugs are found, etc. If we stop updating it now because of a regression, what do we lose out on in the future? If we go that route, we put the burden back on theme maintainers to stay up-to-date with normalize (at that point why even have it?).

On the other hand, we update it and supply patches to core themes (I'm assuming the core themes are the ones that are under consideration for regressions) as necessary.

Again, I'm literally a couple weeks into trying to be an active contributor, so take this with a grain of salt.

droplet’s picture

Thanks @droplet. There is a declaration missing: [hidden] { display: none } but I didn't review it all.

this rule is merged, and no changes between v3 & 5.

(** this is not a final patch but for reviewing only)

On other points, I understand your concerns :)

  1. @@ -273,34 +286,41 @@
    -table {
    -  border-collapse: collapse;
    -  border-spacing: 0;
    -}
    ...
    -td,
    -th {
    -  padding: 0;
    -}
    

    Based on my personal experience,
    I'd say take the newer version. and then add these back to CORE

  2. @@ -1,11 +1,9 @@
    +  line-height: 1.15; ¶
    
    @@ -184,20 +193,22 @@
    +  font-family: sans-serif; ¶
    ...
    +  line-height: 1.15; ¶
    
  3. line-height changes needed discussion

and all others change I think that's acceptable and will not make a big visual break

droplet’s picture

Issue summary: View changes
chrisrockwell’s picture

Thanks @droplet. I can't imagine the table-collapse change breaking layouts (other than a visual regression) so to add it back in and then forever have to maintain that patch as normalize.css updates seems more fragile than submitting patches to core themes.

Tagging this for review to maybe get some additional feedback.

alexpott’s picture

Assigned: Unassigned » star-szr
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new14.92 KB
new348 bytes

I re-created the patch locally by just getting https://raw.githubusercontent.com/necolas/normalize.css/5.0.0/normalize.css...

I looks like the patch in #12 adds a new line, incorrectly. Patch fixes that.

I think it is important we keep this up-to-date.

alexpott’s picture

Issue tags: +8.3.0 release notes
star-szr’s picture

Assigned: star-szr » Unassigned
Status: Reviewed & tested by the community » Needs review

Thanks everyone. Extra shout out to @droplet for the work on creating that diff, very helpful!

Can we please get a follow-up issue filed (and related to this issue) for adding the border-collapse and any other needed CSS to Stable and/or Classy? I think Stable would make sense in this case. I want to make sure that doesn't slip between the cracks.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Follow-up created, hopefully got the intention of it correct in the issue summary.

#2845106: Add needed diff between normalize.css 3.0.3 and 5.0.0

Back to RTBC

alexpott’s picture

Hmmm... surely the new CSS to ensure things don't change has to be added in this issue?

joelpittet’s picture

I'm ok with that being added in this issue too and was thinking that would be the case. Thought @Cottser had a commit plan in mind, so went with it... like improv;)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 21: 2821525-21.patch, failed testing.

star-szr’s picture

Yeah, sorry, what @alexpott said in #25 does make more sense because then we don't get the regression at all.

joelpittet’s picture

Issue summary: View changes

Thanks @Cottser, move the IS changes into this issue, let's do it here.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

chrisrockwell’s picture

Status: Needs work » Needs review
StatusFileSize
new425 bytes
new15.26 KB

I've gone through a lot of pages in two clean installs, one with this patch, and the only regression I can find is caused by the border-collapse so I added it to system.admin.css. I'm wondering if we need a table.css component instead though but, I think, that would require adding a table.css to core/modules/system/css as well (I think the tests check).

Status: Needs review » Needs work

The last submitted patch, 31: update_normalize_css-2821525-31.patch, failed testing.

xjm’s picture

Status: Needs work » Needs review

Looks like the test failure was the known intermittent failure of OutsideInBlockFormTest ; the patch is passing again now. Setting back to NR.

xjm’s picture

Issue tags: -8.3.0 release notes

Not in 8.3.x yet, although I think we could still consider backporting this if it does land, especially before RC.

xjm’s picture

Issue tags: +rc deadline

For now. We debated whether this could go in during RC/patch release, but I am leaning away from that since it's technically a major version change and includes frontend API changes. So by marking it with the deadline now, we can be sure to at least revisit it.

xjm’s picture

Version: 8.4.x-dev » 8.3.x-dev

Forgot to adjust branch. If we don't get this in for RC it can be moved back to 8.4.x.

alexpott’s picture

+++ b/core/assets/vendor/normalize-css/normalize.css
--- a/core/themes/stable/css/system/system.admin.css
+++ b/core/themes/stable/css/system/system.admin.css

I'm not sure that this is the right place to load add this css. Normalise is loaded on every page - this is loaded with the admin library. Ideally this would go in a component that is part of base library defined in system.libraries.yml

alexpott’s picture

Re #31 I think you are correct - we should add this in as part of the system's component css. Maybe stable should implement a hook_library_info_alter() to do this.

chrisrockwell’s picture

@alexpott I'm not 100% sure I'm following your recommendations to use hook_library_info_alter. Can you take a look at the attached which moves the border-collapse to a new system component css file and copies that to stable (as required)?

[EDIT: this patch also fixes the normalize version number in core.libraries.yml as that was overlooked.]

chrisrockwell’s picture

+++ b/core/modules/system/css/components/table.css
@@ -0,0 +1,11 @@
\ No newline at end of file

I'll fix this

chrisrockwell’s picture

StatusFileSize
new17.5 KB

Fix #40.

xjm’s picture

Version: 8.3.x-dev » 8.4.x-dev
Issue tags: -rc deadline

Since 8.3.x is now in commit freeze for its release candidate phase, this major version dependency update should now be targeted for 8.4.x. Thanks!

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

droplet’s picture

Still possible get into 8.4?

gagarine’s picture

Issue tags: -UX +Usability

Usability is preferred over UX, D7UX, etc. See https://www.drupal.org/issue-tags/topic

droplet’s picture

Status: Needs review » Needs work

Everything is over-engineering in Drupal. Seriously, it took 11 months for a simple task. (I do not blame any contributors in this issues thread but we have a real contribution workflow problem.) normalize.css has been released 2 more major version.

andypost’s picture

Title: Update normalize.css to 5.0.0 » Update normalize.css to 7.0.0
joelpittet’s picture

One thing to consider is that normalize has taken a large departure from it's previous versions... bootstrap forked the project because of this change.
https://blog.getbootstrap.com/2017/08/10/bootstrap-4-beta/

droplet’s picture

@joelpittet BS4 merged normalize with their standard style. It might not possible to do in Drupal CORE. (Not sure, But a huge workload to maintain the updates)

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jhodgdon’s picture

I haven't been following this issue and haven't read the 50 comments here... but I'd like to point out that on #2886904-29: display: block for details/summary hides drop arrows in Firefox (normalize.css update), the patch there from #6 (which updated normalize.css to version 7) was tested on IE and Edge, and it was broken as far as the drop-down arrows that are referenced on that issue.

Since the change for the drop-downs was added to Normalize before 5.0, I think it would be a problem there. I filed an issue in the Normalize project:
https://github.com/necolas/normalize.css/issues/740

andrewmacpherson’s picture

Couldn't we make use of libraries API declaration at the theme level? Say, copy normalize-v3 to the Stable theme, and use libraries-override to establish it there. Then it could be updated more frequently in core/assets, and other themes (core, contrib, or custom) could choose to opt-in to the lastest version in core/assets, keep going with v3 from Stable, or bundle their own copy of normalize?

Would issues like #2886904: display: block for details/summary hides drop arrows in Firefox (normalize.css update) would be easier to address this way?

jhodgdon’s picture

Probably we could, but what I was trying to say in #52 is that newer versions of normalize fix Firefox while breaking IE and Edge for the problem we're trying to solve in #2886904: display: block for details/summary hides drop arrows in Firefox (normalize.css update)... If we were to adopt a newer version of Normalize, we'd definitely need some extensive manual testing to see what else might have been changed/broken in various browsers, and then we'd need to introduce fixes so we don't break the core Seven and Bartik themes.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lauriii’s picture

Issue tags: +Drupal 9
lauriii’s picture

Title: Update normalize.css to 7.0.0 » Update normalize.css to the most recent version

I don't think we can safely update normalize.css without providing BC layer in stable. This does force us to keep two versions of the library at once. Luckily normalize.css only consist of CSS, which means it will result in only a little bit of overhead. We should try to update this before Drupal 9 so that this gets shipped as part of Drupal 9 stable.

We're working on a new browser support policy in #2390621: [policy, no patch] Update Drupal's browser support policy. As part of the issue, we are dropping support to lots of old browser versions. This could allow us to update to the most recent version of normalize.css.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

bnjmnm’s picture

Version: 8.9.x-dev » 9.0.x-dev
Assigned: Unassigned » bnjmnm
Issue summary: View changes
Issue tags: +Needs issue summary update

Switching this to a 9.0.x patch.
I did some issue summary updating, but also adding the "Needs issue summary update" tag as it will require more before this is ready for review.

bnjmnm’s picture

bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Status: Needs work » Needs review
StatusFileSize
new14.94 KB

No interdiff since this is applying to 9.0.x and with a much newer version of normalize.css

Not sure if there's a good way to manually test since stable is still using the prior version of normalize.css. If there are issues they will surface as themes decouple from Classy and Stable, but if there are particularly at-risk areas they could be tested with Stark.

tedbow’s picture

StatusFileSize
new114.34 KB
new114.48 KB
new2.83 KB

I didn't know who to test this so I did a small experiment where I ran a pre-existing test and output screenshots

  1. I used \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTest::testInlineBlocks() as test case
  2. I made some changes so that with every drupalGet() it output a screenshot
  3. I am some other changes to not output dates and times since this would change
  4. I ran the test multiple 2x with the patch from #61 outputting the screenshots to a different folder each time.
  5. I then diffed the folders via diff -rq folder1 folder2 to see if the exact same screen shots were produced each time.
  6. There screenshot were exactly the same except for 1 which random text in a body field
  7. This proves that above hack can produce the exact same screenshots, there were 20(19 exact matches)
  8. I think switched to 9.0.x and di the same test. Outputting 2 sets of screenshots. The 2 9.0.x folders were the same exact for the 1 with random text
  9. I then compared screenshots produced with patch with the screenshot produced with 9.0.x
  10. There was 1 screen that was different between 9.0.x and the patch version. It was when the user was logged out and there was extra whitespace around the page in 9.0.x. Personally the patched version looks more "correct" to me but of course this is change

I will attach the non matching screenshots and the patch I used to make the screen shots.

I am not sure if such a small change is important. Maybe we should run the same process on some other tests?

bnjmnm’s picture

This will require some browser-specific testing of elements that are impacted by normalize.css, specifically the rules that actually change something from the browser default stylesheet. I'll get some info and screenshots on that so it's not a beast to review.

bnjmnm’s picture

Went through every change between 3.0.3 and 8.0.1 and narrowed it down to ones that could potentially impact Drupal

  1. Table/table cell resets removed - deemed opinionated.
    https://github.com/necolas/normalize.css/issues/506
    These rule is no longer present.
    table {
        border-collapse: collapse;
        border-spacing: 0;
    }
    td,
    th {
      padding: 0;
    }
  2. An SVG reset was removed that is still applicable to IE11 (its default is overflow: visible;)
    The commit message states that it's part of removing no longer supporter browers (incl IE9 and below)
    Unsure why this was removed as it impacts 10/11 still.
    https://github.com/necolas/normalize.css/commit/004d58b2f2e0ac3d03d075f8...
    NO LONGER PRESENT
    svg:not(:root) {
      overflow: hidden;
    }

    Note that version 4.4.1, this rule was changed for less specificity
    https://github.com/twbs/bootstrap/commit/900775483ff0d5aa79e497fbfee8985...
    to Just

    svg {
      overflow: hidden;
    }
  3. A rule removing hover and active outlines is no longer present, it was deemed opinionated.
    https://github.com/necolas/normalize.css/commit/b5f0e9d79a997952f0d68f55...
    NO LONGER PRESENT
    a:active,
    a:hover {
      outline: 0;
    }
  4. The default input[type="search"] looks slightly different in Safari
    Before
    input[type="search"] {
      -webkit-appearance: textfield; /* 1 */
      box-sizing: content-box; /* 2 */
    }

    After

    [type="search"] {
      -webkit-appearance: textfield; /* 1 */
      outline-offset: -2px; /* 2 */
    }
  5. Some fieldset styling was removed as it was deemed opinionated
    https://github.com/necolas/normalize.css/commit/b5f0e9d79a997952f0d68f55...
    NO LONGER PRESENT
    fieldset {
    border: 1px solid #c0c0c0;
    margin: 0 2px;
    }
    fieldset padding also changed from
    padding: 0.35em 0.625em 0.75em; to padding: 0.35em 0.75em 0.625em;
  6. Rules regarding cursor styles for some inputs were removed after they were deemed opinionated
    NO LONGER PRESENT
    [type="button"],
    [type="reset"],
    [type="submit"] {
    removed cursor: pointer;
    }
  7. BEFORE
    abbr[title] {
      border-bottom: 1px dotted;
    }
    

    AFTER

    abbr[title] {
      border-bottom: none; /* 1 */
      text-decoration: underline; /* 2 */
      text-decoration: underline dotted; /* 2 */
    }
    
  8. Removed - considered opinionated
    NO LONGER PRESENT
    pre {
      overflow: auto;
    }
  9. line-height: 1.15; added to <html> This was to add consistency to most browser defaults being line-height:normal. There are several conversations regarding this change, this one seems to have the most info + links to others. https://github.com/necolas/normalize.css/issues/612
bnjmnm’s picture

StatusFileSize
new107.47 KB
new126.36 KB
new43.3 KB
new47.78 KB
new43.39 KB
new47.53 KB
new187.38 KB
new58.91 KB
new54.15 KB

I went through each potentially-disruptive change in #64 to see if they were in fact disruptive. Added core examples when I could find them (refer to that comment for details about the rules).

  1. Disruptive
    <table>,<td>,<th>
    Modernizr 3.0.3

    Modernizr 8.0.1
  2. Disruptive
    This is still an issue in IE11, should not have been removed as a rule outside of their supported browsers.
    This should be a 1/4 circle, but is not with Modernizr 8.0.1
    Modernizr 3.0.3

    Modernizr 8.0.1
  3. Probably fine
    reviewed every desktop browser's default stylesheet and none provide outlines on a:active,a:hover
  4. Disruptive
    Search input styling changes on Safari and Chrome
    Safari

    Chrome
  5. Disruptive
    This is overridden in every core and popular-contrib instance I could find, but it still changes things from the default, and contrib or custom could be expecting this styling.
    Screenshot from Chrome with only normalize.css
  6. Probably fine
    Tried this on every supported desktop browser - mobile isn't needed since it's cursor styling (i think...)
    The default stylesheet for these has the same rule.
  7. Different, but maybe fine
    It's an opinion, granted, but the <abbr> change may be welcomed?
    Safari

    Chrome/Firefox
  8. Disruptive
    This could result in <pre> elements that had scrolling to instead flow outside of their container.
  9. Probably!
    I couldn't find a scenario with core themes where this would have an impact, but a line-height declaration on <html> is quite capable of altering the appearance of something contrib/custom. This is a good rule to have, but may not be ideal to introduce to an existing site, particularly since it's not something that can provide deprecation warnings to maintainers. This change has received some complaints https://github.com/necolas/normalize.css/issues/612

Some of these changes may be acceptable since Stable (8) will still use normalize 3.0.3, and perhaps some changes in 9 can be accepted even if they can't receive deprecation coverage. Some, like table and search, don't seem acceptable and a custom solution may be necessary.

lauriii’s picture

Thank you for the thorough research @bnjmnm! 👏I think it's fine for us to proceed with updating the core version of normalize.css. I checked whether this affected the Bootstrap theme. It seems like they ship with their own version of normalize.css, meaning that this change won't affect them. I'm wondering if we should ship with normalize.css as part of core (rather than Classy) at all since it's only being loaded there. Maybe we could open a follow-up to determine that?

I think we should open upstream issue for #64.2. We should also consider fixing this in core while we wait for this to be fixed in the upstream package.

#64.1 and #64.4 we should solve this in the affected themes. This becomes relevant once we move forward with #3050389: [META] Remove dependency to Classy from core themes.

bnjmnm’s picture

#64.2 Opened a PR for the SVG issue https://github.com/necolas/normalize.css/pull/806. The normalize.css repo has been inactive for ~14 months so I'm not sure if it will get any traction, but it's also possible that the current PRs/issues are things that are less straightforward.

Will provide a patch with fixes for items 1,2,4 in #64 next.

bnjmnm’s picture

StatusFileSize
new2.81 KB
new25.63 KB

This provides additional CSS to address items 1,2 & 4 in #64 Discovered some of the issues were due to a removed line-height rule that normalize.css added for FF4, but is now baked into some assumptions in core.

Debated commenting all the new rules, but in most cases it seemed like it could cause more confusion than benefit as they're not particularly different from nearby uncommented rules. We'll let this get figured out via review.

lauriii’s picture

Thank you for opening the upstream PR! 👏

What are the steps for testing the changes in #68?

+++ b/core/core.libraries.yml
@@ -580,7 +580,7 @@ modernizr:
-  version: "3.0.3"
+  version: "8.0.1"

+++ b/core/themes/stable/stable.info.yml
@@ -89,6 +89,13 @@ libraries-override:
+    # Load version 3.0.3 of normalize.css for backwards compatibility.

Should we allow overriding the library version and other values? If we override the library with a different version of the library, value of this property is not correct anymore.

bnjmnm’s picture

Should we allow overriding the library version and other values? If we override the library with a different version of the library, value of this property is not correct anymore.

I got hung up on the override not allowing version: then realized I could just replace the whole library, so that's all set now.

The patch also changes Claro's pcss file instead of the css, because we all need that to happen to us at least once.

What are the steps for testing the changes in #68?

It's not a straightforward process because the patch includes stable using normalize.css 3.0.3. To make this testable I added a patch specifically for testing. This removes the override, so themes are using normalize.css 8.0.1.
The patch also includes a comment with every rule that was added to fix issues caused by the normalize.css update, you can find these comments by searching for the string TEST-2821525. To see the difference with/without the fix, follow the steps in each comment and comment the CSS rule to see the difference.

Here are before/after screenshots of each added rule.
Input line height - chrome - bartik - not fixed

Input line height - chrome - bartik - fixed

☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️

Input line height - chrome - seven - not fixed

Input line height - chrome - seven - fixed

☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️

Search input cancel button - safari - bartik - not fixed

Search input cancel button - safari - bartik - fixed

☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️

Search input cancel button - safari - seven - not fixed

Search input cancel button - safari - seven - fixed

☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️

Table styling - all browsers - claro - not fixed

Table styling - all browsers - claro - fixed

☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️ ☠️

Table styling - all browsers - seven - not fixed

Table styling - all browsers - seven - fixed

The last submitted patch, 70: 2821525-70-just-for-testing.patch, failed testing. View results

damienmckenna’s picture

Tagging as a requirement for Drupal 9.0-beta1.

dyannenova’s picture

Status: Needs review » Reviewed & tested by the community

I've run visual regression testing on the patch using Wraith, and spidering through all of the paths in a Standard Drupal core install. This tested around 1500 paths at 5 different resolutions. The only differences that were found were due to content differences between the test sites (e.g. timestamps), so I think that this is ready to go from the standpoint of matching experiences and the CSS changes make sense to me from an overall architecture viewpoint.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

@DyanneNova Thank you for doing manual testing on this! It would be useful to get a bit more information on what was being tested. Which patch did you use for testing? Also, which themes did your test cover?

xjm’s picture

According to @DyanneNova, the testing patch was used, and Seven and Bartik were tested. She's going to look into testing Claro and Umami (which will take a long time because of all the content paths it has).

bnjmnm’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Made the issue summary current.

dyannenova’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the testing patch with Claro and Umami now and found no differences besides content differences, so I think that this is looking good to go.

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new6.14 KB
new5.94 KB
new19.98 KB
new19.8 KB
new29.18 KB
new28.94 KB
new381.78 KB
new377.76 KB
new43.7 KB
new46.95 KB
new60.98 KB
new67.45 KB
new34.67 KB
new33.96 KB

I did a bit of manual testing and I found the following regressions that should be still addressed:

Theme / Component Before After
Bartik / Table
Seven / Select

Seven / Fieldset
Umami / Fieldset
Quickedit
Bartik / Fieldset
bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new4.2 KB
new25.08 KB

Very good catches in #78! The majority of these are issues that were already solved in some themes, but obviously not all of them. Eventually it became clear that the regressions were all best addressed within the library instead of theme-specific changes. Fewer overall changes and easier to document the ones that were added.

Will follow this up with manual review and screenshots.

lauriii’s picture

I'm wondering if these are actual regressions or just changes of behavior? If we ship these as part of the normalize-fixes, it means that these will be shipped to all themes, not just core themes. Is that what we actually want?

bnjmnm’s picture

Re #80

I'm wondering if these are actual regressions or just changes of behavior? If we ship these as part of the normalize-fixes, it means that these will be shipped to all themes, not just core themes. Is that what we actually want?

\

My earlier patch leaned more in the direction of theme-specific, but based on the feedback in #78, I believe this is what is want (with one possible exception).

I'll go through each of the items in normalize-fixes:

  1. +++ b/core/misc/normalize-fixes.css
    @@ -1,13 +1,56 @@
    +}
    

    This is to address a bug in Normalize.css, which I've submitted a PR for.

  2. +++ b/core/misc/normalize-fixes.css
    @@ -1,13 +1,56 @@
    +fieldset {
    +  border: 1px solid #c0c0c0;
    +  margin: 0 2px;
    +  padding: 0.35em 0.625em 0.75em;
    +}
    

    This was one I initially categorized as a change in behavior and did not provide any changes. Since it was pointed out in #78 as something that should be addressed if possible, it was added. It was placed in normalize-fixes as it was reported as occuring in Bartik + Umami, and Claro + Seven have no rules specifically targeting this element.

  3. +++ b/core/misc/normalize-fixes.css
    @@ -1,13 +1,56 @@
    +button,
    +input,
    +optgroup,
    +select,
    +textarea {
    +  line-height: inherit;
    +  font-size: inherit;
    +}
    

    This was already added to Bartik and Seven for <input>. #78 revealed this is also occurring with select, and I found this to be the case with <select> and <input> with Umami as well. These examples led me to believe that there are likely more unwanted surprises to come that result from normalize.css 8.0.1 introducing font-size and line-height to these elements with this rule:

    button,
    input,
    optgroup,
    select,
    textarea {
      font-family: inherit; /* 1 */
      font-size: 100%; /* 1 */
      line-height: 1.15; /* 1 */
      margin: 0; /* 2 */
    }
  4. +++ b/core/misc/normalize-fixes.css
    @@ -1,13 +1,56 @@
    +table {
    +  border-collapse: collapse;
    +  border-spacing: 0;
    +}
    +td,
    +th {
    +  padding: 0;
    +}
    

    These were already necessary additions to Claro and Seven. I moved it to normalize-fixes after #78 pointed out the table difference in Bartik. I suspect this got past manual testing as tables on the FE theme are not as common, and should have explicitly tested for this. This will likely impact Umami in the same way as it has no styles specific to table/tr/td elements.

  5. +++ b/core/misc/normalize-fixes.css
    @@ -1,13 +1,56 @@
    +/**
    + * Prevent regression due to normalize.css no longer hiding the cancel search
    + * button in 8.0.0. The cancel search button appears in Safari.
    + */
    +input[type="search"]::-webkit-search-cancel-button {
    +  -webkit-appearance: none;
     }
    

    This was initially added to just Bartik and Seven, and I opted to move it to normalize-fixes for consistency, but upon review I'm leaning towards moving this back to just Bartik and Seven and creating a followup to address the styling issues that result from the webkit search cancel button being visible, so this functionality can be present in all themes.

    Normalize 3.0.3 set this element to display:none. This rule was removed because it's effectively removing functionality inherent to input[type="search"], so it would be nice to fully remove it from core, too.

bnjmnm’s picture

StatusFileSize
new127.65 KB
new176.01 KB

Discussing this with @lauriii exposed some core-developer myopia on my part as I'd forgotten about how this impacts custom themes. While most of the rules I added to normalize-fixes should be present in all core themes, it should not be added in a way that forces those rules on custom themes. This also emphasizes the need for a detailed change record. While these rules should not be forced upon themes, it may result in some changes to existing ones and it would be good to detail those.

As part of moving the rules to individual themes, I went through each selector and rule to confirm it was needed and found that many were not. Previously, I'd been copying the entire block of CSS from normalize.css, but quite often only a portion of it was necessary.

I'll go through change-by-change again.

  1. /**
     * Add SVG styling for IE that was mistakenly removed from normalize.css in
     * 8.0.0.
     */
    svg:not(:root) {
      overflow: hidden;
    }

    This stays in normalize-fixes. It's fixing an actual bug.

  2. +fieldset {
    +  border: 1px solid #c0c0c0;
    +  margin: 0 2px;
    +  padding: 0.35em 0.625em 0.75em;
    +}

    This was necessary in every core theme other than Claro, which always overrides these styles by adding a class in claro_preprocess_fieldset(), and I did not find instances of a hard coded fieldset (if they exist, then we should see if they are impacted by the regression)

  3. +button,
    +input,
    +optgroup,
    +select,
    +textarea {
    +  line-height: inherit;
    +  font-size: inherit;
    +}

    This was the trickiest one as the way this was applied in normalize.css 3 was a bug - inherit should not be used. For each theme, I went through each selector to see if a change occurred these rules were disabled. If there was a change, I provided a hard coded line-height/font-size to match what resulted from using inherit. In some cases, particularly Claro, the normalize css rules were always overridden so those were skippable as well. Each theme only required a small subset of this rule.

  4. +table {
    +  border-collapse: collapse;
    +  border-spacing: 0;
    +}
    +td,
    +th {
    +  padding: 0;
    +}

    Umami looks slightly better without these rules added, so I skipped them
    With the normalize.css 3.0.3 table CSS

    Without it

    For the remaining themes, only border-collapse: collapse; is necessary. The other table/td/tr rules were not added to those themes.

  5. +/**
    + * Prevent regression due to normalize.css no longer hiding the cancel search
    + * button in 8.0.0. The cancel search button appears in Safari.
    + */
    +input[type="search"]::-webkit-search-cancel-button {
    +  -webkit-appearance: none;
     }

    Keeping this in normalizes-fixes, with plans to remove in #3114878: The webkit search cancel button should not be hidden . This rule hides search cancel buttons from appearing in the webkit browsers that support them, and this is how core currently functions. However, it is preferred to adopt the perspective of normalize.css and make this element visible, but if this rule is removed, it impacts the search input styling for all themes. In some cases inarguably breaks it. In the followup we can fix those issues in core themes and determine any risks to contrib/custom themes by making this element visible. In the scope of this issue, however, I'd be concerned about exposing an element that has otherwise been hidden for Drupal 8's lifespan.

bnjmnm’s picture

Here are the patches I meant to include with #82
(and this one submitted without my consent so the patches aren't here either.... we will try again)

bnjmnm’s picture

StatusFileSize
new7.43 KB
new21.29 KB
new21.29 KB

The last submitted patch, 84: 2821525-84.patch, failed testing. View results

lauriii’s picture

I did pretty extensive testing on the patch. I could only find this one regression which affects all themes.

Before:

After:

bnjmnm’s picture

StatusFileSize
new31.07 KB
new31.07 KB
new3.01 KB

#86 is due to a rule introduced in normalize.css 4.1.0. Added regression prevention to each theme.

lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new7.09 KB
  1. +++ b/core/core.libraries.yml
    --- a/core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php
    +++ b/core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php
    
    +++ b/core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php
    @@ -57,7 +57,7 @@ public function getInfo($type);
    -   * @return mixed
    +   * @return string
    

    Unrelated change 🔬👁


  2. There's still a minor difference on this field. The field is slightly higher which makes the "No file chosen" text unaligned in comparison to the button. This seems to only happen in Seven.
bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB
new1.35 KB
new30.5 KB
new30.49 KB

The should-have-rerolled issue is addressed, but the interdiff doesn't include that.

I found minor differences with the file input on Umami and Bartik as well. I opted to address these as well since the solution is applying less styling overall. Note that In Seven there is a barely (if at all) perceptible difference in line-height by going with this less-styling approach, which I preferred to adding a rule specific to file inputs.

lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new27.58 KB

This addressed #88 👍

I found one more regression on IE 11; for some reason there's a bullet next to details elements. This happens in all themes except Claro.

catch’s picture

Priority: Normal » Critical

Bumping to critical since this blocks #3094468: [plan] Update core JavaScript (and CSS) dependencies prior to 9.0.0-beta1 which in turn blocks the beta/release.

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new851 bytes
new31.01 KB
new31.01 KB

The issue in #90 is due to normalize.css setting all summary elements to display: list-item. I'd assumed was only a good thing as this was a problem in some Firefox versions. However, for browsers that don't support details/summary, this results in a list item bullet being attached to the element.

Note that for this fix several of my attempts to target Edge did not work, including ones that are in use on Claro. I tried:

_:-ms-lang(x), _:-webkit-full-screen, .selector {}
_:-ms-input-placeholder, :root .selector {}
_:-ms-fullscreen, :root .selector {}
_:-ms-input-placeholder, .selector {}
_:-ms-fullscreen, .selector {}

Until I was finally able to get it to work in my Virtualbox version of edge with
@supports (-ms-ime-align:auto){}

Also confirmed that tab navigation and focus still work properly in IE/Edge after this change.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs subsystem maintainer review

Confirmed that this fixes #90 in both, IE Edge and IE 11.

I've now tested Seven, Bartik, Claro and Umami with IE 11, Edge, Firefox, Chrome (MacOS and Android) and Safari (MacOS and iOS) using the Style guide module which should cover most standard HTML element styles. I've also clicked through lots of features in the UI, including node edit form, Umami front-end pages, Bartik front-end pages, status report page, Views UI, layout builder, media library, Field UI and a couple of the configuration forms. I couldn't find any additional regressions.

We've also done some automated regressions testing (#77) which suggested that there aren't any big regressions.

I also confirmed that correct files are loaded from Stable using the non-testing patch.

I'm removing the needs subsystem maintainer review since I believe that it isn't necessary anymore at this point anymore.

I created a draft CR for this since I think it would be good to notify themes not extending Stable or Classy that this might cause regressions in their themes.

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +9.0.0 release notes, +Needs release note

Good call on the CR. We should also actually add a release note summarizing the potential disruption. (We'd already be mentioning the dependency major version update anyway, so we can just add a sentence or two to that.)

catch’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs release note

Added a release note based on the CR.

dyannenova’s picture

StatusFileSize
new22.29 KB
new38.88 MB

I ran a quick wraith test on the manual testing patch in #92. I tested Claro and Umami, with a few sample content items at 360px, 768px, and 1280px widths. I've attached the spider yaml file with the tested urls.

The test found some minor changes on these urls:

/filter/tips
/contact/feedback
/contact
/user/login
/user
/user/password
/search
/search/node

I've uploaded the gallery as a zip file with the screenshots and diffs, plus the gallery website with the analysis.

It looks like the relevant rule causing the change for the forms is in the umami base.css file:

/**
* Prevent regression due to explicit line-height applied to these elements in
* normalize.css 7.0.0.
*/
button,
input:not([type="file"]),
textarea {
line-height: 1.5rem;
}

For filter/tips, the rules that used to apply from normalize.css and are now missing are:

table {
border-collapse: collapse;
border-spacing: 0;
}

and

td, th {
padding: 0;
}

lauriii’s picture

Status: Reviewed & tested by the community » Needs review

Thank you @DyanneNova! It seems like the differences on tables and form line heights are small enough for them to be ignored, but it's good that they have been now listed here. Does the gallery only list URLs that have differences?

Would you be able to run the test also on Bartik and Seven?

xjm’s picture

Question about the CR. It says:

The Drupal core normalize.css has been updated from 3.0.3 to 8.0.1. There are lots of changes on the update so manual testing is strongly recommended to themes that are not extending Stable or Classy. Stable theme will continue using normalize.css 3.0.3 for backwards compatibility.

However, presumably, Stable 9 should use the updated version. Have we explored that yet? The CR should probably clarify that point as well.

xjm’s picture

@bnjmnm is going to run #97.

bnjmnm’s picture

Status: Needs review » Needs work
StatusFileSize
new191.48 KB

This is happening in Seven ☹️

xjm’s picture

I wonder if #100 is the same line height difference mentioned in #96?

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new86.41 KB
new1.17 MB

I rescind my "needs work". Manual testing revealed that my finding in #100 occurs with both versions of normalize. The situation that showed up in the second screenshot, where the "or" is to the right of the select field, occurs (in Chrome at least) in a very specific pixel range 356px-361px. I suspect the 360px specified in wraith may have been interpreted as slightly wider/narrower in the test.

I ran regression tests on Bartik and Seven, using the same paths as the tests in #96. The only differences are related to form input line-heights, which I suspect are acceptable based on #97. It's also not surprising that this would happen, as normalize.css had previously used line-height: inherit, which means input line heights were not a fixed value throughout the theme. This results in slightly higher line-heights on some admin forms (the values I added were based on keeping entity forms consistent). This difference happens to be closer to what Claro is doing.

I attached two comparisons from Bartik. This is exactly what is happening in Seven as well so referencing those is applicable to both themes.

catch’s picture

Status: Needs review » Reviewed & tested by the community

#102 looks like a pass on Seven and Bartik, so I think we can restore the RTBC here.

bnjmnm’s picture

Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update, +Needs change record updates

So i think the issue summary need to make it clear that themes extending from stable & classy are still going to using the old version. I also think the change record needs to detail this and it should detail how (if you not extending stable) you can do the same thing as stable if you are using the normalise library provided by core.

I think the approach here to update the library but continue to use the old one in core themes is a good one and we can deal with more fallout when we remove stable as a base theme for claro, umami, and seven.

bnjmnm’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes
lauriii’s picture

dyannenova’s picture

Status: Needs work » Needs review
StatusFileSize
new213.72 KB
new211.87 KB
new137.51 KB

I ran the same Wraith tests on Bartik and Seven and also found a small font size difference in form select fields, introduced by this rule:

select {
font-size: 0.8125rem;
}

Current
Before patch

New
After patch

Difference
Difference

The rest of the diffs in the test all appear to be line height related.

dyannenova’s picture

Status: Needs review » Needs work

Setting back to Needs work.

effulgentsia’s picture

Issue summary: View changes
StatusFileSize
new6.15 KB
new5.92 KB

a small font size difference in form select fields

Nice find! I had a hard time spotting that from the full screenshots in #109, so here's just the select field cropped out from each of them. The first/current one is slightly larger than the second/new one.

Screenshot of a form select field in HEAD. It's slightly larger.

Screenshot of a form select field with the patch applied. It's slightly smaller.

lauriii’s picture

I updated the CR with the info that was requested on #105.

bnjmnm’s picture

Assigned: Unassigned » bnjmnm

I'll have the font-size issue addressed shortly.

bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Status: Needs work » Needs review
StatusFileSize
new23 KB
new23 KB
new3.38 KB

This addresses #109 and applies similar fixes to Bartik

The location of Stable's normalize-fixes.css was also changed, since Stable's css/core directory already represents /misc. The css/core/misc directory is unnecessary.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

I think both, #105 and #109 has been addressed. Since this is blocking multiple issues, we should fix rest of the regressions to core themes on #3110855: Plan for removing dependency to Stable in Bartik/Seven/Claro/Umami since they are not visible to users before that issue is committed.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Just noticed that the CSS changes cause CSSLint errors:

$ yarn run lint:css
yarn run v1.21.1
$ stylelint "**/*.css"

themes/bartik/css/components/form.css
 37:3  ✖  Expected "padding" to come before "border"   order/properties-order

themes/bartik/css/components/table.css
 13:3  ✖  Expected "border-collapse" to come before "font-size"   order/properties-order

themes/claro/css/components/form.pcss.css
 209:6  ✖  Expected newline after ","   selector-list-comma-newline-after

themes/seven/css/components/form.css
 25:3  ✖  Expected "font-size" to come before "line-height"   order/properties-order
 31:1  ✖  Expected no more than 1 empty line                  max-empty-lines
 38:3  ✖  Expected "margin" to come before "border"           order/properties-order

profiles/demo_umami/themes/umami/css/base.css
 269:3  ✖  Expected "margin" to come before "border"   order/properties-order

themes/stable/css/core/assets/vendor/normalize-css/normalize.css
 138:3   ✖  Expected "margin" to come before "font-size"                 order/properties-order
 147:3   ✖  Expected "color" to come before "background"                 order/properties-order
 166:3   ✖  Expected "position" to come before "line-height"             order/properties-order
 233:27  ✖  Unexpected duplicate name monospace                          font-family-no-duplicate-names
 259:3   ✖  Expected "margin" to come before "font"                      order/properties-order
 314:3   ✖  Expected "padding" to come before "border"                   order/properties-order
 378:3   ✖  Expected "margin" to come before "border"                    order/properties-order
 389:3   ✖  Expected "padding" to come before "border"                   order/properties-order
 418:3   ✖  Expected "border-spacing" to come before "border-collapse"   order/properties-order
bnjmnm’s picture

Assigned: Unassigned » bnjmnm

That's among the more disappointing ways to realize that PHPStorm lint checking was only set up for my 8.x install.... Fix on the way.

bnjmnm’s picture

Assigned: bnjmnm » Unassigned
Status: Needs work » Needs review
StatusFileSize
new24.33 KB
new4.33 KB

Fixed

lauriii’s picture

Status: Needs review » Needs work
+++ b/core/themes/seven/css/components/form.css
--- a/core/themes/stable/css/core/assets/vendor/normalize-css/normalize.css
+++ b/core/themes/stable/css/core/assets/vendor/normalize-css/normalize.css

Let's actually revert these changes and add core/themes/stable/css/core/assets/vendor as ignored path in .stylelintrc.json.

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new2.37 KB
new23.48 KB

Addresses #119 and an extra line in form.css not caught by stylelint autofix

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Thank you! This addresses #116

alexpott’s picture

Couple of questions...

  1. +++ b/core/profiles/demo_umami/themes/umami/css/base.css
    @@ -260,6 +260,37 @@ label {
    +/**
    + * Prevent regression due to -webkit-appearance being set to button in
    + * normalize.css 4.1.0.
    + */
    +::-webkit-file-upload-button {
    +  -webkit-appearance: push-button;
    +}
    
    +++ b/core/themes/bartik/css/components/form.css
    @@ -87,6 +106,14 @@ textarea {
    +/**
    + * Prevent regression due to -webkit-appearance being set to button in
    + * normalize.css 4.1.0.
    + */
    +::-webkit-file-upload-button {
    +  -webkit-appearance: push-button;
    +}
    
    +++ b/core/themes/claro/css/components/form.css
    @@ -280,3 +280,26 @@ tr .form-item,
    +/**
    + * Prevent regression due to -webkit-appearance being set to button in
    + * normalize.css 4.1.0.
    + */
    +
    +::-webkit-file-upload-button {
    +  -webkit-appearance: push-button;
    +}
    
    +++ b/core/themes/claro/css/components/form.pcss.css
    @@ -198,3 +198,23 @@ tr .form-item,
    +/**
    + * Prevent regression due to -webkit-appearance being set to button in
    + * normalize.css 4.1.0.
    + */
    +::-webkit-file-upload-button {
    +  -webkit-appearance: push-button;
    +}
    
    +++ b/core/themes/seven/css/components/form.css
    @@ -353,3 +385,11 @@ select {
    +/**
    + * Prevent regression due to -webkit-appearance being set to button in
    + * normalize.css 4.1.0.
    + */
    +::-webkit-file-upload-button {
    +  -webkit-appearance: push-button;
    +}
    

    As this is going everywhere should it be in the root fixes file?

  2. +++ b/core/themes/bartik/css/components/form.css
    @@ -13,9 +13,28 @@ form {
    +button {
    +  line-height: 1.21875rem;
    +}
    +input:not([type="file"]) {
    +  line-height: normal;
    +}
    +select {
    +  line-height: 1.5;
    +}
    
    +++ b/core/themes/claro/css/components/form.css
    @@ -280,3 +280,26 @@ tr .form-item,
    +button {
    +  line-height: 1.125rem;
    +}
    ...
    +input,
    +optgroup {
    +  line-height: 1.5rem;
    +}
    
    +++ b/core/themes/claro/css/components/form.pcss.css
    @@ -198,3 +198,23 @@ tr .form-item,
    +/**
    + * Prevent regression due to explicit line-heights applied to these elements in
    + * normalize.css 7.0.0.
    + */
    +button {
    +  line-height: 1.125rem;
    +}
    +input,
    +optgroup {
    +  line-height: 1.5rem;
    +}
    

    Should the line-height have units? There's one without - but the other have them. I'm not sure.

bnjmnm’s picture

#122.1 Regarding the addition of -webkit-appearance: push-button; to each core theme. We've reserved the root fixes file for actual bugs in normalize.css, The SVG styling in the current normalize-fixes.css addresses a bug -- it reintroduces a rule that shouldn't have removed until IE11 was no longer supported. In the case of -webkit-appearance: it is a worthwhile addition to the library to have available to new themes, despite it needing addressing in each core theme.

#122.2 Right, that could look pretty odd without context. The issue being addressed here is that normalize.css 3.0.3 styled these input elements with line-height: inherit, so the line-height was often determined by the nearest ancestor that specified a value. Different ancestor elements used different (or no) units for line-height.

alexpott’s picture

Credited reviewers - @andrewmacpherson got credit for the first suggestion of using libraries overrides to provide BC, @Cottser and @joelpittet for issue management as theme sub system maintainers back in the day.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

@bnjmnm thanks for answering my questions in #123. I think we're okay to go forward here. Maybe some more things will be found when we decouple core themes from stable but I think we've gone as far as possible to limit the fallout.

Committed 952e939 and pushed to 9.0.x. Thanks!

  • alexpott committed 952e939 on 9.0.x
    Issue #2821525 by bnjmnm, chrisrockwell, tedbow, alexpott, droplet,...
xjm’s picture

Issue summary: View changes

Adding a link to the CR to the release note (always a best practice).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

quietone’s picture

publish change record