ampproject / ampproject/amp-toolbox

<title> seems to be mis-prioritised

Open
#583 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
459
Forks
242
PR merge metrics
No merged PRs in 30d

Description

In several of the `ReorderHeadTransformer` spec tests, there's a `` tag that gets reordered as well.

My tests in PHP are currently failing on these, and I think they are mis-prioritised in the `expected_output.html` files in the spec test suite here.

As an example:
https://github.com/ampproject/amp-toolbox/blob/2a81fc3795a0a5354920f7c2855af9900eecacb6/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/reorders_head_amphtml/expected_output.html#L12

As far as I understand, this section would apply for the `<title>` tag:
```
* (10) <style amp-custom>
* (11) any other tags allowed in <head>
* (12) AMP boilerplate (first style amp-boilerplate, then noscript)
```

If I'm not mistaken, `<title>` would fall under `(11)` here, which would mean it should be between `<style amp-custom>` and the boilerplate. However, it seems it is in front of both of them.

Contributor guide

Open the contributing guide

Research direction

Start with the ReorderHeadTransformer spec tests and the affected expected_output.html fixtures, including the reorders_head_amphtml example linked in the issue. Compare the title placement with the stated ordering rules and run the PHP tests that currently fail. Done means the affected fixtures place title after style amp-custom and before AMP boilerplate, with the tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, php
Domain
testing, web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.