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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰Fix the bug that parseLayout ignores case and underscore #32890

Merged
merged 2 commits into from Feb 25, 2021

Conversation

caoboxiao
Copy link
Contributor

Fixes #25320

Fixes the bug that the layout fixed_height and FIXED-HEIGHT were (incorrectly) parsed as the fixed-height.

Now the javascript validator is case-sensitive, and only accepts the exact layout value (such as fixed-height).

@amp-owners-bot
Copy link

amp-owners-bot bot commented Feb 24, 2021

Hey @ampproject/wg-caching! These files were changed:

validator/js/engine/validator.js
validator/testdata/feature_tests/amp_layouts.html
validator/testdata/feature_tests/amp_layouts.out

@honeybadgerdontcare
Copy link
Contributor

Awesome! I looked at this earlier and thought of doing the same thing then thought it might be good to get rid of the layout generation from validator_gen.js as well. However that's a larger refactoring.

@honeybadgerdontcare
Copy link
Contributor

Could you add a feature test file as well that covers different permutations?
It'd go into validator/testdata/feature_tests/

@caoboxiao
Copy link
Contributor Author

Could you add a feature test file as well that covers different permutations?
It'd go into validator/testdata/feature_tests/

Done

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the test cases!

@caoboxiao caoboxiao merged commit 2ef25d7 into ampproject:master Feb 25, 2021
@caoboxiao caoboxiao deleted the parse_layout branch February 25, 2021 18:02
caoboxiao added a commit to caoboxiao/amphtml that referenced this pull request Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator incorrectly accepts layout=fixed_height
3 participants