Skip to content

Commit fb9406d

Browse files
Lubrsitrflynn89
authored andcommitted
LibWeb: Make Trusted Types injection sink names more readable
No functional change.
1 parent 60e1a13 commit fb9406d

File tree

14 files changed

+55
-55
lines changed

14 files changed

+55
-55
lines changed

Libraries/LibWeb/DOM/Document.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,14 +649,14 @@ GC::Ptr<Selection::Selection> Document::get_selection() const
649649
WebIDL::ExceptionOr<void> Document::write(Vector<TrustedTypes::TrustedHTMLOrString> const& text)
650650
{
651651
// The document.write(...text) method steps are to run the document write steps with this, text, false, and "Document write".
652-
return run_the_document_write_steps(text, AddLineFeed::No, TrustedTypes::InjectionSink::Documentwrite);
652+
return run_the_document_write_steps(text, AddLineFeed::No, TrustedTypes::InjectionSink::Document_write);
653653
}
654654

655655
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln
656656
WebIDL::ExceptionOr<void> Document::writeln(Vector<TrustedTypes::TrustedHTMLOrString> const& text)
657657
{
658658
// The document.writeln(...text) method steps are to run the document write steps with this, text, true, and "Document writeln".
659-
return run_the_document_write_steps(text, AddLineFeed::Yes, TrustedTypes::InjectionSink::Documentwriteln);
659+
return run_the_document_write_steps(text, AddLineFeed::Yes, TrustedTypes::InjectionSink::Document_writeln);
660660
}
661661

662662
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-write-steps
@@ -6373,7 +6373,7 @@ WebIDL::ExceptionOr<GC::Root<DOM::Document>> Document::parse_html_unsafe(JS::VM&
63736373
TrustedTypes::TrustedTypeName::TrustedHTML,
63746374
HTML::current_principal_global_object(),
63756375
html,
6376-
TrustedTypes::InjectionSink::DocumentparseHTMLUnsafe,
6376+
TrustedTypes::InjectionSink::Document_parseHTMLUnsafe,
63776377
TrustedTypes::Script.to_string()));
63786378

63796379
// 2. Let document be a new Document, whose content type is "text/html".

Libraries/LibWeb/DOM/Element.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ WebIDL::ExceptionOr<void> Element::set_inner_html(TrustedTypes::TrustedHTMLOrStr
10661066
TrustedTypes::TrustedTypeName::TrustedHTML,
10671067
HTML::relevant_global_object(*this),
10681068
value,
1069-
TrustedTypes::InjectionSink::ElementinnerHTML,
1069+
TrustedTypes::InjectionSink::Element_innerHTML,
10701070
TrustedTypes::Script.to_string()));
10711071

10721072
// 2. Let context be this.
@@ -2120,7 +2120,7 @@ WebIDL::ExceptionOr<void> Element::set_outer_html(TrustedTypes::TrustedHTMLOrStr
21202120
TrustedTypes::TrustedTypeName::TrustedHTML,
21212121
HTML::relevant_global_object(*this),
21222122
value,
2123-
TrustedTypes::InjectionSink::ElementouterHTML,
2123+
TrustedTypes::InjectionSink::Element_outerHTML,
21242124
TrustedTypes::Script.to_string()));
21252125

21262126
// 2. Let parent be this's parent.
@@ -2156,7 +2156,7 @@ WebIDL::ExceptionOr<void> Element::insert_adjacent_html(String const& position,
21562156
TrustedTypes::TrustedTypeName::TrustedHTML,
21572157
HTML::relevant_global_object(*this),
21582158
string,
2159-
TrustedTypes::InjectionSink::ElementinsertAdjacentHTML,
2159+
TrustedTypes::InjectionSink::Element_insertAdjacentHTML,
21602160
TrustedTypes::Script.to_string()));
21612161

21622162
// 2. Let context be null.
@@ -3968,7 +3968,7 @@ WebIDL::ExceptionOr<void> Element::set_html_unsafe(TrustedTypes::TrustedHTMLOrSt
39683968
TrustedTypes::TrustedTypeName::TrustedHTML,
39693969
HTML::relevant_global_object(*this),
39703970
html,
3971-
TrustedTypes::InjectionSink::ElementsetHTMLUnsafe,
3971+
TrustedTypes::InjectionSink::Element_setHTMLUnsafe,
39723972
TrustedTypes::Script.to_string()));
39733973

39743974
// 2. Let target be this's template contents if this is a template element; otherwise this.

Libraries/LibWeb/DOM/Range.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ WebIDL::ExceptionOr<GC::Ref<DocumentFragment>> Range::create_contextual_fragment
12501250
TrustedTypes::TrustedTypeName::TrustedHTML,
12511251
HTML::relevant_global_object(*this),
12521252
string,
1253-
TrustedTypes::InjectionSink::RangecreateContextualFragment,
1253+
TrustedTypes::InjectionSink::Range_createContextualFragment,
12541254
TrustedTypes::Script.to_string()));
12551255

12561256
// 2. Let node be this's start node.

Libraries/LibWeb/DOM/ShadowRoot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ WebIDL::ExceptionOr<void> ShadowRoot::set_inner_html(TrustedTypes::TrustedHTMLOr
7979
TrustedTypes::TrustedTypeName::TrustedHTML,
8080
HTML::relevant_global_object(*this),
8181
value,
82-
TrustedTypes::InjectionSink::ShadowRootinnerHTML,
82+
TrustedTypes::InjectionSink::ShadowRoot_innerHTML,
8383
TrustedTypes::Script.to_string()));
8484

8585
// 2. Let context be this's host.
@@ -127,7 +127,7 @@ WebIDL::ExceptionOr<void> ShadowRoot::set_html_unsafe(TrustedTypes::TrustedHTMLO
127127
TrustedTypes::TrustedTypeName::TrustedHTML,
128128
HTML::relevant_global_object(*this),
129129
html,
130-
TrustedTypes::InjectionSink::ShadowRootsetHTMLUnsafe,
130+
TrustedTypes::InjectionSink::ShadowRoot_setHTMLUnsafe,
131131
TrustedTypes::Script.to_string()));
132132

133133
// 2. Unsafely set HTML given this, this's shadow host, and compliantHTML.

Libraries/LibWeb/Editing/Commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ bool command_insert_html_action(DOM::Document& document, Utf16String const& valu
12271227
TrustedTypes::TrustedTypeName::TrustedHTML,
12281228
HTML::relevant_global_object(document),
12291229
value,
1230-
TrustedTypes::InjectionSink::DocumentexecCommand,
1230+
TrustedTypes::InjectionSink::Document_execCommand,
12311231
TrustedTypes::Script.to_string()));
12321232

12331233
// 2. Delete the selection.

Libraries/LibWeb/HTML/DOMParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ WebIDL::ExceptionOr<GC::Root<DOM::Document>> DOMParser::parse_from_string(Utf16S
4747
TrustedTypes::TrustedTypeName::TrustedHTML,
4848
relevant_global_object(*this),
4949
move(string),
50-
TrustedTypes::InjectionSink::DOMParserparseFromString,
50+
TrustedTypes::InjectionSink::DOMParser_parseFromString,
5151
TrustedTypes::Script.to_string()));
5252

5353
// 2. Let document be a new Document, whose content type is type and url is this's relevant global object's associated Document's URL.

Libraries/LibWeb/HTML/HTMLIFrameElement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ WebIDL::ExceptionOr<void> HTMLIFrameElement::set_srcdoc(TrustedTypes::TrustedHTM
326326
TrustedTypes::TrustedTypeName::TrustedHTML,
327327
HTML::relevant_global_object(*this),
328328
value,
329-
TrustedTypes::InjectionSink::HTMLIFrameElementsrcdoc,
329+
TrustedTypes::InjectionSink::HTMLIFrameElement_srcdoc,
330330
TrustedTypes::Script.to_string()));
331331

332332
// 2. Set an attribute value given this, srcdoc's local name, and compliantString.

Libraries/LibWeb/HTML/HTMLScriptElement.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ WebIDL::ExceptionOr<void> HTMLScriptElement::set_text(TrustedTypes::TrustedScrip
683683
TrustedTypes::TrustedTypeName::TrustedScript,
684684
HTML::relevant_global_object(*this),
685685
text,
686-
TrustedTypes::InjectionSink::HTMLScriptElementtext,
686+
TrustedTypes::InjectionSink::HTMLScriptElement_text,
687687
TrustedTypes::Script.to_string()));
688688

689689
// 2. Set this’s script text value to the given value.
@@ -703,7 +703,7 @@ WebIDL::ExceptionOr<void> HTMLScriptElement::set_src(TrustedTypes::TrustedScript
703703
TrustedTypes::TrustedTypeName::TrustedScriptURL,
704704
HTML::relevant_global_object(*this),
705705
text,
706-
TrustedTypes::InjectionSink::HTMLScriptElementsrc,
706+
TrustedTypes::InjectionSink::HTMLScriptElement_src,
707707
TrustedTypes::Script.to_string()));
708708

709709
// 2. Set this’s src content attribute to value.
@@ -727,7 +727,7 @@ WebIDL::ExceptionOr<void> HTMLScriptElement::set_text_content(TrustedTypes::Trus
727727
TrustedTypes::TrustedTypeName::TrustedScript,
728728
HTML::relevant_global_object(*this),
729729
text,
730-
TrustedTypes::InjectionSink::HTMLScriptElementtextContent,
730+
TrustedTypes::InjectionSink::HTMLScriptElement_textContent,
731731
TrustedTypes::Script.to_string()));
732732

733733
// 2. Set this’s script text value to value.
@@ -754,7 +754,7 @@ WebIDL::ExceptionOr<void> HTMLScriptElement::set_inner_text(TrustedTypes::Truste
754754
TrustedTypes::TrustedTypeName::TrustedScript,
755755
HTML::relevant_global_object(*this),
756756
text,
757-
TrustedTypes::InjectionSink::HTMLScriptElementinnerText,
757+
TrustedTypes::InjectionSink::HTMLScriptElement_innerText,
758758
TrustedTypes::Script.to_string()));
759759

760760
// 2. Set this’s script text value to value.

Libraries/LibWeb/HTML/SharedWorker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ WebIDL::ExceptionOr<GC::Ref<SharedWorker>> SharedWorker::construct_impl(JS::Real
3333
TrustedTypes::TrustedTypeName::TrustedScriptURL,
3434
realm.global_object(),
3535
script_url,
36-
TrustedTypes::InjectionSink::SharedWorkerconstructor,
36+
TrustedTypes::InjectionSink::SharedWorker_constructor,
3737
TrustedTypes::Script.to_string()));
3838

3939
// 2. If options is a DOMString, set options to a new WorkerOptions dictionary whose name member is set to the value

Libraries/LibWeb/HTML/Worker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ WebIDL::ExceptionOr<GC::Ref<Worker>> Worker::create(TrustedTypes::TrustedScriptU
5959
TrustedTypes::TrustedTypeName::TrustedScriptURL,
6060
HTML::relevant_global_object(document),
6161
script_url,
62-
TrustedTypes::InjectionSink::Workerconstructor,
62+
TrustedTypes::InjectionSink::Worker_constructor,
6363
TrustedTypes::Script.to_string()));
6464

6565
dbgln_if(WEB_WORKER_DEBUG, "WebWorker: Creating worker with compliant_script_url = {}", compliant_script_url);

0 commit comments

Comments
 (0)