# HG changeset patch # Parent 13480a73e20600238b204b12b1515871bdb9a551 # User Mats Palmgren Bug 907396 - Tests for CSS 'display:contents'. diff --git a/layout/reftests/css-display/display-contents-495385-2d-ref.html b/layout/reftests/css-display/display-contents-495385-2d-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-495385-2d-ref.html @@ -0,0 +1,23 @@ + + + + + + + +
Hello Kitty
+
Hello Kitty
+
Hello Kitty
+
Hello Kitty
+
Hello Kitty
+
Hello Kitty
+
Hello Kitty
+
Hello Kitty
+ + diff --git a/layout/reftests/css-display/display-contents-495385-2d.html b/layout/reftests/css-display/display-contents-495385-2d.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-495385-2d.html @@ -0,0 +1,52 @@ + + + + + + + CSS Test: CSS display:contents; with ::after/::before + + + + + + +
Kitty
+
Hello
+
Kitty
+
Hello
+
Kitty
+
Hello
+
Hello
+
Kitty
+ + diff --git a/layout/reftests/css-display/display-contents-acid-dyn-1.html b/layout/reftests/css-display/display-contents-acid-dyn-1.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-acid-dyn-1.html @@ -0,0 +1,49 @@ + + + + + + CSS Test: CSS display:contents + + + + + + + + + + + diff --git a/layout/reftests/css-display/display-contents-acid-dyn-2.html b/layout/reftests/css-display/display-contents-acid-dyn-2.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-acid-dyn-2.html @@ -0,0 +1,49 @@ + + + + + + CSS Test: CSS display:contents + + + + + + + + + + + diff --git a/layout/reftests/css-display/display-contents-acid-dyn-3.html b/layout/reftests/css-display/display-contents-acid-dyn-3.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-acid-dyn-3.html @@ -0,0 +1,50 @@ + + + + + + CSS Test: CSS display:contents + + + + + + + + + + + diff --git a/layout/reftests/css-display/display-contents-acid-ref.html b/layout/reftests/css-display/display-contents-acid-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-acid-ref.html @@ -0,0 +1,184 @@ + + + + + + CSS Test: CSS display:contents + + + + + +
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
7b
+
8
+
9
abc
+
10
+ +
+
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
7b
+
8
+
9
abc
+
10
+
+ +
+0  +
+
y
+
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
8
+
9
a
+b +
c
+
10
+
+ +
+
+
+
y
+
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
8
+
9
a
+b +
c
+
10
+
+ + +
+0 +
+
+0 +
1
+2 +
+
+0
1
2 +
+
+0
1
2 +
+
+
0
1
2
+
+
+
0
+
1
+
2
+
+ + + +
+
11
+
2
+
3
+
+ +
+
11
+
2
+
3
+
+ +LegendLegend +
+x
float:left
+y
position:absolute
+ + + +
Legendfieldset
+ + + + + diff --git a/layout/reftests/css-display/display-contents-acid.html b/layout/reftests/css-display/display-contents-acid.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-acid.html @@ -0,0 +1,191 @@ + + + + + + CSS Test: CSS display:contents + + + + + + +
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
7b
+
8
+
9
abc
+
10
+ +
+
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
7b
+
8
+
9
abc
+
10
+
+ +
+0 +
x
+
y
+
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
8
+
9
abc
+
10
+
+ +
+0 +
x
+
y
+
11
+
2a
2
bb
+
3
+
4
+
5a
+
5b
+
6
+
7a
+
8
+
9
abc
+
10
+
+ +
+0 +
+
+0 +
1
+2 +
+
+0 +
1
+2 +
+
+0 +
1
+2 +
+
+
0
+
1
+
2
+
+
+
0
+
1
+
2
+
+ + + +
+
11
+
2
+
3
+
+ +
+
+
11
+
2
+
3
+
+
+ +
+
+ +LegendLegend +
+x
float:left
+y
position:absolute
+ + + +
Legendfieldset
+ + + + + diff --git a/layout/reftests/css-display/display-contents-generated-content-2.html b/layout/reftests/css-display/display-contents-generated-content-2.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-generated-content-2.html @@ -0,0 +1,240 @@ + + + + + + CSS Test: CSS display:contents; generated content + + + + + + + +
A a
+
t1
+
t2
+
1B b2
+
1C c2
+
1D d2
+
1B b2
+
1C c2
+
1D d2
+ +
+
span
+
t3
+
t4
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ + + diff --git a/layout/reftests/css-display/display-contents-generated-content-ref.html b/layout/reftests/css-display/display-contents-generated-content-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-generated-content-ref.html @@ -0,0 +1,123 @@ + + + + + + CSS Test: CSS display:contents; generated content + + + + + + +
A a
+
t1
+
+
1B b2
+
1C c2
+
1D d2
+
1B b2
+
12
+
1D d2
+ +
+
span
+
t3
+
+
1span2
+
1span2
+
1span2
+
12
+
1span2
+
12
+
1span2
+
12
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+ +
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+ +
+ + + diff --git a/layout/reftests/css-display/display-contents-generated-content.html b/layout/reftests/css-display/display-contents-generated-content.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-generated-content.html @@ -0,0 +1,211 @@ + + + + + + CSS Test: CSS display:contents; generated content + + + + + + + +
A a
+
t1
+
t2
+
1B b2
+
1C c2
+
1D d2
+
1B b2
+
1C c2
+
1D d2
+ +
+
span
+
t3
+
t4
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ +
+
span
+
1span2
+
1span2
+
1span2
+
+ + + diff --git a/layout/reftests/css-display/display-contents-shadow-dom-1-ref.html b/layout/reftests/css-display/display-contents-shadow-dom-1-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-shadow-dom-1-ref.html @@ -0,0 +1,52 @@ + + + + + CSS Test: CSS display:contents; in Shadow DOM + + + + +
X 1 c
+
a 2 c
+
a 3 Y
+
X 4 Y
+
a 5 Y
+
X 6 c
+
a 7 c
+
a 8 Y
+
X 9 Y
+
a A Y
+
a 1 2 B
+
A a 1 2 c B
+
A a 1 a 2 ca 3 c B
+
A a 1 c a 2 c B
+
X a 1 c a 2 c B
+
1a 2 c
+
a 1 c2
+
Abc
+
Abc
+
b cd
+
a b
+
OneTwo
+
OneTwo
+
OneTwo
+
OneTwo
+ OneTwoThree + R +
+ V + W + X + + + diff --git a/layout/reftests/css-display/display-contents-shadow-dom-1.html b/layout/reftests/css-display/display-contents-shadow-dom-1.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-shadow-dom-1.html @@ -0,0 +1,236 @@ + + + + + CSS Test: CSS display:contents; in Shadow DOM + + + + + +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
Three + +
S
+
T
+
U
+
V
+
W
+ X + + + + + diff --git a/layout/reftests/css-display/display-contents-style-inheritance-1-dom-mutations.html b/layout/reftests/css-display/display-contents-style-inheritance-1-dom-mutations.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-style-inheritance-1-dom-mutations.html @@ -0,0 +1,157 @@ + + + + + + CSS Test: CSS display:contents; style inheritance, DOM mutations + + + + + + + +
ee
+
ee
x
+
ee
+
ee
x
+
+
bord
+
bord
+
bord
+
+
+ +
+
+
+
+
+
+
+ +
+green +
green
+
green
+
+
green
+
+
+
+ + + diff --git a/layout/reftests/css-display/display-contents-style-inheritance-1-ref.html b/layout/reftests/css-display/display-contents-style-inheritance-1-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-style-inheritance-1-ref.html @@ -0,0 +1,42 @@ + + + + + + CSS Test: CSS display:contents; style inheritance + + + + +
green
+
green
x
+
green
+
green
x
+
+
no border
+
no border
+
1px green left border
+
2px green left border
+
+ +
green
+
green
+
+
1px green left border
+
1px green left border
+
2px green left border
+
+ +
This text should be green green green green greengreen green
+ + + diff --git a/layout/reftests/css-display/display-contents-style-inheritance-1-stylechange.html b/layout/reftests/css-display/display-contents-style-inheritance-1-stylechange.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-style-inheritance-1-stylechange.html @@ -0,0 +1,67 @@ + + + + + + CSS Test: CSS display:contents; style inheritance, style changes + + + + + + +
green
+
green
x
+
green
+
green
x
+
+
no border
+
no border
+
1px green left border
+
2px green left border
+
+ +
green
+
green
+
+
1px green left border
+
1px green left border
+
2px green left border
+
+ +This text should be green +
green
+
green
+
green
+
+
green
+
green
+
+
green
+ + + diff --git a/layout/reftests/css-display/display-contents-style-inheritance-1.html b/layout/reftests/css-display/display-contents-style-inheritance-1.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-style-inheritance-1.html @@ -0,0 +1,51 @@ + + + + + + CSS Test: CSS display:contents; style inheritance + + + + + +
green
+
green
x
+
green
+
green
x
+
+
no border
+
no border
+
1px green left border
+
2px green left border
+
+ +
green
+
green
+
+
1px green left border
+
1px green left border
+
2px green left border
+
+ +
This text should be green
+
green
+
green
+
green
+
+
green
+
green
+
+
green
+ + + diff --git a/layout/reftests/css-display/display-contents-tables-2.xhtml b/layout/reftests/css-display/display-contents-tables-2.xhtml new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-tables-2.xhtml @@ -0,0 +1,18 @@ + + + + + CSS Test: CSS display:contents; tables + + + + +
green
pink diff --git a/layout/reftests/css-display/display-contents-tables-3-ref.xhtml b/layout/reftests/css-display/display-contents-tables-3-ref.xhtml new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-tables-3-ref.xhtml @@ -0,0 +1,16 @@ + + + + + CSS Test: CSS display:contents; tables + + + +
green
diff --git a/layout/reftests/css-display/display-contents-tables-3.xhtml b/layout/reftests/css-display/display-contents-tables-3.xhtml new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-tables-3.xhtml @@ -0,0 +1,17 @@ + + + + + CSS Test: CSS display:contents; tables + + + + +
green
diff --git a/layout/reftests/css-display/display-contents-tables-ref.xhtml b/layout/reftests/css-display/display-contents-tables-ref.xhtml new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-tables-ref.xhtml @@ -0,0 +1,16 @@ + + + + + CSS Test: CSS display:contents; tables + + + +greenpink diff --git a/layout/reftests/css-display/display-contents-tables.xhtml b/layout/reftests/css-display/display-contents-tables.xhtml new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-tables.xhtml @@ -0,0 +1,17 @@ + + + + + CSS Test: CSS display:contents; tables + + + + +
green
pink
diff --git a/layout/reftests/css-display/display-contents-visibility-hidden-2.html b/layout/reftests/css-display/display-contents-visibility-hidden-2.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-visibility-hidden-2.html @@ -0,0 +1,24 @@ + + + + + + CSS Test: CSS display:contents; visibility:hidden + + + + + + + diff --git a/layout/reftests/css-display/display-contents-visibility-hidden-ref.html b/layout/reftests/css-display/display-contents-visibility-hidden-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-visibility-hidden-ref.html @@ -0,0 +1,18 @@ + + + + + + CSS Test: CSS display:contents; visibility:hidden + + + +
+ Line 1 +
+ + + diff --git a/layout/reftests/css-display/display-contents-visibility-hidden.html b/layout/reftests/css-display/display-contents-visibility-hidden.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-visibility-hidden.html @@ -0,0 +1,26 @@ + + + + + + CSS Test: CSS display:contents; visibility:hidden + + + + + + + + diff --git a/layout/reftests/css-display/display-contents-xbl-ref.html b/layout/reftests/css-display/display-contents-xbl-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-xbl-ref.html @@ -0,0 +1,59 @@ + + + + +
a b c
+
a b c
+
a b cd
+
a b c
+
a b c
+
OneTwo
+
OneTwo
+
OneTwo
+
OnebTwo
+
OnebTwo
+
OnebTwo
+
OneTwoi
+
OneTwoi
+
OneTwoi
+
bOneTwo
+
bOneTwo
+
bOneTwo
+
OneiTwo
+
OneiTwo
+
OneiTwo
+
a I c
+
a J c
+
a K c
+
L12
+
M12
+a O c +a P c +Q12 +R12 +a b c +a b c +a b cd +a b c +a b c +OneTwo +OneTwo +OneTwo +OnebTwo +OnebTwo +OnebTwo +OneTwoi +OneTwoi +OneTwoi +bOneTwo +bOneTwo +bOneTwo +OneiTwo +OneiTwo +OneiTwo +
a One ciaTwoc
+ + diff --git a/layout/reftests/css-display/display-contents-xbl.xhtml b/layout/reftests/css-display/display-contents-xbl.xhtml new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/display-contents-xbl.xhtml @@ -0,0 +1,272 @@ + + + + CSS Test: CSS display:contents in XBL + + + + + + + + + + a + + + + c + + + + + + + + a + + + + + + + a + + c + + + + + + + + + + + + + + + + + + + c + + + + + + + + + + + + + + + + + + +
+
+
d +
+
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
I
+
J
+
K
+
2L1
+
2M1
+
O
+
P
+
2Q1
+
2R1
+
+
+
d +
+
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+
TwoOne
+ + + + diff --git a/layout/reftests/css-display/reftest.list b/layout/reftests/css-display/reftest.list new file mode 100644 --- /dev/null +++ b/layout/reftests/css-display/reftest.list @@ -0,0 +1,20 @@ +# Tests for CSS Display spec features. +# http://dev.w3.org/csswg/css-display + +pref(layout.css.display-contents.enabled,true) == display-contents-acid.html display-contents-acid-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-1.html display-contents-acid-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-2.html display-contents-acid-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-3.html display-contents-acid-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-generated-content.html display-contents-generated-content-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-generated-content-2.html display-contents-generated-content-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-style-inheritance-1.html display-contents-style-inheritance-1-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-style-inheritance-1-stylechange.html display-contents-style-inheritance-1-ref.html +pref(layout.css.display-contents.enabled,true) fuzzy-if(winWidget,12,100) == display-contents-style-inheritance-1-dom-mutations.html display-contents-style-inheritance-1-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-tables.xhtml display-contents-tables-ref.xhtml +pref(layout.css.display-contents.enabled,true) == display-contents-tables-2.xhtml display-contents-tables-ref.xhtml +pref(layout.css.display-contents.enabled,true) == display-contents-tables-3.xhtml display-contents-tables-3-ref.xhtml +pref(layout.css.display-contents.enabled,true) == display-contents-visibility-hidden.html display-contents-visibility-hidden-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-visibility-hidden-2.html display-contents-visibility-hidden-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-495385-2d.html display-contents-495385-2d-ref.html +skip-if(B2G) pref(layout.css.display-contents.enabled,true) == display-contents-xbl.xhtml display-contents-xbl-ref.html +pref(layout.css.display-contents.enabled,true) pref(dom.webcomponents.enabled,true) == display-contents-shadow-dom-1.html display-contents-shadow-dom-1-ref.html diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list --- a/layout/reftests/reftest.list +++ b/layout/reftests/reftest.list @@ -64,16 +64,19 @@ include css-break/reftest.list include css-calc/reftest.list # css character encoding tests include css-charset/reftest.list # css default pseudo class tests include css-default/reftest.list +# css-display spec tests +include css-display/reftest.list + # css :disable tests include css-disabled/reftest.list # css :enable tests include css-enabled/reftest.list # css @import tests include css-import/reftest.list diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -5407,16 +5407,20 @@ if (SpecialPowers.getBoolPref("layout.cs "auto / auto / auto", "auto / auto / auto / auto" ], other_values: gridAreaOtherValues, invalid_values: gridAreaInvalidValues }; } +if (SpecialPowers.getBoolPref("layout.css.display-contents.enabled")) { + gCSSProperties["display"].other_values.push("contents"); +} + if (SpecialPowers.getBoolPref("layout.css.image-orientation.enabled")) { gCSSProperties["image-orientation"] = { domProp: "imageOrientation", inherited: true, type: CSS_TYPE_LONGHAND, initial_values: [ "0deg", "0grad",