Skip to content

Commit

Permalink
attr() spec changed from '%' to 'percentage' type.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosame committed Feb 25, 2021
1 parent 85ad076 commit af559aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions junit/io/sf/carte/doc/dom4j/XHTMLDocumentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ public void testComputedStyleAttr() {
/*
* attr() percentage invalid value type.
*/
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin %)");
assertEquals("margin-left: attr(leftmargin %); ", elm.getOverrideStyle(null).getCssText());
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin percentage)");
assertEquals("margin-left: attr(leftmargin percentage); ", elm.getOverrideStyle(null).getCssText());
style = elm.getComputedStyle(null);
marginLeft = (CSSTypedValue) style.getPropertyCSSValue("margin-left");
// Default fallback
Expand All @@ -685,7 +685,7 @@ public void testComputedStyleAttr() {
/*
* attr() percentage invalid value type, fallback.
*/
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin %, 1.2em)");
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin percentage, 1.2em)");
style = elm.getComputedStyle(null);
marginLeft = (CSSTypedValue) style.getPropertyCSSValue("margin-left");
assertEquals(25.92f, marginLeft.getFloatValue(CSSUnit.CSS_PT), 0.01f);
Expand All @@ -697,7 +697,7 @@ public void testComputedStyleAttr() {
* attr() percentage value type.
*/
elm.setAttribute("leftmargin", "2");
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin %)");
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin percentage)");
style = elm.getComputedStyle(null);
marginLeft = (CSSTypedValue) style.getPropertyCSSValue("margin-left");
assertEquals(2f, marginLeft.getFloatValue(CSSUnit.CSS_PERCENTAGE), 0.01f);
Expand All @@ -708,7 +708,7 @@ public void testComputedStyleAttr() {
* attr() percentage value type (II).
*/
elm.setAttribute("leftmargin", "2%");
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin %)");
elm.getOverrideStyle(null).setCssText("margin-left:attr(leftmargin percentage)");
style = elm.getComputedStyle(null);
marginLeft = (CSSTypedValue) style.getPropertyCSSValue("margin-left");
assertEquals(2f, marginLeft.getFloatValue(CSSUnit.CSS_PERCENTAGE), 0.01f);
Expand Down

0 comments on commit af559aa

Please sign in to comment.