Commit Graph

1877 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
5b2b7b0c42 Bug 1743377 - Remove imgLoader::PreferLoadFromCache. r=aosmond
Instead treat these protocols as "never-expiring" protocols, and clean
up revalidation code while at it.

Depends on D132347

Differential Revision: https://phabricator.services.mozilla.com/D132348
2021-11-29 15:18:14 +00:00
Andrew Osmond
c530ee2184 Bug 1735874 - Fix broken resist fingerprinting with OffscreenCanvas on worker threads. r=dom-worker-reviewers,asuth,smaug
OffscreenCanvas can be run on worker threads and is disabled by default.
The existing code trips asserts because we try to use the document,
which is main thread only, directly on the worker thread. This patch
caches the resist fingerprinting status for the worker when it is
created for future reference.

Differential Revision: https://phabricator.services.mozilla.com/D128510
2021-11-09 20:16:04 +00:00
Masayuki Nakano
1748af94ea Bug 1455514 - part 2: Add accessors and static helper methods to retrieve nsPIDOMWindowInner, nsPIDOMWindowOuter and nsPIWindowRoot r=smaug
Similar to the previous patch, there are a lot of QI from `EventTarget` to
window interfaces.  This patch adds them, but unfortunately,
`nsPIDOMWindowInner` and `nsPIDOMWindowOuter` do not inherit `EventTarget`
directly, and they are in a public header instead of their concrete classes
(`nsGlobalWindowInner` and `nsGlobalWindowOuter`).  So we cannot cast them
in `nsPIDOMWindow.h`, and it causes it's impossible to use the macros added
by the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D129782
2021-11-02 13:03:43 +00:00
Masayuki Nakano
628f3ba93c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve nsINode or its concrete classes from EventTarget r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Florian Quèze
23e763f19d Bug 1738285 - move AUTO_PROFILE_FOLLOWING_RUNNABLE to its own header, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D129825
2021-10-28 20:35:06 +00:00
Cristian Tuns
a89b74b0b2 Backed out 2 changesets (bug 1737694) for causing web platform tests failures on autocapitalize.html CLOSED TREE
Backed out changeset cbfc81505f1a (bug 1737694)
Backed out changeset c2f44297bd03 (bug 1737694)
2021-10-27 10:50:15 -04:00
Edgar Chen
95d6401c9e Bug 1737694 - Part 2: Replace nsContentUtils::HasNonEmptyAttr usage with Element::HasNonEmptyAttr; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129449
2021-10-27 09:59:06 +00:00
Ting-Yu Lin
cd552e71fe Bug 1736938 Part 4 - Remove unused LineBreaker and WordBreaker instances in nsContentUtils. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D129362
2021-10-25 19:00:23 +00:00
Edgar Chen
b60f0e846d Bug 1556354 - Part 3: Merge LifecycleCallback*Args; r=smaug
To make adding new callback a bit easier.

Differential Revision: https://phabricator.services.mozilla.com/D129190
2021-10-25 14:28:05 +00:00
Andrew McCreight
a4aaeb3501 Bug 1736707, part 2 - Remove nsContentUtils::sNameSpaceManager. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D129034
2021-10-22 16:15:58 +00:00
Andrew McCreight
3fcf223781 Bug 1736707, part 1 - Get rid of nsContentUtils::NameSpaceManager(). r=peterv
Call nsNameSpaceManager::GetInstance() instead.

Differential Revision: https://phabricator.services.mozilla.com/D129033
2021-10-22 16:15:57 +00:00
Masayuki Nakano
685412cb0a Bug 1734771 - part 3: Make AppendString() and AppendSubString() take const Text& instead of Text* r=m_kato
Depends on D128139

Differential Revision: https://phabricator.services.mozilla.com/D128140
2021-10-12 15:02:38 +00:00
Masayuki Nakano
ffa5244e07 Bug 1732845 - Add nsINode::IsInDesignMode() to check whether the node is directly in design mode r=smaug
There are a lot of check of `Document`'s editable state **with** comments. This
means that it's unclear for developers that only `Document` node is editable in
design mode.

Additionally, there are some points which use composed document rather than
uncomposed document even though the raw API uses uncomposed document. Comparing
with the other browsers, checking uncomposed document is compatible behavior,
i.e., nodes in shadow trees are not editable unless `contenteditable`.

Therefore, `nsINode` should have a method to check whether it's in design mode
or not.

Note that it may be called with a node in UA widget.  Therefore, this patch
adds new checks if it's in UA widget subtree or native anonymous subtree,
checking whether it's in design mode with its host.

Differential Revision: https://phabricator.services.mozilla.com/D126764
2021-10-12 03:14:43 +00:00
Emilio Cobos Álvarez
0c461e65a1 Bug 1734325 - Make the disable_xul_cache pref prevent chrome resources from getting cached. r=smaug
Do some drive-by clean-up, and remove telemetry for this since add-ons
can no longer tweak this pref.

Differential Revision: https://phabricator.services.mozilla.com/D127812
2021-10-07 13:29:00 +00:00
Tom Schuster
2025272982 Bug 1734320 - Expose structuredClone in Sandbox. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D127641
2021-10-06 16:10:44 +00:00
Edgar Chen
4929cc1a94 Bug 1556351 - Part 5: Make nsGenericHTMLFormControlElement implement nsIFormControl; r=smaug
nsGenericHTMLFormElement doesn't implement nsIFormControl now as HTMLElement would
inherit it to be able to be added into HTMLFormElement and HTMLFieldSetElement and
support some common form feature.

So some places that call the nsIFormControl method on nsGenericHTMLFormElement
directly would need to queryInterface it to nsIFormControl first, this should be
fine as those places are not in a hot path.

Differential Revision: https://phabricator.services.mozilla.com/D124788
2021-10-04 20:51:27 +00:00
Edgar Chen
9d872ddb7f Bug 1730117 - Part 1: Make sync XHR suppress event handling for the nested in-process documents; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125187
2021-09-22 14:50:55 +00:00
Sandor Molnar
635fadae49 Backed out 2 changesets (bug 1730117) for causing wpt failures in no_window_open_when_term_nesting_level_nonzero. CLOSED TREE
Backed out changeset bafc4ddc87f6 (bug 1730117)
Backed out changeset 27a1d92e550c (bug 1730117)
2021-09-21 18:00:06 +03:00
Edgar Chen
9f47b51303 Bug 1730117 - Part 1: Make sync XHR suppress event handling for the nested in-process documents; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125187
2021-09-21 11:39:45 +00:00
Butkovits Atila
38784b62b3 Backed out 2 changesets (bug 1730117) for causing failures at test_suppressed_events_nested_iframe.html. CLOSED TREE
Backed out changeset 649984f4a939 (bug 1730117)
Backed out changeset 37a35b6b54b4 (bug 1730117)
2021-09-21 00:38:17 +03:00
Edgar Chen
23fb0db47f Bug 1730117 - Part 1: Make sync XHR suppress event handling for the nested in-process documents; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125187
2021-09-20 19:23:52 +00:00
Jonathan Kew
3bc46238bf Bug 1729642 - patch 2 - Make nsContentUtils hold a strong reference to the nsNameSpaceManager. r=emilio
Depends on D125587

Differential Revision: https://phabricator.services.mozilla.com/D125588
2021-09-14 18:51:50 +00:00
Benjamin Peterson
edb1f747b4 Bug 1729843 - Remove vestigial plugin-related code from nsWebNavigationInfo. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125026
2021-09-09 15:03:05 +00:00
Edgar Chen
4a5f7e38ae Bug 1729800 - Convert nsExtendedDOMSlots::mCustomElementData to UniquePtr; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124987
2021-09-09 13:23:03 +00:00
Emilio Cobos Álvarez
5217ea7f29 Bug 1729477 - Tweak SubresourceCacheValidationInfo to account for chrome uris. r=tnikkel
Turns out my patch above causes some failures because chrome:// channels
don't have cache information, so we conservatively assume they always
expire, which causes some interesting timing issues in a single test.
Fun stuff.

Tweak the code so that SubresourceCacheValidationInfo has the
pre-existing data:// URI special-case and also special-cases chrome://
URIs.

Differential Revision: https://phabricator.services.mozilla.com/D124921
2021-09-09 09:32:11 +00:00
Sandor Molnar
d67f868876 Backed out 3 changesets (bug 1729477) for causing devtools failures in browser_webconsole_sidebar_object_expand_when_message_pruned. CLOSED TREE
Backed out changeset 8cbf3101ed8a (bug 1729477)
Backed out changeset 7457834fb7d0 (bug 1729477)
Backed out changeset 1259d2d1f247 (bug 1729477)
2021-09-09 03:55:31 +03:00
Emilio Cobos Álvarez
e43fdcf427 Bug 1729477 - Tweak SubresourceCacheValidationInfo to account for chrome uris. r=tnikkel
Turns out my patch above causes some failures because chrome:// channels
don't have cache information, so we conservatively assume they always
expire, which causes some interesting timing issues in a single test.
Fun stuff.

Tweak the code so that SubresourceCacheValidationInfo has the
pre-existing data:// URI special-case and also special-cases chrome://
URIs.

Differential Revision: https://phabricator.services.mozilla.com/D124921
2021-09-08 21:03:02 +00:00
Neil Deakin
78cc48328e Bug 1727176, use window contexts for the drag and drop source, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D123520
2021-08-31 00:58:34 +00:00
Edgar Chen
685690e0c7 Bug 1726393 - Part 2: Rename nsIFormControl::GetFormElement to GetForm; r=smaug
Depends on D122995

Differential Revision: https://phabricator.services.mozilla.com/D122996
2021-08-19 09:20:24 +00:00
Paul Zuehlcke
a44206bcfe Bug 1658578 - Remove nsContentUtils::IsThirdPartyWindowOrChannel. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D122272
2021-08-11 10:37:18 +00:00
Kagami Sascha Rosylight
311392e8cc Bug 1723050 - Part 2: Replace typedef by using in dom/base/ r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D121294
2021-08-02 14:40:41 +00:00
Jonathan Kew
c5b0682761 Bug 1722763 - Don't let ::first-letter break Regional-Indicator flag ligatures. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D121373
2021-07-31 08:54:07 +00:00
Sandor Molnar
c1a16b0ea1 Backed out changeset 5ae8ad2a0901 (bug 1722763) for causing wpt failures in /css/selectors/first-letter-flag-001. CLOSED TREE 2021-07-31 01:47:09 +03:00
Jonathan Kew
747af1b11f Bug 1722763 - Don't let ::first-letter break Regional-Indicator flag ligatures. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D121373
2021-07-30 18:18:24 +00:00
Matt Woodrow
8964031845 Bug 1721537 - Split out WindowRenderer base class from LayerManager. r=miko
Depends on D120439

Differential Revision: https://phabricator.services.mozilla.com/D120440
2021-07-22 22:58:57 +00:00
Matt Woodrow
4df1e6d64a Bug 1721537 - Simplify nsIWidget::GetLayerManager by removing unused parameters. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D120439
2021-07-22 22:58:57 +00:00
Tooru Fujisawa
0986662ce6 Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Masayuki Nakano
627e7c3853 Bug 1713758 - Make everyone outside editor module use EditorBase instead of TextEditor if the instance can be an HTMLEditor instance r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D117119
2021-06-09 23:51:37 +00:00
Emilio Cobos Álvarez
3daca083b1 Bug 1715134 - Make form control type an enum class. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117087
2021-06-08 09:43:59 +00:00
Edgar Chen
58e1cf918c Bug 1714313 - Get rid of FrameLoader::SendCrossProcessMouseEvent; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116707
2021-06-03 13:47:02 +00:00
Edgar Chen
492d02e96b Bug 1685421 - Part 2: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in nsINode; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113344
2021-06-02 13:43:39 +00:00
Hiroyuki Ikezoe
761f9e8b40 Bug 1481923 - Make nsContentUtils::SendMouseEvent return the information where preventDefault() was called. r=masayuki
On a long press touch event we fire a contextmenu event and if the contextmenu
is opening, we fire a touchcancel event. Unfortunately we had been checking
the return value, nsEventStatus, from nsIWidget::DispatchInputEvent via
nsContentUtils::SendMouseEvent to tell whether the context menu is opening or
not. So, we unintentionally fire the touchcancel event if the context menu is
NOT going to be opened because of preventDefault() in a contextmenu event
listener in the content itself.

NOTE: The oparator<< for the new PreventDefaultResult enum will be used in
APZ logging code.

[1] https://searchfox.org/mozilla-central/rev/95c41d54c3fd65d51976d5188842a69b459a7589/mobile/android/actors/ContentDelegateChild.jsm#100

Differential Revision: https://phabricator.services.mozilla.com/D115963
2021-06-01 05:47:29 +00:00
Kagami Sascha Rosylight
31e4582087 Bug 1710317 - Part 1: Add MouseButton::eEraser r=aklotz,edgar
Differential Revision: https://phabricator.services.mozilla.com/D115508
2021-05-31 13:39:18 +00:00
Emilio Cobos Álvarez
a693a8829a Bug 1712198 - Unwrap object in IsCallerChromeOrErrorPage. r=edgar
This is what e.g. our use counter setup does:

  https://searchfox.org/mozilla-central/rev/6e630edb09c3ab06d0103665b16c9ea7dce782c5/dom/bindings/BindingUtils.cpp#4037

Differential Revision: https://phabricator.services.mozilla.com/D115689
2021-05-25 13:02:59 +00:00
Emilio Cobos Álvarez
cb5d450742 Bug 1710756 - Use WindowGlobalOrNull rather than WindowOrNull in IsCallerChromeOrErrorPage. r=mccr8
WindowOrNull only works if the object is a window (or document,
apparently), but won't work more generally. Use the global of the
object instead so that it works for properties exposed on Element.

Differential Revision: https://phabricator.services.mozilla.com/D115030
2021-05-12 23:38:46 +00:00
Emilio Cobos Álvarez
cd4c73d3b8 Bug 1710756 - Expose FocusOptions.preventsFocusRing to error pages. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D114910
2021-05-12 10:47:50 +00:00
Emilio Cobos Álvarez
b7f648be74 Bug 1709577 - Check list of available images before deciding to defer a lazy load. r=edgar
As per https://html.spec.whatwg.org/#updating-the-image-data step 6.

Differential Revision: https://phabricator.services.mozilla.com/D114353
2021-05-07 13:56:33 +00:00
Dorel Luca
3eacfad31f Backed out 2 changesets (bug 1709577) for WPT Failures in /html/semantics/embedded-content/the-img-element/image-loading-lazy-base-url.html. CLOSED TREE
Backed out changeset ceed6d7fca1c (bug 1709577)
Backed out changeset bb44c14b754f (bug 1709577)
2021-05-07 16:46:48 +03:00
Emilio Cobos Álvarez
6302e3acc0 Bug 1709577 - Check list of available images before deciding to defer a lazy load. r=edgar
As per https://html.spec.whatwg.org/#updating-the-image-data step 6.

Differential Revision: https://phabricator.services.mozilla.com/D114353
2021-05-07 11:44:15 +00:00
Sandor Molnar
c7dc20560e Backed out 2 changesets (bug 1709577) for causing wpt failures. CLOSED TREE
Backed out changeset 0da1dba1749c (bug 1709577)
Backed out changeset bab974107b3b (bug 1709577)
2021-05-07 05:34:43 +03:00