Commit Graph

347 Commits

Author SHA1 Message Date
Ben Kelly
64d85c2b66 Bug 1293277 P1 Capture StorageAccess when snapshoting ClientSource state. r=baku 2017-12-12 15:44:46 -05:00
Edgar Chen
9f4324f41e Bug 1416999 - Remove document.registerElement; r=smaug
MozReview-Commit-ID: HiX07Vbljhk

--HG--
rename : dom/base/test/chrome/registerElement_ep.js => dom/base/test/chrome/custom_element_ep.js
rename : dom/base/test/chrome/frame_registerElement_content.html => dom/base/test/chrome/frame_custom_element_content.html
rename : dom/base/test/chrome/test_registerElement_content.xul => dom/base/test/chrome/test_custom_element_content.xul
rename : dom/base/test/chrome/test_registerElement_ep.xul => dom/base/test/chrome/test_custom_element_ep.xul
rename : dom/base/test/test_document_register.html => dom/base/test/test_custom_element.html
rename : dom/tests/mochitest/webcomponents/test_document_register.html => dom/tests/mochitest/webcomponents/test_custom_element_define.html
rename : dom/tests/mochitest/webcomponents/test_document_register_parser.html => dom/tests/mochitest/webcomponents/test_custom_element_define_parser.html
rename : dom/tests/mochitest/webcomponents/test_template_custom_elements.html => dom/tests/mochitest/webcomponents/test_custom_element_template.html
extra : rebase_source : cd2ebf166e8bd9c49910387c9136d7b83b51598d
2017-11-16 12:23:15 +08:00
Dave Townsend
27380b996e Bug 1404420: Add custom element support to XUL. r=edgar, r=smaug
MozReview-Commit-ID: BietEX2gOoG

--HG--
extra : rebase_source : 6fd9a732a21f2c048d37c3f7139cd18503148767
2017-10-10 15:25:10 -07:00
Brian Birtles
bad7dc839d Bug 1412765 - Add dom.animations-api.pending-member.enabled, defaulting to false; r=hiro
MozReview-Commit-ID: 7P34nAI7apB

--HG--
extra : rebase_source : 94cf46522b995c40b1649a4d8ce44cd868026869
2017-11-21 09:43:40 +09:00
Tiberius Oros
da0a72a9d7 Merge inbound to mozilla-central r=merge a=merge 2017-11-24 00:28:29 +02:00
Nika Layzell
c89dc4dbb4 Bug 1419597 - Part 11: Move gRefCnt/gSerialCounter into nsContentUtils, r=smaug
MozReview-Commit-ID: KkG6hQentSH
2017-11-23 13:12:01 -05:00
Nika Layzell
920ec9caac Bug 1419144 - Part 15: Move PopupControlState into nsContentUtils, r=smaug
MozReview-Commit-ID: Kt2moF5nsDg
2017-11-23 13:11:34 -05:00
Nika Layzell
e005db891d Bug 1419144 - Part 8: Move TryGetTabChildGlobalAsEventTarget into nsContentUtils, r=smaug
MozReview-Commit-ID: 8vi1mAzmQUU
2017-11-23 13:11:23 -05:00
Nika Layzell
153cad2eb5 Bug 1419144 - Part 1: Move ShouldShowFocusRingIfFocusedByMouse into nsGlobalWindowInner.cpp, r=smaug
MozReview-Commit-ID: 7m5ZJ52bkRs
2017-11-23 13:11:12 -05:00
Edgar Chen
b3ea0a20d4 Bug 1419310 - Part 1: Remove nsContentUtils::GetElementDefinitionIfObservingAttr; r=smaug
MozReview-Commit-ID: 9yMrwDC0kYr

--HG--
extra : rebase_source : 9fb1da4986eb2af50746ae432088d3788b99570c
2017-11-23 00:09:03 +08:00
Nika Layzell
c79cb497d1 Bug 1419090 - Remove StableStateEventTarget, r=smaug
MozReview-Commit-ID: 7dYAkp9bEGQ
2017-11-20 17:55:33 -05:00
Jan de Mooij
d66dc34955 Bug 1417895 part 1 - Move ParseJavascriptVersion from nsContentUtils to ScriptLoader.cpp. r=bz 2017-11-18 23:16:05 +01:00
Edgar Chen
698fdbc62e Bug 1396620 - Part 1: Remove created callback for custom elements; r=jdai,smaug
MozReview-Commit-ID: IDovq3OZwgy

--HG--
extra : rebase_source : bae891833d4f8139fed2ed31af85173694c7eb11
2017-10-13 23:36:54 +08:00
John Dai
a710f595fa Bug 1406325 - Part 5: Implement try to upgrade. f=echen, r=smaug 2017-11-14 19:25:00 +08:00
John Dai
d1400ac8b1 Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0. f=echen, r=smaug 2017-11-14 19:23:00 +08:00
Neil Deakin
695749c30c Bug 380637, move reserved key checking into ContentUtils so that it can be shared with menu accesskey checks , r=felipe 2017-11-09 18:42:39 -05:00
Bevis Tseng
6115852e16 Bug 1409985 - Don't fire DOMEvent during StableState. r=smaug 2017-10-19 18:20:31 +08:00
Yoshi Huang
26c9043304 Bug 1407498 - Don't query loadingprincipal in common case. r=baku
We queried 'loadingprincipal' attribute on the common call path, however
this should be queried if it's loaded by System Principal.

Also rename loadingprincipal to triggeringprincipal
2017-10-24 10:13:31 +08:00
Kris Maglione
d72aa193c4 Bug 1406278: Part 2b - Use subject principal as triggering principal in <img> "src" attribute. r=bz
MozReview-Commit-ID: DrblTjP99WJ

--HG--
extra : rebase_source : 649cf6757266c9e08a3f5a621c3e9451a7ccef67
2017-10-02 20:28:32 -07:00
Nicholas Nethercote
d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Olli Pettay
478b3b1343 Bug 1405821 - Move microtask handling to CycleCollectedJSContext, r=baku 2017-10-05 18:34:12 +03:00
Valentin Gosu
3fba909015 Bug 1403926 - Add pref for PerformanceNavigationTiming r=baku
MozReview-Commit-ID: 9f6fcCk8mh

--HG--
extra : rebase_source : 0a1252a7cff2cfaec8f0ab5f8ffa755a0a8a4b5e
2017-10-04 02:48:33 +02:00
Nika Layzell
7a623e996f Bug 1399626 - Part 3: Add a variant of ComparePoints to nsContentUtils which takes RangeBoundaries, r=masayuki
This is a temporary implementation, which will hopefully be fleshed out in the
future to not require calling the `Offset()` methods. Currently it just
dispatches to the existing implementation using Container() and Offset().

MozReview-Commit-ID: 9Zssbhzrnz3
2017-10-02 11:57:59 -04:00
John Dai
25f8ec6929 Bug 1121994 - Implement adopted callback for custom elements. r=smaug 2017-10-02 00:42:00 -04:00
Gabor Krizsanits
481bdfb4f4 Bug 1404383 - Delay nsStringBundle preloading in content processes. r=smaug
Early in the startup the channel creation might fail,
in nsStringBundle load and any further attempts are prevented which
leads to broken ocaization support for the process. Let's wait until
the child process learns about the chrome URLs registered on the parent
side with the preloads.
2017-09-29 17:54:06 +02:00
Xidorn Quan
e69b3c7976 Bug 1403024 part 1 - Add nsContentUtils::SchemeIs helper function. r=bholley
MozReview-Commit-ID: 2NVc5QJSjl

--HG--
extra : rebase_source : 5d25c9c507eaa2a08d68c331a8ba9d304c97f305
2017-09-26 10:21:01 +10:00
Nicholas Nethercote
dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Jessica Jong
dea7ea236c Bug 1334043 - Part 2: Make nsContentUtils::EnqueueLifecycleCallback static. r=smaug
We make nsContentUtils::EnqueueLifecycleCallback static so that it can be
called without a window object. To achive this, we also make
CustomElementReaction not taking a CustomElementRegistry in the constructor,
as it can call Upgrade statically.

MozReview-Commit-ID: 7xUvK0q7Eri
2017-09-26 13:56:00 +08:00
Yoshi Huang
58d0d5ec00 Bug 1376971 - Part 2: add GetLoadingPrincipalForXULNode. r=baku
Refactor GetContentPolicyTypeForUIImageLoading to have another function
called GetLoadingPrincipalForXULNode.
2017-09-26 12:41:19 +08:00
John Dai
cc16112226 Bug 1301024 - Part 2: Implement create an element steps. r=smaug 2017-09-25 01:33:00 -04:00
Kershaw Chang
53cf0a2a8e Bug 1247843 - Part 3: Set request context ID to the http channel created in imgLoader::LoadImage. r=baku
In order to let necko postpone the load of favicon, we have to set request context ID to the http channel that is created to load favicon.
This patch starts with passing a request context ID to nsContentUtils::LoadImage and makes other necessary changes to set the request context ID to the channel.
2017-09-20 20:09:00 -04:00
Ben Kelly
81c05e42c3 Bug 1336364 P6 Ensure that we don't control a document if its window cannot access storage. r=asuth 2017-09-20 09:24:07 -07:00
Josh Matthews
a323bdfe53 Bug 1397971 - Share strings in URLDataValue with Rust. r=heycam
--HG--
extra : amend_source : 7946c76a40240baac44db6c1c6c7b0117ced4219
2017-09-15 13:11:37 -07:00
Nicholas Nethercote
2ef37710e7 Bug 1395828 (part 4) - Remove nsIParserService/nsParserService. r=mrbkap.
It a stateless wrapper around static methods in nsHTMLTags and nsHTMLElement,
and hence an unnecessary layer of indirection that just adds complexity and
slowness. This patch removes it, cutting almost 300 lines of code.

This requires making nsElementTable.h an exported header, to expose the
nsHTMLElement methods.

--HG--
extra : rebase_source : abbcb8e5001389affbf717092213b898673db07f
2017-09-05 20:19:06 +10:00
Kris Maglione
04acc0aace Bug 1396449: Part 2 - Use atoms to test WebExtension permissions. r=krizsa
The extension policy services uses atoms internally for permission names, so
using them directly rather than strings is considerably cheaper.

MozReview-Commit-ID: Io8EuOXHKVy

--HG--
extra : rebase_source : 577b4bdf7f899729e4cf92961a8e9e25bf886a72
2017-09-03 18:51:02 -07:00
Sebastian Hengst
43bc951ac7 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: ES9rKhiQo10
2017-09-01 10:38:51 +02:00
Honza Bambas
8d492fe637 Bug 1395525 - Make all changes landed as part of tracker request tailing preferrable. r=dragana 2017-08-31 06:07:00 -04:00
Alexandre Poirot
3675c8a0f9 Bug 1382377 - Make Console API be a no-op until DevTools are opened at least once. r=baku,jdescottes
MozReview-Commit-ID: 4xuzRQKH3Vg

--HG--
extra : rebase_source : f388a7222df314c988c3af20afb59684cc1045e5
2017-08-08 16:29:34 +02:00
Ehsan Akhgari
399ce96953 Bug 1392891 - Part 3: Avoid creating live nsContentList objects in nsContentUtils::GenerateStateKey(); r=smaug 2017-08-29 07:30:26 -04:00
Sebastian Hengst
c46e62224e merge mozilla-central zo mouilla-inbound. r=merge a=merge on a CLOSED TREE 2017-08-28 17:10:37 +02:00
Jessica Jong
18378d0e3a Bug 1334051 - Part 2: Invoke attributeChangedCallback only if attribute name is in the observed attribute list. f=jdai, r=smaug
We call attributeChangedCallback in two cases:
1. When any of the attributes in the observed attribute list has changed,
   appended, removed, or replaced.
2. When upgrading an element, for each attribute in element's attribute list
   that is in the observed attribute list.

MozReview-Commit-ID: LKUY5ibp9RI
* * *
Bug 1334051 - Part 3: Optimize attributeChanged callbacks. r=smaug
2017-08-27 23:25:00 -04:00
Bobby Holley
8fb4fb3d6c Bug 1393791 - Stop unbinding native-anonymous content off a script runner. r=emilio
The failure mode in the attached crashtest is an inconsistency in the flattened
tree. Specifically, we null out mVideoControls in an nsVideoFrame, but defer
the UnbindFromTree call on that NAC element, which measn that its mParent still
points to the nsVideoFrame's mContent. Because all this stuff runs off of script
runners, and the anonymous content destroyer is not guaranteed to run before
other potential script runners, we end up running arbitrary script while the
tree mismatch exists. This script calls back into ProcessPendingRestyles, which
causes trouble.

We could build a separate deferral mechanism, but it's not clear that we actually
need to defer the unbind anymore. The deferred unbind was added in bug 489008,
which predated a lot of simplifications in layout/dom interaction.

MozReview-Commit-ID: 1JYAhiXKVJC
2017-08-27 15:29:36 -07:00
Emilio Cobos Álvarez
5cdfa5f417 Bug 1394935: Introduce nsContentUtils::CommonFlattenedTreeAncestorForStyle. r=bholley
MozReview-Commit-ID: GThZUOIe30o

--HG--
extra : rebase_source : a57f6370d47f2d6fab46e444b001a487f20582d6
2017-08-31 09:42:24 +02:00
Emilio Cobos Álvarez
228b799fe3 Bug 1394935: Introduce ContentIsFlattenedTreeDescendantOfForStyle. r=bholley
MozReview-Commit-ID: 69w9nnRJsIy

--HG--
extra : rebase_source : 7d1dd261f427d49095ceb2f8952ceed4f6175c12
2017-08-31 19:42:06 +02:00
Michael Layzell
76fb615887 Bug 1384238 - Annotate BHR hangs which occur while there is a pending input event, r=smaug
MozReview-Commit-ID: HRPMw2IfEKB
2017-08-15 16:36:28 -04:00
Masayuki Nakano
b11e66f8da Bug 1388004 - part1: Make nsContentUtils::GetHTMLEditor() return HTMLEditor* rather than nsIEditor* r=smaug
nsContentUtils::GetHTMLEditor() currently returns nsIEditor* since editor of doc shell may be any type of editors such as TextEditor or editor object which is implemented by JS.  However, nsIEditor is now a builtin class.  So, it can return HTMLEditor.

MozReview-Commit-ID: 3YoFOplZa7W

--HG--
extra : rebase_source : 46f42d23babd64bf0a5003e66e8fe3b9e0bd7166
2017-08-07 16:33:59 +09:00
Wes Kocher
5a4357c768 Merge inbound to central, a=merge
MozReview-Commit-ID: GArkKmOFIVH
2017-08-11 13:15:33 -07:00
Tim Huang
7af48eb06f Bug 1369309 - Part 3: Making the media statistics reports a spoofed value when fingerprinting resistance is enabled. r=cpearce, r=arthuredelstein
This patch makes the media statistics report values with a fixed frames per second
and a dynamic dropped ratio when resistance fingerprinting is enabled. The dropped
rate is decided by the video resolution that it will report a fixed dropped rate
when the video resolution is greater than 480p. And It will report a zero dropped
rate if the video is below or equal to 480p. In addition, it adds three new prefs
that allow us to change the value of frames per second, the dropped ratio and the
threshold of target video resolution. The three prefs are
'privacy.resistFingerprinting.video_frames_per_sec', 'privacy.resistFingerprinting.video_dropped_ratio'
and 'privacy.resistFingerprinting.target_video_res'. The default values of them
are 30, 5 and 480, which means 30 frames per second, 5 percent dropped ratio and
480p.

This also adds a new helper function 'nsContentUtils::ShouldResistFingerprinting(nsIDocument* aDoc)'
for checking whether fingerprinting resistance is enabled for a given docuemnt.
If it is a chrome document, this function will indicate that fingerprinting
resistance is not enabled regardless of the pref 'privacy.resistFingerprinting'.
If it is a content document, the result will depend on the pref.

MozReview-Commit-ID: FbSuRq6Zdnn

--HG--
extra : rebase_source : a62a1be19d9b38520f9eed7164fb258e3354d228
2017-07-17 15:13:55 +08:00
Kirk Steuber
260150bd23 Bug 1377377 - Preload string bundles during idle time r=smaug
MozReview-Commit-ID: H0hNHmzBWhO

--HG--
extra : rebase_source : dd83a3d97f5f1245ec4e18dde65b58d610fbfccc
2017-08-04 09:26:04 -07:00
Nicholas Nethercote
f941156987 Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.

The patch also removes a couple of unused declarations from
nsIStringBundle.idl.

Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.

--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
2017-08-04 14:40:52 +10:00