Opened 6 months ago
Closed 6 months ago
#63801 closed defect (bug) (invalid)
Corrige tipo MIME inválido para speculationrules
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch has-unit-tests close |
| Focuses: | javascript | Cc: |
Description
O valor type="speculationrules" não é um tipo MIME válido. Substituí por application/speculationrules+json, conforme documentação oficial do MDN. Isso corrige o erro de validação HTML e melhora a compatibilidade com navegadores modernos
<script type="speculationrules"> <script type="application/speculationrules+json">
<?php $this->assertStringContainsString( '<script type="application/speculationrules+json">', $output ); $json = str_replace( array( '<script type="application/speculationrules+json"', '</script>' ), '', $output );
Change History (3)
This ticket was mentioned in PR #9408 on WordPress/wordpress-develop by jorge-teixeira.
6 months ago
#1
- Keywords has-patch has-unit-tests added; needs-patch removed
#2
@
6 months ago
- Focuses accessibility removed
- Keywords close added
- Version changed from 6.8.2 to 6.8
Related: #63289
MDN web docs specifically show the valid example of <script type="speculationrules"> for inline scripts.
The W3C validator does not recognize that yet, but their GitHub repository has an issue about it:
https://github.com/validator/validator/issues/1814
#3
@
6 months ago
- Focuses css removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Version 6.8 deleted
@morpheuz2006 Hello, and welcome to trac!
@sabernhardt is correct, the script type WordPress is using speculationrules is the correct value for script tags per the MDN documentation.
The application/speculationrules+json mime type is required to be used by JSON files referenced by the Speculation-Rules HTTP header, which isn't required for the WordPress implementation.
I've closed this ticket as invalid, in this case that's Trac's unfriendly term to indicate there has been a misunderstanding.
Machine translation from English to Portuguese
@morpheuz2006 Olá e bem-vindo ao trac!
@sabernhardt está correto. O tipo de script que o WordPress está usando, speculationrules, é o valor correto para as tags script, de acordo com a documentação do MDN.
O tipo MIME application/speculationrules+json é obrigatório para arquivos JSON referenciados pelo cabeçalho HTTP Speculation-Rules, que não é necessário para a implementação do WordPress.
Encerrei este ticket como inválido; neste caso, esse é o termo hostil do Trac para indicar que houve um mal-entendido.
Tradução automática do inglês para o português
Corrige tipo MIME inválido em script de Speculation Rules
O valor type="speculationrules" não é um tipo MIME válido. Substituí por application/speculationrules+json, conforme documentação oficial do MDN. Isso corrige o erro de validação HTML e melhora a compatibilidade com navegadores modernos.
https://core.trac.wordpress.org/ticket/63801
Trac ticket: [](https://core.trac.wordpress.org/ticket/63801)