File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
src/main/java/com/gargoylesoftware/css/dom Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 4
4
<modelVersion >4.0.0</modelVersion >
5
5
<groupId >net.sourceforge.htmlunit</groupId >
6
6
<artifactId >htmlunit-cssparser</artifactId >
7
- <version >1.9.0 </version >
7
+ <version >1.10.0-SNAPSHOT </version >
8
8
<name >HtmlUnit CSS Parser</name >
9
9
<packaging >jar</packaging >
10
10
<description >CSS parser for HtmlUnit.</description >
Original file line number Diff line number Diff line change 20
20
21
21
import org .w3c .dom .DOMException ;
22
22
23
+ import com .gargoylesoftware .css .parser .CSSErrorHandler ;
23
24
import com .gargoylesoftware .css .parser .CSSOMParser ;
24
25
import com .gargoylesoftware .css .util .LangUtils ;
25
26
import com .gargoylesoftware .css .util .ThrowCssExceptionErrorHandler ;
@@ -76,9 +77,19 @@ public String getCssText() {
76
77
* @throws DOMException in case of error
77
78
*/
78
79
public void setCssText (final String cssText ) throws DOMException {
80
+ setCssText (cssText , ThrowCssExceptionErrorHandler .INSTANCE );
81
+ }
82
+
83
+ /**
84
+ * Sets the css text.
85
+ * @param cssText the new css text
86
+ * @param cssErrorHandler the CSSErrorHandler to be used
87
+ * @throws DOMException in case of error
88
+ */
89
+ public void setCssText (final String cssText , final CSSErrorHandler cssErrorHandler ) throws DOMException {
79
90
try {
80
91
final CSSOMParser parser = new CSSOMParser ();
81
- parser .setErrorHandler (ThrowCssExceptionErrorHandler . INSTANCE );
92
+ parser .setErrorHandler (cssErrorHandler );
82
93
properties_ .clear ();
83
94
parser .parseStyleDeclaration (this , cssText );
84
95
}
@@ -90,6 +101,7 @@ public void setCssText(final String cssText) throws DOMException {
90
101
}
91
102
}
92
103
104
+
93
105
/**
94
106
* @param propertyName the property name
95
107
* @return the property value
You can’t perform that action at this time.
0 commit comments