Skip to content
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

refactor: remove extraneous type attribute from script, link (stylesheet), and style tags #23674

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

davidmurdoch
Copy link
Contributor

@davidmurdoch davidmurdoch commented Mar 24, 2024

On HTML5 documents the default type for script tags is "text/javascript", the default type for link tags with rel='stylesheet' is "text/css", and the default type for style tags is also "text/css".

For the skeptical reviewer, here is the documentation to back up my claims:

script

Authors should omit the type attribute instead of redundantly setting it.

https://html.spec.whatwg.org/dev/scripting.html#attr-script-type

link rel="stylesheet"

link element's type attribute is advisory:

User agents must not consider the type attribute authoritative — upon fetching the resource, user agents must not use the type attribute to determine its actual type.

from https://html.spec.whatwg.org/#processing-the-type-attribute

The default type for resources given by the stylesheet keyword is text/css.

https://html.spec.whatwg.org/#link-type-stylesheet

style

type Deprecated
This attribute should not be provided: if it is, the only permitted values are the empty string or a case-insensitive match for text/css

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style#type

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [ac0cd7f]
Page Load Metrics (547 ± 380 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint701831092813
domContentLoaded97132189
load572041547791380
domInteractive97132189
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@davidmurdoch davidmurdoch marked this pull request as ready for review March 24, 2024 23:26
@davidmurdoch davidmurdoch requested review from kumavis and a team as code owners March 24, 2024 23:26
brad-decker
brad-decker previously approved these changes Mar 25, 2024
digiwand
digiwand previously approved these changes Mar 27, 2024
@davidmurdoch davidmurdoch dismissed stale reviews from digiwand and brad-decker via d6798dd March 27, 2024 22:23
@davidmurdoch davidmurdoch requested a review from digiwand March 27, 2024 22:23
@metamaskbot
Copy link
Collaborator

Builds ready [d6798dd]
Page Load Metrics (1205 ± 591 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint723831708440
domContentLoaded9155453617
load56294212051231591
domInteractive9155453617
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.13%. Comparing base (207f6af) to head (d6798dd).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #23674   +/-   ##
========================================
  Coverage    69.13%   69.13%           
========================================
  Files         1160     1160           
  Lines        44260    44260           
  Branches     11839    11839           
========================================
  Hits         30596    30596           
  Misses       13664    13664           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DDDDDanica DDDDDanica merged commit b7dc2bf into develop Mar 28, 2024
69 checks passed
@DDDDDanica DDDDDanica deleted the refactor-remove-js-type branch March 28, 2024 01:23
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2024
@metamaskbot metamaskbot added the release-11.15.0 Issue or pull request that will be included in release 11.15.0 label Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.15.0 Issue or pull request that will be included in release 11.15.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants