Skip to content

Commit

Permalink
Bug 1382925 - Part 4: Test origin iteration order by checking font-fa…
Browse files Browse the repository at this point in the history
…ce rule cascade. r=emilio

MozReview-Commit-ID: 7UzDKkKOEtw

UltraBlame original commit: fb2e833fe98deb0f1aeaf3d3b0b8ade309eb5c8e
  • Loading branch information
marco-c committed Oct 1, 2019
1 parent 9658637 commit 3dfadb5
Show file tree
Hide file tree
Showing 2 changed files with 351 additions and 0 deletions.
5 changes: 5 additions & 0 deletions layout/style/test/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,11 @@ test_flexbox_reflow_counts
html
]
[
test_font_face_cascade
.
html
]
[
test_font_face_parser
.
html
Expand Down
346 changes: 346 additions & 0 deletions layout/style/test/test_font_face_cascade.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
<
!
DOCTYPE
HTML
>
<
title
>
Test
that
font
-
face
rules
from
different
origins
cascade
correctly
<
/
title
>
<
script
src
=
"
/
tests
/
SimpleTest
/
SimpleTest
.
js
"
>
<
/
script
>
<
link
rel
=
"
stylesheet
"
type
=
"
text
/
css
"
href
=
"
/
tests
/
SimpleTest
/
test
.
css
"
>
<
script
>
let
io
=
SpecialPowers
.
Cc
[
"
mozilla
.
org
/
network
/
io
-
service
;
1
"
]
.
getService
(
SpecialPowers
.
Ci
.
nsIIOService
)
;
let
utils
=
SpecialPowers
.
wrap
(
window
)
.
QueryInterface
(
SpecialPowers
.
Ci
.
nsIInterfaceRequestor
)
.
getInterface
(
SpecialPowers
.
Ci
.
nsIDOMWindowUtils
)
;
function
load_sheet
(
sheet_text
level
)
{
if
(
level
!
=
"
AGENT_SHEET
"
&
&
level
!
=
"
USER_SHEET
"
&
&
level
!
=
"
AUTHOR_SHEET
"
)
{
throw
"
unknown
level
"
;
}
let
uri
=
io
.
newURI
(
"
data
:
text
/
css
"
+
encodeURI
(
sheet_text
)
)
;
utils
.
loadSheet
(
uri
utils
[
level
]
)
;
}
load_sheet
(
"
font
-
face
{
font
-
family
:
TestAgent
;
src
:
url
(
about
:
invalid
)
;
}
"
"
AGENT_SHEET
"
)
;
load_sheet
(
"
font
-
face
{
font
-
family
:
TestAuthor
;
src
:
url
(
about
:
invalid
)
;
}
"
"
AUTHOR_SHEET
"
)
;
load_sheet
(
"
font
-
face
{
font
-
family
:
TestUser
;
src
:
url
(
about
:
invalid
)
;
}
"
"
USER_SHEET
"
)
;
is
(
[
.
.
.
document
.
fonts
]
.
map
(
f
=
>
f
.
family
)
.
join
(
"
"
)
'
"
TestAuthor
"
"
TestUser
"
"
TestAgent
"
'
"
font
-
face
rules
are
returned
in
correct
cascade
order
"
)
;
<
/
script
>

0 comments on commit 3dfadb5

Please sign in to comment.