Skip to content

Commit 1bae7f7

Browse files
committed
fix: consider HTML form elements as scripted content
Fixes #1282
1 parent 312ef5f commit 1bae7f7

File tree

12 files changed

+68
-4
lines changed

12 files changed

+68
-4
lines changed

src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ else if (EpubConstants.HtmlNamespaceUri.equals(e.getNamespace()) && name.equals(
324324
{
325325
processMeta();
326326
}
327+
else if (name.equals("form"))
328+
{
329+
requiredProperties.add(ITEM_PROPERTIES.SCRIPTED);
330+
}
327331
else if (name.equals("link"))
328332
{
329333
processLink();
@@ -538,7 +542,8 @@ protected void processVideo()
538542
protected void processHyperlink(URL href)
539543
{
540544
super.processHyperlink(href);
541-
if ("data".equals(href.scheme())) {
545+
if ("data".equals(href.scheme()))
546+
{
542547
report.message(MessageId.RSC_029, location());
543548
return;
544549
}
@@ -912,7 +917,7 @@ protected void checkOverlaysStyles()
912917
if (context.opfItem.isPresent() && context.opfItem.get().getMediaOverlay() != null
913918
&& (context.featureReport.hasFeature(FeatureEnum.MEDIA_OVERLAYS_ACTIVE_CLASS)
914919
|| context.featureReport.hasFeature(FeatureEnum.MEDIA_OVERLAYS_PLAYBACK_ACTIVE_CLASS))
915-
&& !this.hasCSS)
920+
&& !this.hasCSS)
916921
{
917922
report.message(MessageId.CSS_030, location());
918923
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Minimal EPUB</title>
6+
</head>
7+
<body>
8+
<h1>Loomings</h1>
9+
<p>Call me Ishmael.</p>
10+
<form action="https://example.org" method="get">
11+
<label for="email">Enter your email: </label>
12+
<input type="email" name="email" id="email" required="" />
13+
<input type="submit" value="Subscribe!" />
14+
</form>
15+
</body>
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en" lang="en">
3+
<head>
4+
<meta charset="utf-8"/>
5+
<title>Minimal Nav</title>
6+
</head>
7+
<body>
8+
<nav epub:type="toc">
9+
<ol>
10+
<li><a href="content_001.xhtml">content 001</a></li>
11+
</ol>
12+
</nav>
13+
</body>
14+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q">
3+
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
4+
<dc:title id="title">Minimal EPUB 3.0</dc:title>
5+
<dc:language>en</dc:language>
6+
<dc:identifier id="q">NOID</dc:identifier>
7+
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta>
8+
</metadata>
9+
<manifest>
10+
<item id="content_001" href="content_001.xhtml" media-type="application/xhtml+xml"/>
11+
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
12+
</manifest>
13+
<spine>
14+
<itemref idref="content_001" />
15+
</spine>
16+
</package>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
3+
<rootfiles>
4+
<rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
5+
</rootfiles>
6+
</container>

0 commit comments

Comments
 (0)