File tree Expand file tree Collapse file tree
src/main/java/com/gargoylesoftware/css/dom Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 <modelVersion >4.0.0</modelVersion >
55 <groupId >net.sourceforge.htmlunit</groupId >
66 <artifactId >htmlunit-cssparser</artifactId >
7- <version >1.9.0 </version >
7+ <version >1.10.0-SNAPSHOT </version >
88 <name >HtmlUnit CSS Parser</name >
99 <packaging >jar</packaging >
1010 <description >CSS parser for HtmlUnit.</description >
Original file line number Diff line number Diff line change 2020
2121import org .w3c .dom .DOMException ;
2222
23+ import com .gargoylesoftware .css .parser .CSSErrorHandler ;
2324import com .gargoylesoftware .css .parser .CSSOMParser ;
2425import com .gargoylesoftware .css .util .LangUtils ;
2526import com .gargoylesoftware .css .util .ThrowCssExceptionErrorHandler ;
@@ -76,9 +77,19 @@ public String getCssText() {
7677 * @throws DOMException in case of error
7778 */
7879 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 {
7990 try {
8091 final CSSOMParser parser = new CSSOMParser ();
81- parser .setErrorHandler (ThrowCssExceptionErrorHandler . INSTANCE );
92+ parser .setErrorHandler (cssErrorHandler );
8293 properties_ .clear ();
8394 parser .parseStyleDeclaration (this , cssText );
8495 }
@@ -90,6 +101,7 @@ public void setCssText(final String cssText) throws DOMException {
90101 }
91102 }
92103
104+
93105 /**
94106 * @param propertyName the property name
95107 * @return the property value
You can’t perform that action at this time.
0 commit comments