Skip to content

Commit e7e4016

Browse files
committed
Finalize grid track sizing algorithm
DEVSIX-8387
1 parent 5c522a0 commit e7e4016

File tree

137 files changed

+1051
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1051
-15
lines changed

src/test/java/com/itextpdf/html2pdf/css/grid/GridAreaTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public void templateAreasSwitchedPlacesTest() throws IOException, InterruptedExc
7575
}
7676

7777
@Test
78-
// TODO DEVSIX-8387
7978
public void differentRowSpanTest() throws IOException, InterruptedException {
8079
runTest("differentRowSpanTest");
8180
}
@@ -91,7 +90,6 @@ public void differentRowSpanOnSplitTest() throws IOException, InterruptedExcepti
9190
}
9291

9392
@Test
94-
// TODO DEVSIX-8387
9593
public void differentRowSpanOnSplitTest2() throws IOException, InterruptedException {
9694
runTest("differentRowSpanOnSplitTest2");
9795
}

src/test/java/com/itextpdf/html2pdf/css/grid/GridRelativeValuesTest.java

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ This file is part of the iText (R) project.
2424

2525
import com.itextpdf.html2pdf.ConverterProperties;
2626
import com.itextpdf.html2pdf.ExtendedHtmlConversionITextTest;
27+
import com.itextpdf.layout.exceptions.LayoutExceptionMessageConstant;
28+
import com.itextpdf.test.annotations.LogMessage;
29+
import com.itextpdf.test.annotations.LogMessages;
2730

2831
import java.io.IOException;
2932
import org.junit.jupiter.api.BeforeAll;
@@ -265,6 +268,86 @@ public void rowAxis7Test() throws IOException, InterruptedException {
265268
runTest("rowAxis7");
266269
}
267270

271+
@Test
272+
@LogMessages(messages = {
273+
@LogMessage(messageTemplate = LayoutExceptionMessageConstant.GRID_AUTO_REPEAT_CANNOT_BE_COMBINED_WITH_INDEFINITE_SIZES, count = 2)
274+
})
275+
public void minmaxAutoRepeat1Test() throws IOException, InterruptedException {
276+
runTest("minmaxAutoRepeat1");
277+
}
278+
279+
@Test
280+
@LogMessages(messages = {
281+
@LogMessage(messageTemplate = LayoutExceptionMessageConstant.GRID_AUTO_REPEAT_CANNOT_BE_COMBINED_WITH_INDEFINITE_SIZES, count = 2)
282+
})
283+
public void minmaxAutoRepeat2Test() throws IOException, InterruptedException {
284+
runTest("minmaxAutoRepeat2");
285+
}
286+
287+
@Test
288+
public void minmaxFitContent1Test() throws IOException, InterruptedException {
289+
runTest("minmaxFitContent1");
290+
}
291+
292+
@Test
293+
public void minmaxFitContent2Test() throws IOException, InterruptedException {
294+
runTest("minmaxFitContent2");
295+
}
296+
297+
@Test
298+
public void minmaxFitContentAutoRepeat1Test() throws IOException, InterruptedException {
299+
runTest("minmaxFitContentAutoRepeat1");
300+
}
301+
302+
@Test
303+
@LogMessages(messages = {
304+
@LogMessage(messageTemplate = LayoutExceptionMessageConstant.GRID_AUTO_REPEAT_CANNOT_BE_COMBINED_WITH_INDEFINITE_SIZES)
305+
})
306+
public void minmaxFitContentAutoRepeat2Test() throws IOException, InterruptedException {
307+
runTest("minmaxFitContentAutoRepeat2");
308+
}
309+
310+
@Test
311+
public void minmaxWithBothAxisSpan1Test() throws IOException, InterruptedException {
312+
runTest("minmaxWithBothAxisSpan1");
313+
}
314+
315+
@Test
316+
public void minmaxWithBothAxisSpan2Test() throws IOException, InterruptedException {
317+
runTest("minmaxWithBothAxisSpan2");
318+
}
319+
320+
@Test
321+
public void minmaxWithBothAxisSpan3Test() throws IOException, InterruptedException {
322+
runTest("minmaxWithBothAxisSpan3");
323+
}
324+
325+
@Test
326+
public void minmaxWithContentAndFrTest() throws IOException, InterruptedException {
327+
runTest("minmaxWithContentAndFr");
328+
}
329+
330+
@Test
331+
public void minmaxWithSpan1Test() throws IOException, InterruptedException {
332+
runTest("minmaxWithSpan1");
333+
}
334+
335+
@Test
336+
public void minmaxWithSpan2Test() throws IOException, InterruptedException {
337+
runTest("minmaxWithSpan2");
338+
}
339+
340+
@Test
341+
public void minmaxWithSpan3Test() throws IOException, InterruptedException {
342+
runTest("minmaxWithSpan3");
343+
}
344+
345+
@Test
346+
public void minmaxWithSpan4Test() throws IOException, InterruptedException {
347+
runTest("minmaxWithSpan4");
348+
}
349+
350+
268351
private void runTest(String testName) throws IOException, InterruptedException {
269352
convertToPdfAndCompare(testName, SOURCE_FOLDER, DESTINATION_FOLDER, false,
270353
new ConverterProperties().setBaseUri(SOURCE_FOLDER).setCssGridEnabled(true));

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplateCombinedTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public void templateCombinedMinMaxTest() throws IOException, InterruptedExceptio
6666
}
6767

6868
@Test
69+
// TODO DEVSIX-8418 seems margins\paddings don't take into account correctly
6970
public void templateCombinedMixedTest() throws IOException, InterruptedException {
7071
runTest("template-combined-mixed");
7172
}

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplateNestedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void templateNestedTableTest() throws IOException, InterruptedException {
102102
}
103103

104104
@LogMessages(messages = @LogMessage(
105-
messageTemplate = IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH, count = 3))
105+
messageTemplate = IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH, count = 4))
106106
@Test
107107
public void templateNestedTableNestedGridTest() throws IOException, InterruptedException {
108108
runTest("grid-nested-table-nested-grid");
@@ -119,7 +119,7 @@ public void templateNested2LevelsWithAreasTest() throws IOException, Interrupted
119119
}
120120

121121
@LogMessages(messages = {
122-
@LogMessage(messageTemplate = IoLogMessageConstant.CLIP_ELEMENT, count = 3)
122+
@LogMessage(messageTemplate = IoLogMessageConstant.CLIP_ELEMENT, count = 4)
123123
})
124124
@Test
125125
public void templateNested3LevelsFormsTest() throws IOException, InterruptedException {

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplateRowTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public void templateRowFitContentAutoTest() throws IOException, InterruptedExcep
7575
runTest("template-rows-fit-content-auto");
7676
}
7777

78+
@Test
79+
public void rowFitContentPercentTest() throws IOException, InterruptedException {
80+
runTest("row-fit-content-percent");
81+
}
82+
7883
@Test
7984
public void templateRowFrTest() throws IOException, InterruptedException {
8085
runTest("template-rows-fr");

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplatesTest.java

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public void basicColumnFewDivs2Test() throws IOException, InterruptedException {
6666
}
6767

6868
@Test
69-
// TODO DEVSIX-8330
7069
// TODO DEVSIX-8331
7170
public void basicColumnMultiPageTest() throws IOException, InterruptedException {
7271
runTest("basicColumnMultiPageTest");
@@ -157,7 +156,6 @@ public void basicColumnRowStartEnd5Test() throws IOException, InterruptedExcepti
157156
runTest("basicColumnRowStartEnd5Test");
158157
}
159158

160-
//TODO DEVSIX-8325 null rows/cols not terminated, causes error in layout
161159
@Test
162160
public void basicColumnRowStartEnd6Test() throws IOException, InterruptedException {
163161
runTest("basicColumnRowStartEnd6Test");
@@ -355,7 +353,6 @@ public void percentageTemplateHeightWithFixedHeightTest() throws IOException, In
355353
runTest("percentageTemplateHeightWithFixedHeightTest");
356354
}
357355

358-
//TODO DEVSIX-8387
359356
@Test
360357
public void percentageFitContentWithFrTest() throws IOException, InterruptedException {
361358
runTest("percentageFitContentWithFrTest");
@@ -413,6 +410,16 @@ public void minMaxAutoFillTest() throws IOException, InterruptedException {
413410
runTest("minMaxAutoFillTest");
414411
}
415412

413+
@Test
414+
public void minMaxAutoFillWithHeightTest() throws IOException, InterruptedException {
415+
runTest("minMaxAutoFillWithHeightTest");
416+
}
417+
418+
@Test
419+
public void minMaxAutoFillWithMaxHeightTest() throws IOException, InterruptedException {
420+
runTest("minMaxAutoFillWithMaxHeightTest");
421+
}
422+
416423
@Test
417424
public void mixedRepeatsTest() throws IOException, InterruptedException {
418425
runTest("mixedRepeatsTest");
@@ -443,12 +450,24 @@ public void autoFillWithDefiniteMinMaxTest() throws IOException, InterruptedExce
443450
runTest("autoFillWithDefiniteMinMaxTest");
444451
}
445452

446-
//TODO DEVSIX-8387
447453
@Test
448454
public void autoFillWithIndefiniteMinMaxTest() throws IOException, InterruptedException {
449455
runTest("autoFillWithIndefiniteMinMaxTest");
450456
}
451457

458+
@Test
459+
@LogMessages(messages = {
460+
@LogMessage(messageTemplate = LayoutExceptionMessageConstant.FLEXIBLE_ARENT_ALLOWED_AS_MINIMUM_IN_MINMAX)
461+
})
462+
public void minmaxWithMinFrTest() throws IOException, InterruptedException {
463+
runTest("minmaxWithMinFrTest");
464+
}
465+
466+
@Test
467+
public void minmaxWithMaxFrTest() throws IOException, InterruptedException {
468+
runTest("minmaxWithMaxFrTest");
469+
}
470+
452471
@Test
453472
public void minMaxWithIndefiniteMinTest() throws IOException, InterruptedException {
454473
runTest("minMaxWithIndefiniteMinTest");
@@ -459,6 +478,36 @@ public void pointZeroFlexTest() throws IOException, InterruptedException {
459478
runTest("pointZeroFlexTest");
460479
}
461480

481+
@Test
482+
public void pointZeroFlexTest2() throws IOException, InterruptedException {
483+
runTest("pointZeroFlexTest2");
484+
}
485+
486+
@Test
487+
public void pointZeroFlexTest3() throws IOException, InterruptedException {
488+
runTest("pointZeroFlexTest3");
489+
}
490+
491+
@Test
492+
public void pointZeroFlexTest4() throws IOException, InterruptedException {
493+
runTest("pointZeroFlexTest4");
494+
}
495+
496+
@Test
497+
public void pointZeroFlexTest5() throws IOException, InterruptedException {
498+
runTest("pointZeroFlexTest5");
499+
}
500+
501+
@Test
502+
public void pointZeroFlexTest6() throws IOException, InterruptedException {
503+
runTest("pointZeroFlexTest6");
504+
}
505+
506+
@Test
507+
public void spanOnlyFrTest() throws IOException, InterruptedException {
508+
runTest("spanOnlyFrTest");
509+
}
510+
462511
//TODO DEVSIX-8418
463512
@Test
464513
public void autoFitOnIntrinsicAreaWithLargeBorderTest() throws IOException, InterruptedException {
@@ -495,7 +544,6 @@ public void autoFillRepeatWithFlexMinMaxTest() throws IOException, InterruptedEx
495544
runTest("autoFillRepeatWithFlexMinMaxTest");
496545
}
497546

498-
//TODO: DEVSIX-8387
499547
@Test
500548
public void autoFitRepeatWithFlexMinMaxTest() throws IOException, InterruptedException {
501549
runTest("autoFitRepeatWithFlexMinMaxTest");

src/test/java/com/itextpdf/html2pdf/css/w3c/css_grid/grid_items/GridItemFlexContainer001Test.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ This file is part of the iText (R) project.
2727
import com.itextpdf.test.annotations.LogMessage;
2828
import com.itextpdf.test.annotations.LogMessages;
2929

30-
//TODO DEVSIX-8387: Support minmax
3130
@LogMessages(messages = {
3231
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.NO_WORKER_FOUND_FOR_TAG, count = 4)})
3332
public class GridItemFlexContainer001Test extends W3CCssGridTest {

src/test/java/com/itextpdf/html2pdf/css/w3c/css_grid/grid_items/GridItemOverflowAutoMaxHeightPercentageTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ This file is part of the iText (R) project.
2525
import com.itextpdf.html2pdf.css.w3c.css_grid.W3CCssGridTest;
2626

2727
//TODO DEVSIX-8358: Support short-hands
28-
//TODO DEVSIX-8387: Support minmax
2928
public class GridItemOverflowAutoMaxHeightPercentageTest extends W3CCssGridTest {
3029
@Override
3130
protected String getHtmlFileName() {

src/test/java/com/itextpdf/html2pdf/css/w3c/css_grid/grid_items/TableWithInfiniteMaxIntrinsicWidthTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This file is part of the iText (R) project.
2828
import com.itextpdf.test.annotations.LogMessages;
2929

3030
@LogMessages(messages = {
31-
@LogMessage(messageTemplate = IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH, count = 5)})
31+
@LogMessage(messageTemplate = IoLogMessageConstant.TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH, count = 9)})
3232
public class TableWithInfiniteMaxIntrinsicWidthTest extends W3CCssGridTest {
3333
@Override
3434
protected String getHtmlFileName() {
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)