Skip to content

Make sure that enum documentation contains unique IDs for animations #2060

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

Merged
merged 2 commits into from
Nov 8, 2019

Conversation

gspencergoog
Copy link
Collaborator

Currently, on pages like this, the animations produced don't have unique IDs, because for enum fields, their oneLineDoc contains the entire documentation, so that they all appear in the Constants list on the enum's class page.

The way we tried to generate unique values in the past was to assume that each element would appear on its own page, and so be unique, but that's not true for enums.

This change creates a package-level Map<String, Set<String> that contains a mapping from Element.href to a set of animation IDs that have been already used for that href. We then generate new ids, making sure that each new ID is unique for the href. This should assure that there are no non-unique IDs on a single output page, including checking to make sure that user-supplied IDs are unique per page.

Also added a test that should make sure this is the case.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Nov 6, 2019
@gspencergoog gspencergoog force-pushed the fix_enums branch 3 times, most recently from 47fed1d to 64fed6e Compare November 8, 2019 17:02
@jcollins-g jcollins-g merged commit 8c4227b into dart-lang:master Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants