Frédéric Wang
1f81a41d25
Bug 1928932 - Part 3 - Transmit proper MutationEffectOnScript to mutation observers. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D253633
2025-09-02 20:04:43 +00:00
Emilio Cobos Álvarez
791917d8af
Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
...
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Frédéric Wang
5b2f8ce346
Bug 1972280 - Test whether script's text is non-empty in ScriptElement::MaybeProcessScript. r=smaug
...
Currently logic is duplicated in HTMLScriptElement and SVGScriptElement's
HasScriptContent() implementations. Rename these methods to only check
hether we have external script content, and move the check for inline
script content directly in ScriptElement::MaybeProcessScript.
Differential Revision: https://phabricator.services.mozilla.com/D253789
2025-06-17 09:36:12 +00:00
Nazım Can Altınova
be9cba47b7
Bug 1905855 - Use USVString instead of DOMString for HTMLScriptElement's src attribute r=smaug
...
Type of src attribute is USVString in the spec:
https://html.spec.whatwg.org/multipage/scripting.html#the-script-element:dom-script-src
And USVString is usually the required type for src and url attributes.
Differential Revision: https://phabricator.services.mozilla.com/D251774
2025-05-30 20:45:44 +00:00
Tom Schuster
edaa914b45
Bug 1947732 - Provide nsIPrincipal to GetTrustedTypesCompliantString. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D246424
2025-04-30 11:09:07 +00:00
longsonr
e69829766c
Bug 1847712 - support fetchpriority for SVG image, feImage and script elements r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D246863
2025-04-29 03:35:00 +00:00
Goloman Adrian
8262016029
Backed out changeset 63b702867240 (bug 1847712) for causing wpt failures @ttr-image-fetchpriority.html. CLOSED TREE
2025-04-28 12:41:32 +03:00
longsonr
ef3debc812
Bug 1847712 - support fetchpriority for SVG image, feImage and script elements r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D246863
2025-04-28 08:19:38 +00:00
Frédéric Wang
fd4d501294
Bug 1944511 Implement remaining Trusted Type support for attribute changes. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D236107
2025-02-14 06:49:12 +00:00
Frédéric Wang
3638510837
Bug 1905706 - Trusted Types support for the src/innerText/textContent/text IDL attributes of HTMLScriptElement. r=smaug
...
This only does the minimal change to handle trusted types as arguments
of attribute setter/getter. See bug 1928932 for follow-up checks.
Differential Revision: https://phabricator.services.mozilla.com/D227513
2024-11-27 05:06:17 +00:00
Mirko Brodesser
86af414bcd
Bug 1914372: part 2) Add TrustedHTML to the interface of Element.innerHTML. r=smaug,peterv,farre
...
Differential Revision: https://phabricator.services.mozilla.com/D219876
2024-10-16 10:32:37 +00:00
Emilio Cobos Álvarez
a44b49af0b
Bug 1910698 - Add a struct to represent JS caller location and more general warning source location. r=smaug,necko-reviewers,anti-tracking-reviewers,dom-storage-reviewers,pbz,kershaw,janv
...
Use it liberally across the tree. This could be cleaned up even more in the future.
Differential Revision: https://phabricator.services.mozilla.com/D218114
2024-08-01 17:12:48 +00:00
Cathie Chen
7859d6112f
Bug 1879340 - Add potentially render blocking, r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D201095
2024-02-24 18:12:35 +00:00
Cathie Chen
d8224880f1
Bug 1878888 - Add the runtime flag and parsing for the blocking attribute, r=emilio
...
Differential Revision: https://phabricator.services.mozilla.com/D200810
2024-02-07 17:06:56 +00:00
Gregory Pappas
eb2242368d
Bug 1853547 - Remove dom.importMaps.enabled pref r=allstarschh
...
Differential Revision: https://phabricator.services.mozilla.com/D197751
2024-01-06 01:53:19 +00:00
Mirko Brodesser
2a72b3ab97
Bug 1865610: part 1) Add partial support for the "fetchpriority" attribute for loading style sheets from <link> elements or Link header fields. r=smaug,emilio,valentin
...
Includes only support for dynamically loading style sheets from `<link>`
elements and `Link` header fields.
The remaining support, including preloading, is completed in part 3.
Differential Revision: https://phabricator.services.mozilla.com/D191745
2023-11-23 14:36:11 +00:00
Tooru Fujisawa
3805c12503
Bug 1864168 - Part 6: Use 1-origin column number in ScriptLoader and nsIScriptElement. r=smaug,devtools-reviewers,hsivonen,ochameau
...
Also fix opSetScriptLineAndColumnNumberAndFreeze::mColumnNumber to point the
first character of the script source, instead of '>' of the start tag.
Differential Revision: https://phabricator.services.mozilla.com/D193374
2023-11-22 12:31:32 +00:00
Natalia Csoregi
e0d56104a6
Backed out 14 changesets (bug 1865005, bug 1864168, bug 1864155, bug 1862814, bug 1862693) for causing bustage on nsRFPService.cpp. CLOSED TREE
...
Backed out changeset a4f3e7625abf (bug 1865005)
Backed out changeset ab38141e470b (bug 1862814)
Backed out changeset a679b50dc4a9 (bug 1862814)
Backed out changeset e340886ce62a (bug 1862814)
Backed out changeset 1378502e64b0 (bug 1862814)
Backed out changeset 8ee94e5e79c2 (bug 1862814)
Backed out changeset 6d4ef1cdfabb (bug 1864168)
Backed out changeset 2c30c4d757fc (bug 1864168)
Backed out changeset d4db9576559b (bug 1864168)
Backed out changeset 8ffec0d83028 (bug 1864168)
Backed out changeset fa77d852b494 (bug 1864168)
Backed out changeset f6646771a26a (bug 1864168)
Backed out changeset 7bd0ff6986df (bug 1864155)
Backed out changeset 39867b503289 (bug 1862693)
2023-11-22 14:01:55 +02:00
Tooru Fujisawa
57838ec3d2
Bug 1864168 - Part 6: Use 1-origin column number in ScriptLoader and nsIScriptElement. r=smaug,devtools-reviewers,hsivonen,ochameau
...
Also fix opSetScriptLineAndColumnNumberAndFreeze::mColumnNumber to point the
first character of the script source, instead of '>' of the start tag.
Differential Revision: https://phabricator.services.mozilla.com/D193374
2023-11-22 11:13:56 +00:00
Mirko Brodesser
c9f82f9c46
Bug 1839315: part 6) Lift code for fetchpriority attribute from nsGenericHTMLElementWithFetchPriorityAttribute to nsGenericHTMLElement. r=smaug
...
As requested in the review of part 1.
Differential Revision: https://phabricator.services.mozilla.com/D191274
2023-10-23 08:14:51 +00:00
Mirko Brodesser
510fb3abb6
Bug 1839315: part 1) Lift code for fetchpriority attribute from HTMLScriptElement to nsGenericHTMLElementWithFetchPriorityAttribute. r=smaug
...
Since the HTMLLinkElement requires it too, see part 2.
Differential Revision: https://phabricator.services.mozilla.com/D189935
2023-10-23 08:14:49 +00:00
Mirko Brodesser
3de23172d3
Bug 1839316: part 4) Add RequestPriority to ScriptFetchOptions and ScriptLoadRequest. r=smaug
...
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.
Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-28 11:56:34 +00:00
Mirko Brodesser
ff739cbbd7
Bug 1839316: part 2) Implement getting and setting "fetchpriority" content attribute of <script> element. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D181752
2023-08-28 11:56:33 +00:00
Cosmin Sabou
70b514ed8e
Backed out 5 changesets (bug 1839316) for causing bustages on ScriptLoader.cpp. CLOSED TREE
...
Backed out changeset 85f107e082ee (bug 1839316)
Backed out changeset 8c1e22518c3a (bug 1839316)
Backed out changeset a4c3dec0f34c (bug 1839316)
Backed out changeset 313ff15742dd (bug 1839316)
Backed out changeset fa200e26bbb1 (bug 1839316)
2023-08-09 20:16:06 +03:00
Mirko Brodesser
fcb70e3246
Bug 1839316: part 4) Add RequestPriority to ScriptFetchOptions and ScriptLoadRequest. r=smaug
...
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.
Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-09 13:50:28 +00:00
Mirko Brodesser
27bbf8ed44
Bug 1839316: part 2) Implement getting and setting "fetchpriority" content attribute of <script> element. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D181752
2023-08-09 13:50:28 +00:00
Cosmin Sabou
1ea8eb8868
Backed out 5 changesets (bug 1839316) for causing leaks. CLOSED TREE
...
Backed out changeset 75edff380fee (bug 1839316)
Backed out changeset 6a622fd5cd91 (bug 1839316)
Backed out changeset 60908cc7c586 (bug 1839316)
Backed out changeset 7b9dd8875a9e (bug 1839316)
Backed out changeset b586915187c2 (bug 1839316)
2023-08-07 16:43:03 +03:00
Mirko Brodesser
e0b84f81a4
Bug 1839316: part 4) Add RequestPriority to ScriptFetchOptions and ScriptLoadRequest. r=smaug
...
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.
Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-07 11:46:19 +00:00
Mirko Brodesser
82184f5a89
Bug 1839316: part 2) Implement getting and setting "fetchpriority" content attribute of <script> element. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D181752
2023-08-07 11:46:18 +00:00
Robert Longson
75934e48ba
Bug 1839954 - support async defer and module scripts r=emilio
...
https://www.w3.org/2012/01/05-svg-irc#T21-07-03 says that async and defer should be supported as does the specification https://www.w3.org/TR/SVG2/interact.html#ScriptElement
https://github.com/w3c/svgwg/issues/918 tracks getting the SVGScriptElement webidl updated.
Differential Revision: https://phabricator.services.mozilla.com/D181936
2023-07-06 18:51:54 +00:00
Emilio Cobos Álvarez
529c9ee321
Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
...
We have more readable and faster versions (that just omit the namespace
arg).
Mostly done via sed, with a couple helpers to use the faster lookups
where possible.
Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
CanadaHonk
23e171e2af
Bug 1834134 - Create base ScriptElement GetScriptType method r=peterv
...
SVG and HTML ScriptElements now use a new base GetScriptType common
method instead of an individual duplicate implementation.
Make a big (unimportant) meta bug to do more of this later?
(avoids code duplication between SVG and HTML, updates old SVG code).
160 WPT subtests newly pass (100% in this test file) 🎉
Differential Revision: https://phabricator.services.mozilla.com/D180200
2023-06-22 19:42:30 +00:00
CanadaHonk
b3b8dd000a
Bug 1834110 - Do not run script elements with whitespace type attribute values r=peterv
...
Fixed running script elements with a type attribute value with whitespace
(like " ").
Fixed by comparing value emptiness before and after trim, if not empty
before and empty after, undo the trim.
2 WPT subtests now newly pass.
WPT tests: https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/script-type-and-language-js.html
Differential Revision: https://phabricator.services.mozilla.com/D178573
2023-06-02 15:24:14 +00:00
Emilio Cobos Álvarez
ded1458b5b
Bug 1829189 - Make OnAttrSetButNotChanged and AfterSetAttr infallible. r=smaug
...
Same rg + sed shenanigans as the first patch.
There were two that could fail, both due to OOM:
* HTMLInputElement::AfterSetAttr: If we fail (only in the type=range
case) we end up with an old value without it being clamped by
min/max/step.
* HTMLBodyElement::AfterSetAttr: If we fail we won't peek up the
DocShell's frame margins and styling could be incorrect.
That seems better than having to deal with broken states after we've
already set the attribute.
Depends on D176069
Differential Revision: https://phabricator.services.mozilla.com/D176070
2023-04-21 08:56:27 +00:00
Masayuki Nakano
5dfd7f8719
Bug 1800553 - part 2: Change HTMLAnchorElement::GetText to a const method r=smaug
...
This needs to change `nsContentUtils` methods because of used by the method.
Then, we can make some there callers are also `const` methods.
Depends on D162065
Differential Revision: https://phabricator.services.mozilla.com/D162066
2022-11-16 00:21:30 +00:00
Yoshi Cheng-Hao Huang
6d98cdb61b
Bug 1778289 - Part 12: Update spec links as the PR is merged. r=jonco,yulia
...
The PR has been merged.
See https://html.spec.whatwg.org/multipage/webappapis.html#import-maps
Differential Revision: https://phabricator.services.mozilla.com/D158828
2022-10-07 13:56:27 +00:00
Yoshi Cheng-Hao Huang
13ecf3a08f
Bug 1778289 : Part 8: Update spec for prepare-script when type="importmap". r=jonco,yulia
...
Differential Revision: https://phabricator.services.mozilla.com/D152875
2022-10-07 13:56:25 +00:00
Yoshi Cheng-Hao Huang
31656e9e1f
Bug 1688879 - Part 2: Add support for import maps in ScriptElement/ScriptLoader/ScriptKind. r=jonco,yulia,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142070
2022-05-05 21:19:01 +00:00
Butkovits Atila
b018b0e4da
Backed out 11 changesets (bug 1688879) for causing build bustages. CLOSED TREE
...
Backed out changeset 350ddd17c7f5 (bug 1688879)
Backed out changeset 27984b95ed20 (bug 1688879)
Backed out changeset 6a5bb063965f (bug 1688879)
Backed out changeset d8edcfdb504b (bug 1688879)
Backed out changeset 77ab231310ec (bug 1688879)
Backed out changeset c2bce95a1aca (bug 1688879)
Backed out changeset f5862572ced8 (bug 1688879)
Backed out changeset 05e0a1bf32fc (bug 1688879)
Backed out changeset adeab05b7419 (bug 1688879)
Backed out changeset 0e60834e17e5 (bug 1688879)
Backed out changeset 877bb4c2ce66 (bug 1688879)
2022-05-05 19:52:05 +03:00
Yoshi Cheng-Hao Huang
9e51f47edc
Bug 1688879 - Part 2: Add support for import maps in ScriptElement/ScriptLoader/ScriptKind. r=jonco,yulia,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142070
2022-05-05 16:03:16 +00:00
Narcis Beleuzu
8fd1fceb75
Backed out 9 changesets (bug 1688879) for bustages on ImportMap.cpp
...
Backed out changeset 44e9abe72a5e (bug 1688879)
Backed out changeset 0503d2d2ae01 (bug 1688879)
Backed out changeset 2cf08a51b184 (bug 1688879)
Backed out changeset 6f0276c3ab0e (bug 1688879)
Backed out changeset f16b14d8f677 (bug 1688879)
Backed out changeset 03b772e02d07 (bug 1688879)
Backed out changeset 39ed48a5ecc2 (bug 1688879)
Backed out changeset d7b42d8312bb (bug 1688879)
Backed out changeset 5e695bf5dd0d (bug 1688879)
2022-05-05 03:41:31 +03:00
Yoshi Cheng-Hao Huang
9d0b0b7820
Bug 1688879 - Part 2: Add support for import maps in ScriptElement/ScriptLoader/ScriptKind. r=jonco,yulia,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142070
2022-05-04 21:02:50 +00:00
Tom Schuster
9a42f3df12
Bug 1729239 - Implement HTMLScriptElement.supports(type) method. r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D124900
2021-09-27 12:49:51 +00:00
Sylvestre Ledru
68b806d604
Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
...
Also add some missing namespace qualifications
Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')
Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila
a6e7dcc53f
Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE
2020-11-04 10:54:36 +02:00
Sylvestre Ledru
8f709b39e8
Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
...
Also add some missing namespace qualifications
Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')
Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Simon Giesecke
ab6f0a7137
Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
...
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
longsonr
ba1943ecf8
Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
...
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.
Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Simon Giesecke
a69d79b6db
Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Sean Feng
e2b8b11349
Bug 1377999 - Make HTML Element to adapt the DOMArena changes r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D57699
2020-03-17 14:53:08 +00:00