Skip to content

Commit 740b2e3

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: 8f6d960e567bd265b1d2478c7ad6868b6872cd22
1 parent daed869 commit 740b2e3

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

+624
-111
lines changed

accessible/generic/DocAccessible.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4555,6 +4555,9 @@ ContentAppended
45554555
nsIContent
45564556
*
45574557
aFirstNewContent
4558+
const
4559+
ContentAppendInfo
4560+
&
45584561
)
45594562
{
45604563
MaybeHandleChangeToHiddenNameOrDescription
@@ -5226,6 +5229,9 @@ ContentInserted
52265229
nsIContent
52275230
*
52285231
aChild
5232+
const
5233+
ContentInsertInfo
5234+
&
52295235
)
52305236
{
52315237
MaybeHandleChangeToHiddenNameOrDescription
@@ -5244,8 +5250,8 @@ nsIContent
52445250
*
52455251
aChildNode
52465252
const
5247-
BatchRemovalState
5248-
*
5253+
ContentRemoveInfo
5254+
&
52495255
)
52505256
{
52515257
#

docshell/shistory/nsSHEntryShared.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,9 @@ ContentAppended
15301530
nsIContent
15311531
*
15321532
aFirstNewContent
1533+
const
1534+
ContentAppendInfo
1535+
&
15331536
)
15341537
{
15351538
if
@@ -1557,6 +1560,9 @@ ContentInserted
15571560
nsIContent
15581561
*
15591562
aChild
1563+
const
1564+
ContentInsertInfo
1565+
&
15601566
)
15611567
{
15621568
if
@@ -1585,8 +1591,8 @@ nsIContent
15851591
*
15861592
aChild
15871593
const
1588-
BatchRemovalState
1589-
*
1594+
ContentRemoveInfo
1595+
&
15901596
)
15911597
{
15921598
if

dom/base/CharacterData.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,10 @@ textLength
12291229
aOffset
12301230
endOffset
12311231
aLength
1232+
MutationEffectOnScript
1233+
:
1234+
:
1235+
DropTrustWorthiness
12321236
aDetails
12331237
}
12341238
;
@@ -1541,6 +1545,10 @@ textLength
15411545
aOffset
15421546
endOffset
15431547
aLength
1548+
MutationEffectOnScript
1549+
:
1550+
:
1551+
DropTrustWorthiness
15441552
aDetails
15451553
}
15461554
;

dom/base/CrossShadowBoundaryRange.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,8 @@ nsIContent
729729
*
730730
aChild
731731
const
732-
BatchRemovalState
733-
*
732+
ContentRemoveInfo
733+
&
734734
)
735735
{
736736
MOZ_DIAGNOSTIC_ASSERT

dom/base/Document.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16457,7 +16457,8 @@ NotifyContentWillBeRemoved
1645716457
(
1645816458
this
1645916459
content
16460-
nullptr
16460+
{
16461+
}
1646116462
)
1646216463
;
1646316464
DisconnectChild
@@ -37440,7 +37441,9 @@ NotifyContentWillBeRemoved
3744037441
(
3744137442
this
3744237443
aKid
37444+
{
3744337445
aState
37446+
}
3744437447
)
3744537448
;
3744637449
aNotify
@@ -41641,7 +41644,8 @@ ps
4164141644
ContentWillBeRemoved
4164241645
(
4164341646
container
41644-
nullptr
41647+
{
41648+
}
4164541649
)
4164641650
;
4164741651
}
@@ -41889,6 +41893,8 @@ ps
4188941893
ContentAppended
4189041894
(
4189141895
container
41896+
{
41897+
}
4189241898
)
4189341899
;
4189441900
}
@@ -70016,6 +70022,10 @@ ContentAppended
7001670022
nsIContent
7001770023
*
7001870024
aFirstNewContent
70025+
const
70026+
ContentAppendInfo
70027+
&
70028+
aInfo
7001970029
)
7002070030
{
7002170031
for
@@ -70041,6 +70051,7 @@ GetNextSibling
7004170051
ContentInserted
7004270052
(
7004370053
c
70054+
aInfo
7004470055
)
7004570056
;
7004670057
}
@@ -70054,6 +70065,9 @@ ContentInserted
7005470065
nsIContent
7005570066
*
7005670067
aChild
70068+
const
70069+
ContentInsertInfo
70070+
&
7005770071
)
7005870072
{
7005970073
FireEvent

dom/base/FragmentOrElement.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9766,6 +9766,8 @@ target
97669766
GetFirstChild
97679767
(
97689768
)
9769+
{
9770+
}
97699771
)
97709772
;
97719773
}

dom/base/MutationObservers.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,10 @@ aContainer
920920
nsIContent
921921
*
922922
aFirstNewContent
923+
const
924+
ContentAppendInfo
925+
&
926+
aInfo
923927
)
924928
{
925929
aContainer
@@ -941,6 +945,7 @@ NOTIFIER
941945
(
942946
ContentAppended
943947
aFirstNewContent
948+
aInfo
944949
)
945950
nsIMutationObserver
946951
:
@@ -961,6 +966,10 @@ aContainer
961966
nsIContent
962967
*
963968
aChild
969+
const
970+
ContentInsertInfo
971+
&
972+
aInfo
964973
)
965974
{
966975
MOZ_ASSERT
@@ -1010,6 +1019,7 @@ NOTIFIER
10101019
(
10111020
ContentInserted
10121021
aChild
1022+
aInfo
10131023
)
10141024
nsIMutationObserver
10151025
:
@@ -1031,9 +1041,9 @@ nsIContent
10311041
*
10321042
aChild
10331043
const
1034-
BatchRemovalState
1035-
*
1036-
aState
1044+
ContentRemoveInfo
1045+
&
1046+
aInfo
10371047
)
10381048
{
10391049
MOZ_ASSERT
@@ -1116,7 +1126,7 @@ NOTIFIER
11161126
(
11171127
ContentWillBeRemoved
11181128
aChild
1119-
aState
1129+
aInfo
11201130
)
11211131
nsIMutationObserver
11221132
:

dom/base/MutationObservers.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ aContainer
162162
nsIContent
163163
*
164164
aFirstNewContent
165+
const
166+
ContentAppendInfo
167+
&
165168
)
166169
;
167170
static
@@ -174,6 +177,9 @@ aContainer
174177
nsIContent
175178
*
176179
aChild
180+
const
181+
ContentInsertInfo
182+
&
177183
)
178184
;
179185
static
@@ -187,8 +193,8 @@ nsIContent
187193
*
188194
aChild
189195
const
190-
BatchRemovalState
191-
*
196+
ContentRemoveInfo
197+
&
192198
)
193199
;
194200
static

dom/base/NodeIterator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ nsIContent
784784
*
785785
aChild
786786
const
787-
BatchRemovalState
788-
*
787+
ContentRemoveInfo
788+
&
789789
)
790790
{
791791
nsINode

dom/base/nsContentList.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3274,6 +3274,9 @@ ContentAppended
32743274
nsIContent
32753275
*
32763276
aFirstNewContent
3277+
const
3278+
ContentAppendInfo
3279+
&
32773280
)
32783281
{
32793282
nsIContent
@@ -3633,6 +3636,9 @@ ContentInserted
36333636
nsIContent
36343637
*
36353638
aChild
3639+
const
3640+
ContentInsertInfo
3641+
&
36363642
)
36373643
{
36383644
if
@@ -3691,8 +3697,8 @@ nsIContent
36913697
*
36923698
aChild
36933699
const
3694-
BatchRemovalState
3695-
*
3700+
ContentRemoveInfo
3701+
&
36963702
)
36973703
{
36983704
if
@@ -5203,6 +5209,9 @@ ContentAppended
52035209
nsIContent
52045210
*
52055211
aFirstNewContent
5212+
const
5213+
ContentAppendInfo
5214+
&
52065215
)
52075216
{
52085217
nsIContent
@@ -5254,6 +5263,9 @@ ContentInserted
52545263
nsIContent
52555264
*
52565265
aChild
5266+
const
5267+
ContentInsertInfo
5268+
&
52575269
)
52585270
{
52595271
if
@@ -5295,9 +5307,8 @@ nsIContent
52955307
*
52965308
aChild
52975309
const
5298-
BatchRemovalState
5299-
*
5300-
aState
5310+
ContentRemoveInfo
5311+
&
53015312
)
53025313
{
53035314
if

0 commit comments

Comments
 (0)