Skip to content

Commit

Permalink
Adding support for attribute values with pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
atiqsayyed committed Oct 23, 2015
1 parent 9788e73 commit 3966c10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.metadata
*.swp
*.iml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ protected final static String normalizeAttributeName(final String name) {
public void setAttribute(final String name, final String value) throws DOMException {
// Convert null to "null" : String.
// This is how Firefox behaves and is also consistent with DOM 3
final String valueNonNull = value == null ? "null" : value;
String attributeValue = null;
if(value.contains("px")){
attributeValue = value.replace("px", "");
}else{
attributeValue=value;
}
final String valueNonNull = value == null ? "null" : attributeValue;
changeAttribute(name, valueNonNull);
}

Expand Down

0 comments on commit 3966c10

Please sign in to comment.