Skip to content

Commit eafab4a

Browse files
committed
Bug 1928932 - Part 1 - Add an mIsTrusted flag on script elements. r=smaug,credential-management-reviewers,dimi
This flag can be modified when notifying for character data change, content appending, content insertion and content removal by specifying a MutationEffectOnScript flag. By default callers other than the HTML5 parsers always specify "drop trustworthiness" but mIsTrusted flag is not used anyway, so there is no behavior change. Spec: https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-scripts PR: w3c/trusted-types#579 Differential Revision: https://phabricator.services.mozilla.com/D252020 UltraBlame original commit: bb51e4ab08008c6f6920e651994b59de56d19383
1 parent 50e9b2c commit eafab4a

Some content is hidden

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

52 files changed

+847
-133
lines changed

accessible/generic/DocAccessible.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7274,6 +7274,9 @@ ContentAppended
72747274
nsIContent
72757275
*
72767276
aFirstNewContent
7277+
const
7278+
ContentAppendInfo
7279+
&
72777280
)
72787281
{
72797282
MaybeHandleChangeToHiddenNameOrDescription
@@ -8121,6 +8124,9 @@ ContentInserted
81218124
nsIContent
81228125
*
81238126
aChild
8127+
const
8128+
ContentInsertInfo
8129+
&
81248130
)
81258131
{
81268132
MaybeHandleChangeToHiddenNameOrDescription
@@ -8139,8 +8145,8 @@ nsIContent
81398145
*
81408146
aChildNode
81418147
const
8142-
BatchRemovalState
8143-
*
8148+
ContentRemoveInfo
8149+
&
81448150
)
81458151
{
81468152
#

docshell/shistory/nsSHEntryShared.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,9 @@ ContentAppended
20852085
nsIContent
20862086
*
20872087
aFirstNewContent
2088+
const
2089+
ContentAppendInfo
2090+
&
20882091
)
20892092
{
20902093
if
@@ -2112,6 +2115,9 @@ ContentInserted
21122115
nsIContent
21132116
*
21142117
aChild
2118+
const
2119+
ContentInsertInfo
2120+
&
21152121
)
21162122
{
21172123
if
@@ -2140,8 +2146,8 @@ nsIContent
21402146
*
21412147
aChild
21422148
const
2143-
BatchRemovalState
2144-
*
2149+
ContentRemoveInfo
2150+
&
21452151
)
21462152
{
21472153
if

dom/base/CharacterData.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,10 @@ textLength
16331633
aOffset
16341634
endOffset
16351635
aLength
1636+
MutationEffectOnScript
1637+
:
1638+
:
1639+
DropTrustWorthiness
16361640
aDetails
16371641
}
16381642
;
@@ -2120,6 +2124,10 @@ textLength
21202124
aOffset
21212125
endOffset
21222126
aLength
2127+
MutationEffectOnScript
2128+
:
2129+
:
2130+
DropTrustWorthiness
21232131
aDetails
21242132
}
21252133
;

dom/base/CrossShadowBoundaryRange.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,8 +882,8 @@ nsIContent
882882
*
883883
aChild
884884
const
885-
BatchRemovalState
886-
*
885+
ContentRemoveInfo
886+
&
887887
)
888888
{
889889
/

dom/base/Document.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18487,7 +18487,8 @@ NotifyContentWillBeRemoved
1848718487
(
1848818488
this
1848918489
content
18490-
nullptr
18490+
{
18491+
}
1849118492
)
1849218493
;
1849318494
DisconnectChild
@@ -47581,7 +47582,9 @@ NotifyContentWillBeRemoved
4758147582
(
4758247583
this
4758347584
aKid
47585+
{
4758447586
aState
47587+
}
4758547588
)
4758647589
;
4758747590
aNotify
@@ -53651,7 +53654,8 @@ ps
5365153654
ContentWillBeRemoved
5365253655
(
5365353656
container
53654-
nullptr
53657+
{
53658+
}
5365553659
)
5365653660
;
5365753661
}
@@ -54004,6 +54008,8 @@ ps
5400454008
ContentAppended
5400554009
(
5400654010
container
54011+
{
54012+
}
5400754013
)
5400854014
;
5400954015
}
@@ -92426,6 +92432,10 @@ ContentAppended
9242692432
nsIContent
9242792433
*
9242892434
aFirstNewContent
92435+
const
92436+
ContentAppendInfo
92437+
&
92438+
aInfo
9242992439
)
9243092440
{
9243192441
for
@@ -92451,6 +92461,7 @@ GetNextSibling
9245192461
ContentInserted
9245292462
(
9245392463
c
92464+
aInfo
9245492465
)
9245592466
;
9245692467
}
@@ -92464,6 +92475,9 @@ ContentInserted
9246492475
nsIContent
9246592476
*
9246692477
aChild
92478+
const
92479+
ContentInsertInfo
92480+
&
9246792481
)
9246892482
{
9246992483
FireEvent

dom/base/FragmentOrElement.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13612,6 +13612,8 @@ target
1361213612
GetFirstChild
1361313613
(
1361413614
)
13615+
{
13616+
}
1361513617
)
1361613618
;
1361713619
}

dom/base/MutationObservers.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,10 @@ aContainer
11001100
nsIContent
11011101
*
11021102
aFirstNewContent
1103+
const
1104+
ContentAppendInfo
1105+
&
1106+
aInfo
11031107
)
11041108
{
11051109
aContainer
@@ -1121,6 +1125,7 @@ NOTIFIER
11211125
(
11221126
ContentAppended
11231127
aFirstNewContent
1128+
aInfo
11241129
)
11251130
nsIMutationObserver
11261131
:
@@ -1141,6 +1146,10 @@ aContainer
11411146
nsIContent
11421147
*
11431148
aChild
1149+
const
1150+
ContentInsertInfo
1151+
&
1152+
aInfo
11441153
)
11451154
{
11461155
MOZ_ASSERT
@@ -1190,6 +1199,7 @@ NOTIFIER
11901199
(
11911200
ContentInserted
11921201
aChild
1202+
aInfo
11931203
)
11941204
nsIMutationObserver
11951205
:
@@ -1211,9 +1221,9 @@ nsIContent
12111221
*
12121222
aChild
12131223
const
1214-
BatchRemovalState
1215-
*
1216-
aState
1224+
ContentRemoveInfo
1225+
&
1226+
aInfo
12171227
)
12181228
{
12191229
MOZ_ASSERT
@@ -1296,7 +1306,7 @@ NOTIFIER
12961306
(
12971307
ContentWillBeRemoved
12981308
aChild
1299-
aState
1309+
aInfo
13001310
)
13011311
nsIMutationObserver
13021312
:

dom/base/MutationObservers.h

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,17 @@ First
556556
new
557557
child
558558
*
559+
param
560+
aInfo
561+
Struct
562+
with
563+
information
564+
details
565+
about
566+
the
567+
*
568+
change
569+
*
559570
see
560571
nsIMutationObserver
561572
:
@@ -573,6 +584,9 @@ aContainer
573584
nsIContent
574585
*
575586
aFirstNewContent
587+
const
588+
ContentAppendInfo
589+
&
576590
)
577591
;
578592
/
@@ -601,6 +615,16 @@ Newly
601615
inserted
602616
child
603617
*
618+
param
619+
aInfo
620+
Struct
621+
with
622+
information
623+
details
624+
about
625+
the
626+
change
627+
*
604628
see
605629
nsIMutationObserver
606630
:
@@ -618,6 +642,9 @@ aContainer
618642
nsIContent
619643
*
620644
aChild
645+
const
646+
ContentInsertInfo
647+
&
621648
)
622649
;
623650
/
@@ -645,28 +672,14 @@ Removed
645672
child
646673
*
647674
param
648-
aBatchRemoving
649-
Whether
650-
we
651-
'
652-
ll
653-
be
654-
removing
655-
all
656-
children
657-
of
658-
this
659-
*
660-
container
661-
.
662-
This
663-
is
664-
useful
665-
to
666-
avoid
667-
wasteful
668-
work
669-
.
675+
aInfo
676+
Struct
677+
with
678+
information
679+
details
680+
about
681+
the
682+
change
670683
*
671684
see
672685
nsIMutationObserver
@@ -686,8 +699,8 @@ nsIContent
686699
*
687700
aChild
688701
const
689-
BatchRemovalState
690-
*
702+
ContentRemoveInfo
703+
&
691704
)
692705
;
693706
/

dom/base/NodeIterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,8 @@ nsIContent
980980
*
981981
aChild
982982
const
983-
BatchRemovalState
984-
*
983+
ContentRemoveInfo
984+
&
985985
)
986986
{
987987
nsINode

0 commit comments

Comments
 (0)