ampproject / ampproject/amp-toolbox

Linked stylesheets don't preserve correct order

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

Description

According to the code and comments, the order between linked stylesheets and the amp-custom style should be preserved, which makes sense, as you'd want to keep CSS ordering intact.

However, the expected output in the spec files does not match this order.

For this input:

https://github.com/ampproject/amp-toolbox/blob/v2.0.0-alpha.6/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/preserves_amp_custom_style_order/input.html#L7-L9

I would expect the output to have the exact same ordering of the two fonts and the `` tag.

However, the `expected_output.html` file shows a different order:

https://github.com/ampproject/amp-toolbox/blob/v2.0.0-alpha.6/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/preserves_amp_custom_style_order/expected_output.html#L7-L8

Contributor guide

Open the contributing guide

Research direction

Compare the linked input.html and expected_output.html fixtures under packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/preserves_amp_custom_style_order/. Check the ReorderHeadTransformer spec to confirm the intended stylesheet and amp-custom ordering, then run that spec and ensure the expected output matches the preserved order.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
testing
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.