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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add margin-*, padding-*, scroll-snap-* CSS properties #1011

Merged
merged 4 commits into from
Dec 1, 2024

Conversation

torusrxxx
Copy link
Contributor

@torusrxxx torusrxxx commented Nov 30, 2024

Supported the following new CSS properties:

  1. margin-block
  2. margin-block-end
  3. margin-block-start
  4. margin-inline
  5. margin-inline-end
  6. margin-inline-start
  7. padding-block
  8. padding-block-end
  9. padding-block-start
  10. padding-inline
  11. padding-inline-end
  12. padding-inline-start
  13. scroll-behavior
  14. scroll-snap-align
  15. scroll-snap-stop
  16. scroll-snap-type

}
else if("scroll-snap-align".equalsIgnoreCase(element))
{
auxilaryVerifiers[82]=new CSSPropertyVerifier(Arrays.asList("none","start","end","center"),null,null,null,true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason for not describing this auxilaryVerifiers entry and the ones for scroll-snap-type in the static initializer together with the existing ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are lots of such cases, I think it is because if there's no use of this property in the CSS, then it does not need to initialize this entry.

}
else if("margin-inline".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("80<1,2>")));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we refer to the existing auxilaryVerifiers[36] that is used for margin (after moving that one to the static initializer) as 36<1,2> instead of adding yet another verifier?

(same for margin-block)

}
else if("margin-block-start".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("auto"),ElementInfo.VISUALMEDIA,Arrays.asList("le","pe")));
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this refer to auxilaryVerifiers[36] as 36 instead of hard-coding length | percentage?

(same for margin-block-end, similar for all the others padding/margin variants added)

@ArneBab ArneBab merged commit bf3833e into hyphanet:next Dec 1, 2024
1 check passed
@ArneBab
Copy link
Contributor

ArneBab commented Dec 1, 2024

b4d5b83 looks good, the rest is reviewed by bertm ⇒ merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants