File tree 2 files changed +4
-1
lines changed
main/java/com/gargoylesoftware/css/dom
test/java/com/gargoylesoftware/css/dom
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 21
21
import com .gargoylesoftware .css .parser .CSSException ;
22
22
import com .gargoylesoftware .css .parser .CSSOMParser ;
23
23
import com .gargoylesoftware .css .util .LangUtils ;
24
+ import com .gargoylesoftware .css .util .ThrowCssExceptionErrorHandler ;
24
25
25
26
/**
26
27
* Implementation of CSSPageRule.
@@ -80,6 +81,7 @@ public String getCssText() {
80
81
public void setCssText (final String cssText ) throws DOMException {
81
82
try {
82
83
final CSSOMParser parser = new CSSOMParser ();
84
+ parser .setErrorHandler (ThrowCssExceptionErrorHandler .INSTANCE );
83
85
final AbstractCSSRuleImpl r = parser .parseRule (cssText );
84
86
85
87
// The rule must be a page rule
@@ -124,6 +126,7 @@ public String getSelectorText() {
124
126
public void setSelectorText (final String selectorText ) throws DOMException {
125
127
try {
126
128
final CSSOMParser parser = new CSSOMParser ();
129
+ parser .setErrorHandler (ThrowCssExceptionErrorHandler .INSTANCE );
127
130
final AbstractCSSRuleImpl r = parser .parseRule ("@page " + selectorText + " {}" );
128
131
129
132
// The rule must be a page rule
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public void setSelectorTextInvalid() throws Exception {
104
104
fail ("DOMException expected" );
105
105
}
106
106
catch (final DOMException e ) {
107
- assertTrue (e .getMessage ().startsWith ("The text does not represent a page rule (null) " ), e .getMessage ());
107
+ assertTrue (e .getMessage ().startsWith ("Syntax error " ), e .getMessage ());
108
108
}
109
109
assertEquals ("" , value .getSelectorText ());
110
110
assertEquals ("@page { color: blue; }" , value .getCssText ());
You can’t perform that action at this time.
0 commit comments