Skip to content

Commit 1993d25

Browse files
committed
Add support for object-fit and object-position
1 parent e365a61 commit 1993d25

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/css/Properties.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ var Properties = {
394394
"nav-up" : 1,
395395

396396
//O
397+
"object-fit" : "fill | contain | cover | none | scale-down",
398+
"object-position" : "<bg-position>",
397399
"opacity" : "<number> | inherit",
398400
"order" : "<integer>",
399401
"-webkit-order" : "<integer>",

tests/css/Validation.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,52 @@
800800
}
801801
}));
802802

803+
suite.add(new ValidationTestCase({
804+
property: "object-fit",
805+
806+
valid: [
807+
"fill",
808+
"contain",
809+
"cover",
810+
"none",
811+
"scale-down"
812+
],
813+
814+
invalid: {
815+
"foo" : "Expected (fill | contain | cover | none | scale-down) but found 'foo'.",
816+
"inherit" : "Expected (fill | contain | cover | none | scale-down) but found 'inherit'."
817+
}
818+
}));
819+
820+
suite.add(new ValidationTestCase({
821+
property: "object-position",
822+
823+
valid: [
824+
"top",
825+
"bottom",
826+
"center",
827+
"100%",
828+
"left center",
829+
"bottom left",
830+
"left 10px",
831+
"center bottom",
832+
"10% top",
833+
"left 10px bottom",
834+
"right top 5%",
835+
"top 3em center",
836+
"center top 3em",
837+
"top 3em right 10%",
838+
],
839+
840+
invalid: {
841+
"foo" : "Expected (<bg-position>) but found 'foo'.",
842+
"10% left" : "Expected end of value but found 'left'.",
843+
"left center right" : "Expected end of value but found 'center'.",
844+
"center 3em right 10%": "Expected end of value but found '3em'.",
845+
"top, bottom" : "Expected end of value but found ','."
846+
}
847+
}));
848+
803849
suite.add(new ValidationTestCase({
804850
property: "opacity",
805851

0 commit comments

Comments
 (0)