1
1
/*
2
2
* Copyright (c) 2007 Henri Sivonen
3
- * Copyright (c) 2007-2008 Mozilla Foundation
3
+ * Copyright (c) 2007-2017 Mozilla Foundation
4
4
*
5
5
* Permission is hereby granted, free of charge, to any person obtaining a
6
6
* copy of this software and associated documentation files (the "Software"),
34
34
import javax .xml .parsers .ParserConfigurationException ;
35
35
36
36
import nu .validator .htmlparser .common .CharacterHandler ;
37
- import nu .validator .htmlparser .common .DoctypeExpectation ;
38
37
import nu .validator .htmlparser .common .DocumentModeHandler ;
39
38
import nu .validator .htmlparser .common .Heuristics ;
40
39
import nu .validator .htmlparser .common .TokenHandler ;
@@ -122,8 +121,6 @@ private static DOMImplementation jaxpDOMImplementation() {
122
121
123
122
private DocumentModeHandler documentModeHandler = null ;
124
123
125
- private DoctypeExpectation doctypeExpectation = DoctypeExpectation .HTML ;
126
-
127
124
private boolean checkingNormalization = false ;
128
125
129
126
private boolean scriptingEnabled = false ;
@@ -140,8 +137,6 @@ private static DOMImplementation jaxpDOMImplementation() {
140
137
141
138
private XmlViolationPolicy streamabilityViolationPolicy = XmlViolationPolicy .ALLOW ;
142
139
143
- private boolean html4ModeCompatibleWithXhtml1Schemata = false ;
144
-
145
140
private boolean mappingLangToXmlLang = false ;
146
141
147
142
private XmlViolationPolicy xmlnsPolicy = XmlViolationPolicy .FATAL ;
@@ -223,14 +218,12 @@ private void lazyInit() {
223
218
this .driver .setCommentPolicy (commentPolicy );
224
219
this .driver .setContentNonXmlCharPolicy (contentNonXmlCharPolicy );
225
220
this .driver .setContentSpacePolicy (contentSpacePolicy );
226
- this .driver .setHtml4ModeCompatibleWithXhtml1Schemata (html4ModeCompatibleWithXhtml1Schemata );
227
221
this .driver .setMappingLangToXmlLang (mappingLangToXmlLang );
228
222
this .driver .setXmlnsPolicy (xmlnsPolicy );
229
223
this .driver .setHeuristics (heuristics );
230
224
for (CharacterHandler characterHandler : characterHandlers ) {
231
225
this .driver .addCharacterHandler (characterHandler );
232
226
}
233
- this .treeBuilder .setDoctypeExpectation (doctypeExpectation );
234
227
this .treeBuilder .setDocumentModeHandler (documentModeHandler );
235
228
this .treeBuilder .setScriptingEnabled (scriptingEnabled );
236
229
this .treeBuilder .setReportingDoctype (reportingDoctype );
@@ -457,29 +450,6 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
457
450
}
458
451
}
459
452
460
- /**
461
- * Returns the doctype expectation.
462
- *
463
- * @return the doctypeExpectation
464
- */
465
- public DoctypeExpectation getDoctypeExpectation () {
466
- return doctypeExpectation ;
467
- }
468
-
469
- /**
470
- * Sets the doctype expectation.
471
- *
472
- * @param doctypeExpectation
473
- * the doctypeExpectation to set
474
- * @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
475
- */
476
- public void setDoctypeExpectation (DoctypeExpectation doctypeExpectation ) {
477
- this .doctypeExpectation = doctypeExpectation ;
478
- if (treeBuilder != null ) {
479
- treeBuilder .setDoctypeExpectation (doctypeExpectation );
480
- }
481
- }
482
-
483
453
/**
484
454
* Returns the document mode handler.
485
455
*
@@ -521,19 +491,6 @@ public void setStreamabilityViolationPolicy(
521
491
driver = null ;
522
492
}
523
493
524
- /**
525
- * Whether the HTML 4 mode reports boolean attributes in a way that repeats
526
- * the name in the value.
527
- * @param html4ModeCompatibleWithXhtml1Schemata
528
- */
529
- public void setHtml4ModeCompatibleWithXhtml1Schemata (
530
- boolean html4ModeCompatibleWithXhtml1Schemata ) {
531
- this .html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata ;
532
- if (driver != null ) {
533
- driver .setHtml4ModeCompatibleWithXhtml1Schemata (html4ModeCompatibleWithXhtml1Schemata );
534
- }
535
- }
536
-
537
494
/**
538
495
* Returns the <code>Locator</code> during parse.
539
496
* @return the <code>Locator</code>
@@ -542,16 +499,6 @@ public Locator getDocumentLocator() {
542
499
return driver .getDocumentLocator ();
543
500
}
544
501
545
- /**
546
- * Whether the HTML 4 mode reports boolean attributes in a way that repeats
547
- * the name in the value.
548
- *
549
- * @return the html4ModeCompatibleWithXhtml1Schemata
550
- */
551
- public boolean isHtml4ModeCompatibleWithXhtml1Schemata () {
552
- return html4ModeCompatibleWithXhtml1Schemata ;
553
- }
554
-
555
502
/**
556
503
* Whether <code>lang</code> is mapped to <code>xml:lang</code>.
557
504
* @param mappingLangToXmlLang
0 commit comments