Skip to content

Commit

Permalink
8318112: CSS percentage values are capped at 100%
Browse files Browse the repository at this point in the history
Reviewed-by: tr, prr
  • Loading branch information
prsadhuk committed Jan 17, 2024
1 parent 2063bb8 commit f70667e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,7 @@ Object parseCssValue(String value) {
case 1:
// %
lv = new LengthValue();
lv.span = Math.max(0, Math.min(1, lu.value));
lv.span = Math.max(0, lu.value);
lv.percentage = true;
break;
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -31,7 +31,7 @@

/*
* @test
* @bug 7083187 8318113
* @bug 7083187 8318113 8318112
* @summary Verifies if CSS.CSSValue attribute is same
* @run main CSSAttributeEqualityBug
*/
Expand Down Expand Up @@ -91,6 +91,7 @@ public class CSSAttributeEqualityBug {
{"margin-top: 100%", "margin-top: 50%"},

{"background-image: none", "background-image: url(image.png)"},
{"width: 100%", "width: 200 %"},
};

private static final String[][] EQUALS_WITH_SPACE = {
Expand Down

1 comment on commit f70667e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.