Skip to content

Commit ab4a9fb

Browse files
ars18wrwiText-CI
authored andcommitted
Implement disabled pseudo class selector. Add some new tests.
DEVSIX-1973 Autoported commit. Original commit hash: [bf7ba45d]
1 parent 5cfe736 commit ab4a9fb

File tree

8 files changed

+61
-1
lines changed

8 files changed

+61
-1
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/InputTest.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,27 @@ public virtual void PlaceholderTest04() {
239239
RunTest("placeholderTest04");
240240
}
241241

242+
/// <exception cref="System.IO.IOException"/>
243+
/// <exception cref="System.Exception"/>
244+
[NUnit.Framework.Test]
245+
public virtual void InputDisabled01AcroTest() {
246+
// TODO DEVSIX_1973
247+
String htmlPath = sourceFolder + "inputDisabled01Test.html";
248+
String outPdfPath = destinationFolder + "inputDisabled01AcroTest.pdf";
249+
String cmpPdfPath = sourceFolder + "cmp_" + "inputDisabled01AcroTest.pdf";
250+
HtmlConverter.ConvertToPdf(new FileInfo(htmlPath), new FileInfo(outPdfPath), new ConverterProperties().SetCreateAcroForm
251+
(true));
252+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdfPath, cmpPdfPath, destinationFolder
253+
));
254+
}
255+
256+
/// <exception cref="System.IO.IOException"/>
257+
/// <exception cref="System.Exception"/>
258+
[NUnit.Framework.Test]
259+
public virtual void InputDisabled01Test() {
260+
RunTest("inputDisabled01Test");
261+
}
262+
242263
/// <exception cref="System.IO.IOException"/>
243264
/// <exception cref="System.Exception"/>
244265
[NUnit.Framework.Test]

itext.tests/itext.html2pdf.tests/resources/itext/html2pdf/css/CssStyleSheetParserTest/cmp_default.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ dl {
5757
multicol {
5858
margin: 1em 0
5959
}
60+
input:disabled {
61+
opacity: 0.4;
62+
background-color: rgb(235,235,228);
63+
color: rgb(84,84,84)
64+
}
65+
textarea:disabled {
66+
opacity: 0.4;
67+
background-color: rgb(235,235,228);
68+
color: rgb(84,84,84)
69+
}
6070
dd {
6171
margin-left: 40px;
6272
margin-bottom: 0;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
input {
6+
color: red;
7+
}
8+
</style>
9+
</head>
10+
<body>
11+
12+
Disabled: <input type="text" disabled name="FirstD" value="Mickey"><br>
13+
Enabled: <input type="text" name="FirstE" value="Mickey"><br>
14+
Disabled: <input type="checkbox" disabled name="FirstD" value="Mickey"><br>
15+
Enabled: <input type="checkbox" name="FirstE" value="Mickey"><br>
16+
Disabled: <input type="checkbox" disabled checked name="FirstDC" value="Mickey"><br>
17+
Enabled: <input type="checkbox" checked name="FirstEC" value="Mickey"><br>
18+
Disabled: <input disabled name="FirstD" value="Mickey"><br>
19+
Enabled: <input name="FirstE" value="Mickey"><br>
20+
21+
</body>
22+
</html>

itext/itext.html2pdf/resources/default.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ body {
3636
p, dl, multicol {
3737
margin: 1em 0;
3838
}
39+
40+
input:disabled, textarea:disabled {
41+
opacity: 0.4;
42+
background-color: rgb(235, 235, 228);
43+
color: rgb(84, 84, 84);
44+
}
45+
3946
dd {
4047
margin-left: 40px;
4148
margin-bottom: 0;

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ad424bc6c86cb38f3ec89e8b17633545b8890204
1+
bf7ba45d4099453af07af4b73a3c31e782ad2554

0 commit comments

Comments
 (0)