Commit Graph

314 Commits

Author SHA1 Message Date
Ben Kelly
890e126aaa Bug 1293277 P6 Use the ClientInfo.Id() value for FetchEvent.clientId. r=baku 2017-12-12 15:44:48 -05:00
Jessica Jong
7fe15d1a52 Bug 1422931 - Part 2: Make webcomponents preference per-doc. r=smaug
This is to fix the case where preference is restore to false when a testcase
ends, but nsDocument::DeleteShell is called afterwards. So, we make the
preference per-doc and set it when the document is created. The value does not
change for the lifetime of the document.
2017-12-09 11:25:14 +08:00
Narcis Beleuzu
f0d93dda2c Backed out 2 changesets (bug 1422931) for crashtest failures on dom/base/crashtests/1419799.html r=backout on a CLOSED TREE
Backed out changeset 60d9744e3fc4 (bug 1422931)
Backed out changeset cf554d5d70cc (bug 1422931)
2017-12-08 18:27:56 +02:00
Jessica Jong
00fc818c22 Bug 1422931 - Part 2: Make webcomponents preference per-doc. r=smaug
This is to fix the case where preference is restore to false when a
testcas ends, but nsDocument::DeleteShell is called afterwards. So, we
make the preference per-doc and once it is enabled for a document, it
stays enabled.
2017-12-08 22:17:40 +08:00
Emilio Cobos Álvarez
1138344d9a Bug 1422633: Inline nsIDocument::ThreadSafeGetDocumentState(). r=smaug
It's silly to pay a function call for that, and it shows up in stylo-chrome
profiles.

MozReview-Commit-ID: 8m7ZHG1KX15
2017-12-05 14:20:07 +01: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
Alphan Chen
54f4537537 Bug 980904 - Disable the Character Encoding menu when document is decoded as UTF-8 without errors. r=hsivonen,emk,Gijs 2017-11-23 15:03:41 +08:00
Emilio Cobos Álvarez
ebfcd1dbd3 Bug 1414999: Synchronously clean style data from the DOM tree when the shell goes away. r=bz
There's nothing preventing the flat tree from changing while the document
doesn't have a shell. In that case, we really really don't want to lose track
of elements with stale style data, since then we'll mess up.

It's ok to _not_ clear the style data when the document goes into the BFCache
though, because the document is thrown away if other document runs script and
touches the cached DOM.

MozReview-Commit-ID: 4W3xDAnnLPL
2017-11-20 22:11:23 +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
arthur.iakab
cb136d6136 Backed out changeset ed0cc9f86583::b6b642efbb74 (bug 1396620) for static failure at dom/base/CustomElementRegistry.cpp r=backout on a CLOSED TREE
Backed out changeset b6b642efbb74 (bug 1396620)
Backed out changeset ed0cc9f86583 (bug 1396620)
2017-11-17 01:22:14 +02:00
Edgar Chen
fd6b408209 Bug 1396620 - Part 1: Remove created callback for custom elements; r=jdai,smaug
MozReview-Commit-ID: IDovq3OZwgy

--HG--
extra : rebase_source : 34b67e07a7e15af815c6921a41272ee0fddfb93d
2017-10-13 23:36:54 +08:00
Alastor Wu
3a54b06eb3 Bug 1415444 - part2 : add log. r=smaug
MozReview-Commit-ID: KFB3HiPuWeo

--HG--
extra : rebase_source : 80661ec9a176238fc965bacd08b43cbb09a121a4
2017-11-14 14:48:23 +08:00
Alastor Wu
00c469c134 Bug 1415444 - part1 : add flag to record whether the document has been activated by specific user gestures. r=smaug
This flag would be used to help us decide whether website could be allowed the autoplay.
The media related implementation would be implemented in bug1382574.

MozReview-Commit-ID: GGIauBufs5A

--HG--
extra : rebase_source : c407ceed311fc3fb0140e5da44fd69e457a5098f
2017-11-14 14:48:18 +08:00
Nika Layzell
c223b9ff2d Bug 1414974 - Part 6: Change WebIDL bindings to refer to nsGlobalWindowInner rather than nsGlobalWindow, r=bz
MozReview-Commit-ID: KbCpDFoWyTe
2017-11-09 10:44:49 -05:00
Sebastian Hengst
a353221537 merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-11-09 00:00:16 +02:00
Boris Zbarsky
272cbb590b Bug 1415176. Move getElementsByName from HTMLDocument to Document. r=mccr8
MozReview-Commit-ID: CRfrXC2x97S
2017-11-08 11:13:33 -05:00
Brad Werth
2a43297875 Bug 1412173 Part 1: Implement the Document ignore-opens-during-unload counter required by spec. r=bz
MozReview-Commit-ID: IWfT5c0H3t

--HG--
extra : rebase_source : 9a61f095a8c31ee3ac0f89b413d0cc62eec24292
2017-11-02 11:47:21 -07:00
Phil Ringnalda
81c6fb1b5b Backed out 2 changesets (bug 1412173) for unexpected passes in wpt's /html/browsers/browsing-the-web/unloading-documents/003.html
Backed out changeset 68de62dd7a9b (bug 1412173)
Backed out changeset 97de1e0cd693 (bug 1412173)

MozReview-Commit-ID: HiASSDNl4DD
2017-11-06 19:32:05 -08:00
Brad Werth
28b0ab34dc Bug 1412173 Part 1: Implement the Document ignore-opens-during-unload counter required by spec. r=bz
MozReview-Commit-ID: IWfT5c0H3t

--HG--
extra : rebase_source : d0c03ea38bf4d33ca7ac8ee7696936bdb3ea7518
2017-11-02 11:47:21 -07:00
Henri Sivonen
080aa07386 Bug 1412866 - Use spec nomenclature for the ignore-destructive-writes counter. r=smaug
MozReview-Commit-ID: FKwbEZll95J

--HG--
extra : rebase_source : b42a7a17434f1c711c395fd5a09893cac81b7a9d
2017-10-30 17:45:09 +02:00
Eden Chuang
6b14fc7125 Bug 1403079 - Add mAllowPaymentRequest and related methods on nsIDocument to check if PaymentRequest API is allowed to use. r=smaug
Add a new member mAllowPaymentRequest on nsIDocument and following related
methods,
  bool AllowPaymentRequest() const
  void SetAllowPaymentRequest(bool aAllowPaymentRequest)
mAllowPaymentRequest is used to check if PaymentRequest is allowed to use on
the document. According to the spec
  https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use
the mAllowPaymentRequest should be true under following situations
  1. The document is the top level content document.
  2. The document is the same origin with its parent document and its parent
     document's mAllowPaymentRequest is true.
  3. The document is different origin with its parent document but its
     parent node is an iframe with allowpaymentrequest flag and the parent
     document's mAllowPaymentRquest is true.

This patch also include following mochitests
  1. test for allowpaymentrequest flag changing. The flag change effect should
     not be applied to the document immediately, it should be updated while
     the browsing context is updated.
  2. test for effect propagation in the nested iframe.
2017-10-19 15:56:51 +08:00
Jessica Jong
d70b8d543c Bug 1378079 - Part 2: Introduce throw-on-dynamic-markup-insertion counter. r=hsivonen
Per spec, document objects have a throw-on-dynamic-markup-insertion counter,
which is used in conjunction with the create an element for the token algorithm
to prevent custom element constructors from being able to use document.open(),
document.close(), and document.write() when they are invoked by the parser.

--HG--
extra : rebase_source : 7cbc10c77765b84bbaf07a05f205f02169a79ee0
2017-10-26 14:08:35 +08:00
Emilio Cobos Álvarez
d631a75643 Bug 1410074: Make the caller type from MatchMedia arrive to the CSS code. r=xidorn,bz
MozReview-Commit-ID: LUiobfHSUq1
2017-10-25 16:04:48 +02:00
Cameron McCormack
a341b24925 Bug 1409992 - Allow SVG as images to load data: URL images. r=edgar
MozReview-Commit-ID: KMirRmkLBVa

--HG--
extra : rebase_source : 6d40f52cc7318d11dddda74e9bf9386c35d15ed5
2017-10-19 18:00:43 +08:00
Sebastian Hengst
edc6c5e2b9 Backed out changeset 725b9a93a191 (bug 1409992) for frequently failing layout/reftests/svg/foreignObject-img.html. r=backout
--HG--
extra : amend_source : 4c16e1f7dba810a1a2d0eee795e0c9c0d907087e
2017-10-20 11:23:28 +02:00
Cameron McCormack
6e4f600c67 Bug 1409992 - Allow SVG as images to load data: URL images. r=edgar
MozReview-Commit-ID: KMirRmkLBVa

--HG--
extra : rebase_source : fdbf2a5964eb50c67b825b3326c8034261620a49
2017-10-19 18:00:43 +08:00
Emilio Cobos Álvarez
2f8b5b12a4 Bug 1407864: Do not thrash the selector cache when parsing the same selector with different backend. r=heycam
Since the presence of an entry with a null selector is different for Gecko and
Servo, this seemed easier, and mimics nsLayoutStyleSheetCache.

Also, this is going away soon anyway as soon as I get to implement the rest of
the methods for stylo.

MozReview-Commit-ID: DtHJbw8C0GX

--HG--
extra : rebase_source : dd450a6972054971eba8bba5bb022b74d07c2a0b
2017-10-12 10:07:25 +02:00
evilpies@gmail.com
06beef32ba Bug 1305237 LoadInfo changes to include all ancestors principals and window IDs, r=bz,mystor
MozReview-Commit-ID: 1IMi5MqTx7o

--HG--
extra : rebase_source : 373f1928987718fe3bc22306e0dd3ae13fc0cd9f
2017-10-10 09:54:00 -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
Emilio Cobos Álvarez
c3d21f55ab Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT

--HG--
extra : rebase_source : 90d4a61bcc65995ca8a130cd24582e4f20d52276
2017-10-02 15:32:07 +02:00
Sebastian Hengst
635c45113c Backed out changeset 9a8f77f3dfe7 (bug 1404897) 2017-10-04 12:55:16 +02:00
Emilio Cobos Álvarez
dd2d07a12c Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT

--HG--
extra : rebase_source : 42de988406724fd3dbb11134cb454bbfc927e3a6
2017-10-02 15:32:07 +02:00
Sebastian Hengst
82e62e8f75 Backed out changeset 2a7dd15c8206 (bug 1404897) 2017-10-04 11:24:31 +02:00
Emilio Cobos Álvarez
8fea520510 Bug 1404897: Allow storing Servo selector lists in the document's selector cache. r=heycam
MozReview-Commit-ID: GtIWGN2zEGT
2017-10-04 11:01:37 +02:00
Wes Kocher
7c7aca4ea6 Backed out 2 changesets (bug 1305237) for crashtest failures in 403574-1.xhtml and 1282985-1.svg a=backout
Backed out changeset 96b5d596cc27 (bug 1305237)
Backed out changeset 5fe72402746f (bug 1305237)

MozReview-Commit-ID: CjCWY73Hps1

--HG--
extra : rebase_source : 7a9f0893dabdb0cb6ea79cc9cb7169ceed14616f
2017-10-02 16:41:56 -07:00
evilpies@gmail.com
af192f668f Bug 1305237 LoadInfo changes to include all ancestors principals and window IDs, r=bz
MozReview-Commit-ID: ADVtxjSQjk5

--HG--
extra : rebase_source : 6e0ddf49328d7ae71937b7bbe5e5bea736c49bef
2017-10-02 11:05:33 -07:00
John Dai
25f8ec6929 Bug 1121994 - Implement adopted callback for custom elements. r=smaug 2017-10-02 00:42:00 -04:00
Jessica Jong
9c73bf3115 Bug 1334044: Replace detached callback (v0) with disconnected callback (v1). r=smaug
MozReview-Commit-ID: 8jxFK1fze15
2017-09-26 13:56:11 +08:00
Jessica Jong
dca1a68e1a Bug 1334043 - Part 1: Replace attached callback (v0) with connected callback (v1). r=smaug
MozReview-Commit-ID: 3qQh4viyvBX
2017-09-26 13:55:58 +08:00
Wei-Cheng Pan
5e7583d760 Bug 1363805 - Part 1: Add a flag to nsIDocument::FlushPendingNotifications. r=heycam
This flag indicates that document can flush parent-document only or need to do
the normal flushing.

MozReview-Commit-ID: L9KZA6jNsOz

--HG--
extra : rebase_source : ac794a5dbcd4aab8d691ebcc3804ec208755a716
2017-05-23 10:27:13 +08:00
Kris Maglione
0c3a1b9b7e Bug 1379148: Part 1 - Allow blocking only non-script-created parsers. r=hsivonen
MozReview-Commit-ID: 8cGxywiUzWj

--HG--
extra : rebase_source : b684a4a7d00c141a3def4f1cde9d7463c12baa4b
2017-09-20 16:12:27 -07:00
Boris Zbarsky
e3883c1255 Bug 1400501. Store a list of ancestor principals on docshell and document. r=mystor
Right now every document in a docshell makes a copy of the list.  In practice,
this list is usually pretty short (limited by depth of iframe nesting), so this
is probably not a problem.  We could add a bit of complexity and have a
refcounted struct that contains the list... I wish we had something as simple
as Rust's Arc that we could use here.

MozReview-Commit-ID: 8jGIlkhp1DU
2017-09-18 21:24:38 -04:00
Masatoshi Kimura
f7995f942e Bug 1400207 - Remove nsIDocument::AddCharSetObserver. r=hsivonen
MozReview-Commit-ID: 7uWDQvyz4yC

--HG--
extra : rebase_source : c8955e6b090d9084938c290f096b41b9090ec71c
2017-09-14 23:19:22 +09:00
Henri Sivonen
3c8567b60d Bug 1354989 - Avoid pivoting via UTF-16 when loading CSS in the Stylo mode. r=jdm,SimonSapin
MozReview-Commit-ID: Llt29dvB4Io

--HG--
extra : rebase_source : 3ae51dc8beff3fb19e9318a6c7c30c9ab08a5b57
2017-08-29 16:01:42 +03:00
Blake Kaplan
d9ad239a35 Bug 1325923 - Implement the "cookie averse document" concept. r=Ehsan
See https://html.spec.whatwg.org/multipage/dom.html#resource-metadata-management:cookie-averse-document-object

MozReview-Commit-ID: GndxqhU77cS
2017-08-28 16:41:42 -07:00
Yoshi Huang
df6bad1c1e Bug 1373780 - Part 3: add isImgSet argument. r=jdm
Per mixed-content-blocked spec, [1], <img srcset> and <picture> should
be blocked. However we still fetch <img srcset> and <picture> in image
preload, because they are fetched with contentPolicyType
TYPE_INTERNAL_IMAGE_PRELOAD and won't be rejected by nsMixedContentBlocker.cpp.

So I updated the image preloading code, and use the type TYPE_IMAGESET
if the image request is for <picture> or <img srcset>, otherwise for
normal image load we still use TYPE_INTERNAL_IMAGE_PRELOAD.

[1]: https://w3c.github.io/webappsec-mixed-content/#should-block-fetch
  4. Return allowed if one or more of the following conditions are met:
     request’s type is "image", and initiator is not "imageset".
  5. Return blocked.
2017-08-24 18:10:54 +08:00
Eric Rahm
a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Bobby Holley
7210bd7226 Bug 1383332 - Track the restyle root and use it to do less work during the traversal. r=emilio
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 21:19:24 -07:00
Masayuki Nakano
a7240d8532 Bug 1391538 - nsTextFragment for text nodes in <input> or <textarea> shouldn't store text as single byte characters even if all characters are less than U+0100 r=smaug
nsTextFrame stores text as single byte character array if all characters are
less than U+0100.  Although, this saves footprint, but retrieving and modifying
text needs converting cost.  Therefore, if it's created for a text node in
<input> or <textarea>, it should store text as char16_t array.

MozReview-Commit-ID: 9Z82rketT7g

--HG--
extra : rebase_source : 59f59ac1488c21a57d95d253cc794a011d672c95
2017-08-18 16:05:16 +09:00
Bobby Holley
d42f0733ac Bug 1389300 - Inherit style backend into NS_NewDOMDocument. r=smaug,r=heycam
Our current machinery for enabling stylo requires a docshell - if there isn't
one, we default to the Gecko style system.

When getComputedStyle operates on an element without a presshell, it uses the
caller's presshell instead. If the element has previously been styled with
one style system (but no longer has a presshell), and the caller uses a
different style backend, using the caller's style system can cause crashes when
we pull bits of cached data off the DOM (like cached style attributes).

So we want to throw when window.getComputedStyle(element) is called for a
(window, element) pair with different style backends (which is what the next
patch in this bug does).

However, that causes a few failures where stylo-backed documents try to do
getComputedStyle on an XHR document (which, without a docshell, will use the
gecko style system).

So this patch does some work to propagate the creator's style backend into
various docshell-less documents. This should allow both chrome (which uses gecko)
and content (which uses stylo) to use getComputedStyle on the response document
for XHRs they create.

Note that the second patch in this bug will make
chromeWin.getComputedStyle(contentObj) throw. If we discover code that does
that, we can just make it invoke the content's getComputedStyle method over Xrays.

MozReview-Commit-ID: 5OsmHJKq5Ui
2017-08-15 19:10:43 -07:00