forked from nahsra/antisamy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add(nahsragh-552): support for @media rule
- Loading branch information
1 parent
f94866b
commit 8e4f547
Showing
10 changed files
with
846 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/org/owasp/validator/css/media/CssMediaFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.owasp.validator.css.media; | ||
|
||
import org.w3c.css.sac.LexicalUnit; | ||
|
||
public class CssMediaFeature { | ||
|
||
private final String name; | ||
private final LexicalUnit expression; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param name Feature-name | ||
* @param expression expression, may be null | ||
*/ | ||
public CssMediaFeature(String name, LexicalUnit expression) { | ||
this.name = name; | ||
this.expression = expression; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public LexicalUnit getExpression() { | ||
return expression; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/org/owasp/validator/css/media/CssMediaQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.owasp.validator.css.media; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class CssMediaQuery { | ||
|
||
private CssMediaQueryLogicalOperator logicalOperator; | ||
private CssMediaType mediaType; | ||
private final List<CssMediaFeature> mediaFeatures = new ArrayList<>(); | ||
|
||
public CssMediaQueryLogicalOperator getLogicalOperator() { | ||
return logicalOperator; | ||
} | ||
|
||
public void setLogicalOperator(CssMediaQueryLogicalOperator logicalOperator) { | ||
this.logicalOperator = logicalOperator; | ||
} | ||
|
||
public CssMediaType getMediaType() { | ||
return mediaType; | ||
} | ||
|
||
public void setMediaType(CssMediaType mediaType) { | ||
this.mediaType = mediaType; | ||
} | ||
|
||
public void addMediaFeature(CssMediaFeature mediaFeature) { | ||
mediaFeatures.add(mediaFeature); | ||
} | ||
|
||
public List<CssMediaFeature> getMediaFeatures() { | ||
return Collections.unmodifiableList(mediaFeatures); | ||
} | ||
} |
Oops, something went wrong.