Граф коммитов

90 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 131d0c6a02 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35622

--HG--
extra : moz-landing-system : lando
2019-07-06 08:18:28 +00:00
Emilio Cobos Álvarez e9ffa7cc6c Bug 1555497 - Make the code in nsXULPopupManager that finds the default insertion point for children handle Shadow DOM as well. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D34333

--HG--
extra : moz-landing-system : lando
2019-06-13 13:23:09 +00:00
Emilio Cobos Álvarez c4dbe4893c Bug 1505489 - Keep track of elements with part attributes in a shadow tree. r=bzbarsky
I need this to make style invalidation work with Shadow Parts in a way that's
fast. If something in the ancestor shadow root or any of its ancestor changes,
that makes a ::part() selector change, I don't want to walk the whole shadow
tree over and over in order to find the parts that I need to restyle.

Unfortunately we cannot just use the mutation observer setup from ShadowRoot
since, unlike for slotted elements, there's no restriction of where a part can
appear in the shadow tree.

That means that the regular nsIMutationObserver notifications don't quite cut
it, since we'd get notified only of subtree roots and we'd need to tree-walk
around in order to figure out if we have any new part.

I thought that I was going to be able to share more code with other bits if I
moved them away from nsIMutationObserver, thus bug 1554498, but in the end it
was not the case, so here's the "without bug 1554498" version of the patch.

The patch on top of that bug (that as I mention in the commit message I'm
ambivalent about whether we should land or not) should be pretty similar either
way.

Differential Revision: https://phabricator.services.mozilla.com/D32641

--HG--
extra : moz-landing-system : lando
2019-06-11 17:41:37 +00:00
Emilio Cobos Álvarez 9839cdb574 Bug 1546255 - When an @import stylesheet is cloned, we should also make sure to restyle. r=heycam
We need to notify the whole parent chain (using NOTIFY) rather than just
mStyleSets, since mStyleSets is empty for @import-ed sheets.

Differential Revision: https://phabricator.services.mozilla.com/D31787

--HG--
extra : moz-landing-system : lando
2019-05-22 06:01:51 +00:00
Emilio Cobos Álvarez cbd5883ebb Bug 1541016 - Add a generic TreeOrderedArray. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D25756

--HG--
extra : moz-landing-system : lando
2019-04-03 07:02:34 +00:00
Emilio Cobos Álvarez d073df2e6e Bug 1528675 - Rename NODE_CHROME_ONLY_ACCESS to NODE_HAS_BEEN_IN_UA_WIDGET, and use that to determine our wrapper scope. r=bzbarsky
It won't change then, even when removed from the UA Widget. It also gives us an
extra node bit.

Differential Revision: https://phabricator.services.mozilla.com/D20560

--HG--
extra : moz-landing-system : lando
2019-02-21 18:39:28 +00:00
Masayuki Nakano 2c46fac276 Bug 1518384 - Fix some lines which depend on |using namespace mozilla| and |using namespace mozilla::dom| in Document.cpp and Element.cpp r=smaug
After landing bug 1517241, some lines in Document.cpp and Element.cpp depend on
`using namespace mozilla` and `using namespace mozilla::dom` of *different*
cpp files.  Therefore, when you rename some cpp files in dom/base, you'll
hit compile error.

This patch fixes the dependency with moving some classes into mozilla namespace
and adding |mozilla::| or |dom::| to a couple of lines.

Differential Revision: https://phabricator.services.mozilla.com/D15897

--HG--
rename : dom/base/nsIdentifierMapEntry.h => dom/base/IdentifierMapEntry.h
extra : moz-landing-system : lando
2019-01-08 10:15:55 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez 83941ea4de Bug 1505887 - Make UAWidgets chromeonly content. r=bz
Differential Revision: https://phabricator.services.mozilla.com/D11408
2018-11-27 13:26:18 +01:00
Razvan Maries 1a6559c239 Backed out 4 changesets (bug 1505887, bug 1509989) for failing crashtests on tests/layout/style/crashtests/1509989.html on a CLOSED TREE.
Backed out changeset dc6c022e9fe1 (bug 1509989)
Backed out changeset 490a99122a7f (bug 1505887)
Backed out changeset 7b9afff4ff11 (bug 1505887)
Backed out changeset 15da6e919d80 (bug 1505887)
2018-11-27 14:10:30 +02:00
Emilio Cobos Álvarez 13f4dca274 Bug 1505887 - Make UAWidgets chromeonly content. r=bz
Differential Revision: https://phabricator.services.mozilla.com/D11408
2018-11-27 11:40:16 +01:00
Emilio Cobos Álvarez d285902ade Bug 1508845 - Make BlastSubtreeToPieces handle Shadow DOM. r=smaug
We can use the unattach shadow stuff because BlastSubtreeToPieces will remove
all the slots.

Differential Revision: https://phabricator.services.mozilla.com/D12531

--HG--
extra : moz-landing-system : lando
2018-11-21 13:02:24 +00:00
Emilio Cobos Álvarez 3a03e26be5 Bug 1505875 - Remove an assertion because I forgot of nsXMLPrettyPrinter. 2018-11-08 23:44:59 +01:00
Emilio Cobos Álvarez 80bd2cd013 Bug 1505875 - Clear out the ShadowRoot host pointer when unattaching it. r=smaug
As expected, this is specific to the UA widget stuff.

What's going on here is that given we don't clear out the host when unattaching
the shadow tree, mutating that shadow tree still notifies all the way up to the
document, and that gets all the other code confused, thinking that the node is
connected.

Indeed, the first assertion that fails when loading that test-case in a debug
build is:

  https://searchfox.org/mozilla-central/rev/17f55aee76b7c4610a974cffd3453454e0c8de7b/dom/base/nsNodeUtils.cpp#93

This seems the best fix to avoid confusion. Also clear the mutation observer,
to completely forget about the host.

Chrome code dealing with UA widgets needs to be careful, but I think this is
safe. All the code that assumes that GetHost() doesn't return null is in code
dealing with connected shadow trees only (style system / layout), or in
mutation observer notifications from the host.

Differential Revision: https://phabricator.services.mozilla.com/D11369

--HG--
extra : moz-landing-system : lando
2018-11-08 20:55:22 +00:00
Olli Pettay 697d41350d Bug 1490406, radio groups should work in shadow DOM, r=ehsan
--HG--
extra : rebase_source : 952ffd47acea3d99d2209e7f05039767b73faa0d
2018-09-21 03:39:47 +03:00
Emilio Cobos Álvarez 20da0ddffb Bug 1487135 - Make the allocation of AuthorStyles for ShadowRoot lazy. r=xidorn,firefox-style-system-reviewers
So that we don't waste a bunch of memory with stuff like <svg:use>. I
plan to shrink AuthorStyles further, but this should help regardless, and isn't
very complex.

Differential Revision: https://phabricator.services.mozilla.com/D4618

--HG--
extra : moz-landing-system : lando
2018-08-30 12:00:00 +00:00
Emilio Cobos Álvarez 75bea4ec60 Bug 1486623 - Skip less nodes when reporting memory, and report ShadowRoot's StyleSheets. r=bzbarsky
This moves all the node-specific reporting to nsIDocument.

OrphanReporter delegates all the reporting to that and then returns the sum of
all sizes, which is not ideal but was pre-existing.

Also, I moved the main mStyleSheets size reporting to DocumentOrShadowRoot for
it to be shared between document and ShadowRoot.

I'll add memory reporting for the computed stylesheet maps and such in the
ShadowRoot in a followup.

I went through all the XBL bindings, though it seems I could just use
GetBindingWithContent(), since according to:

  https://searchfox.org/mozilla-central/rev/55da592d85c2baf8d8818010c41d9738c97013d2/dom/xbl/nsXBLBinding.cpp#615

We don't allow multiple bindings to contribute anon content. Anyway it was the
same amount of code...

Differential Revision: https://phabricator.services.mozilla.com/D4433

--HG--
extra : moz-landing-system : lando
2018-08-29 22:19:42 +00:00
Emilio Cobos Álvarez 3b61137a4b Bug 1484478 - Use a node bit for connectedness. r=smaug
While trying to repro bug 1484293 I noticed that this assertion failed:

https://searchfox.org/mozilla-central/rev/ef8b3886cb173d5534b954b6fb7eb2d94a9473d0/dom/base/ShadowRoot.cpp#160

(during unlink, while unbinding the kids)

We rely on GetComposedDoc returning the right thing during unbind to cleanup
some stuff (see bug 1473637 for example), so it should probably be correct all
the time, regardless of whether something is unlinked or not.

Also this makes GetComposedDoc() much faster, which is nice too, since we call
it somewhat often.

I removed NodeHasRelevantHoverRules, since it's unused (was used by the old
style system).

I moved the SetIsConnected(false) call for the shadow root to before unbinding
the kids for consistency with what Element does with the uncomposed doc flag,
now that the children's connectedness doesn't depend on the shadow root's.

Differential Revision: https://phabricator.services.mozilla.com/D3715

--HG--
extra : moz-landing-system : lando
2018-08-20 11:56:27 +00:00
shindli b158b60c25 Backed out changeset 39f61de4e7bb (bug 1484478) for bustages in /builds/worker/workspace/build/src/dom/base/ShadowRoot.cpp:526:20 2018-08-20 14:21:08 +03:00
Emilio Cobos Álvarez ac923a49c1 Bug 1484478 - Use a node bit for connectedness. r=smaug
While trying to repro bug 1484293 I noticed that this assertion failed:

https://searchfox.org/mozilla-central/rev/ef8b3886cb173d5534b954b6fb7eb2d94a9473d0/dom/base/ShadowRoot.cpp#160

(during unlink, while unbinding the kids)

We rely on GetComposedDoc returning the right thing during unbind to cleanup
some stuff (see bug 1473637 for example), so it should probably be correct all
the time, regardless of whether something is unlinked or not.

Also this makes GetComposedDoc() much faster, which is nice too, since we call
it somewhat often.

I removed NodeHasRelevantHoverRules, since it's unused (was used by the old
style system).

I moved the SetIsConnected(false) call for the shadow root to before unbinding
the kids for consistency with what Element does with the uncomposed doc flag,
now that the children's connectedness doesn't depend on the shadow root's.

Differential Revision: https://phabricator.services.mozilla.com/D3715

--HG--
extra : moz-landing-system : lando
2018-08-19 18:22:48 +00:00
Emilio Cobos Álvarez 69f98d5c58 Bug 1484474 - Make the ua widget flag in ShadowRoot write-only. r=smaug
Letting people set it back to false would be bad.

Differential Revision: https://phabricator.services.mozilla.com/D3714

--HG--
extra : moz-landing-system : lando
2018-08-18 21:32:38 +00:00
Timothy Guan-tin Chien dab48182aa Bug 1431255 - Part V, Set the reflectors of the UA Widget DOM to UA Widget Scope r=bholley
The DOM elements within the UA Widget Shadow DOM should have its reflectors in
the UA Widget Scope. This is done by calling nsINode::IsInUAWidget() which
would check its containing shadow and its UA Widget bit.

To prevent JS access of the DOM element before it is in the
UA Widget Shadom DOM tree, various DOM methods are set to inaccessible to
UA Widget script. It would need to use the two special methods in ShadowRoot
instead to insert the DOM directly into the shadow tree.

MozReview-Commit-ID: Jz9iCaVIoij

--HG--
extra : rebase_source : b7b17be68dcde00cfeb207cb39cf16b486f2ab02
2018-06-29 13:39:46 -07:00
Emilio Cobos Álvarez 1fbd784d00 Bug 1481601 - Remove now-useless aPreallocateChildren from nsINode::Clone() and friends. r=bzbarsky
Since sed on multiple lines ended up being such a pain and I didn't end up
writing a script for this because I didn't think it'd end up being so boring, I
may have made a couple cleanups here and there as well...

Differential Revision: https://phabricator.services.mozilla.com/D2887

--HG--
extra : moz-landing-system : lando
2018-08-08 23:58:44 +00:00
Doug Thayer 488eb2eb9c Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : 61afc5481dc8ec34caba1886bd74200cf3659fb4
2018-04-13 11:04:47 -07:00
Dorel Luca d296624690 Backed out 5 changesets (bug 1340498) for build bustage due to conflicts with bug 1470325. a=backout
Backed out changeset 28bedb658af4 (bug 1340498)
Backed out changeset f950a2310e26 (bug 1340498)
Backed out changeset 5fcd31c65fe0 (bug 1340498)
Backed out changeset 515bb5e24dd7 (bug 1340498)
Backed out changeset 79a8619bd3e2 (bug 1340498)
2018-06-27 14:05:20 +03:00
Doug Thayer 864c89631c Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : 4f8dd2996d820fdb5a07afe544be5e2d6ca6a5c7
2018-04-13 11:04:47 -07:00
Bogdan Tara d2fb3a8812 Backed out 5 changesets (bug 1340498) for build bustages on nsDOMCSSAttrDeclaration.h CLOSED TREE
Backed out changeset 9ebcdb66ceff (bug 1340498)
Backed out changeset 63321093bb70 (bug 1340498)
Backed out changeset f8c799971f81 (bug 1340498)
Backed out changeset 21d8c1fbbbd1 (bug 1340498)
Backed out changeset fa40c179eb0d (bug 1340498)
2018-06-26 21:31:09 +03:00
Doug Thayer 5685ea3b89 Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : b01f47e439a61492ad999ae30677c48535e8cd4c
2018-04-13 11:04:47 -07:00
arthur.iakab fc7e217166 Backed out 5 changesets (bug 1340498) for build bustages on SelectionChangeListener.h on a CLOSED TREE
Backed out changeset c89b86622d38 (bug 1340498)
Backed out changeset b270d4a01986 (bug 1340498)
Backed out changeset 8ed32495b46f (bug 1340498)
Backed out changeset df9a67c58183 (bug 1340498)
Backed out changeset a5977e0708ea (bug 1340498)
2018-06-26 07:59:01 +03:00
Doug Thayer 44024fd464 Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : 571fd3b1e6511daa5731da76fb5d6d97bce11db1
2018-04-13 11:04:47 -07:00
arthur.iakab 8b1be0e972 Backed out 5 changesets (bug 1340498) for build bustages on SelectionChangeListener.h on a CLOSED TREE
Backed out changeset fae677707059 (bug 1340498)
Backed out changeset 2adde1d1742a (bug 1340498)
Backed out changeset a444ab9cefde (bug 1340498)
Backed out changeset e2ac49ef2034 (bug 1340498)
Backed out changeset 6465310b3de9 (bug 1340498)
2018-06-26 03:53:21 +03:00
Doug Thayer f8255e3bd2 Bug 1340498 - Fix unified sources build errors r=mrbkap
Adding the Places* files into unified sources pushed the
unified sources into a situation that exposed a strangely
large number of errors. This seems to be the minimum set of
changes I could make to resolve all of the issues.

MozReview-Commit-ID: C2H9ce8FmE4

--HG--
extra : rebase_source : 7a3b71596b4318f517ec4c3ac0180e2aa3b721c7
2018-04-13 11:04:47 -07:00
Emilio Cobos Álvarez ee59da45b2 Bug 1470358: Deduplicate sheet insertion code between document and shadow root. r=heycam
Summary: Sort of straight-forward cleanup.

Test Plan: Covered by existing tests.

Reviewers: heycam

Reviewed By: heycam

Bug #: 1470358

Differential Revision: https://phabricator.services.mozilla.com/D1763
2018-06-22 12:57:37 +02:00
Timothy Guan-tin Chien b9a40e754b Bug 1437956 - Pretty print XML with Shadow DOM r=smaug
This patch puts the transformed pretty print DOM into a Shadow DOM.
The stylesheet is loaded with an @import in a <style> block, so the
monospace stylesheet had to be left out.

The XBL binding is kept, pending removal when Shadow DOM ships.
It's still needed to handle the case when Shadow DOM is pref'd off too.

MozReview-Commit-ID: DQRsXB8tumF

--HG--
extra : rebase_source : 6edc3d82392af4d98de454a5228328379a0fb7ee
2018-06-01 17:45:11 +08:00
Emilio Cobos Álvarez 2054320f28 Bug 1459529: Make sheets be associated to a shadow root too potentially. r=bz
MozReview-Commit-ID: Cd8xJuLRY5w
2018-05-15 18:44:25 +02:00
Xidorn Quan f5145ff7fc Bug 1460110 - Remove header dependencies to ServoStyleRuleMap.h. r=emilio
MozReview-Commit-ID: 4TPb7JYsc1D

--HG--
extra : rebase_source : 7944e08520b95938f0572444fdebcbd647a95b85
2018-05-09 11:02:21 +10:00
Boris Zbarsky 14f26fccf6 Bug 1449631 part 8. Remove nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: 5wQ2LYrjUxf
2018-04-05 13:42:41 -04:00
Emilio Cobos Álvarez f004e39cd6 Bug 1441136: Add a fast way to enumerate ShadowRoots in a document. r=smaug
MozReview-Commit-ID: 7QffP56jsyk
2018-04-04 07:40:34 +02:00
Emilio Cobos Álvarez 5caaf1c9f3 Bug 1445682: Make Shadow DOM account for stylesheet applicableness correctly. r=xidorn
Summary:
Also, make stuff sound in presence of CSSOM and what not.

The dirty: false thing is reverting an accidental change that landed in the
de-XBL stuff, which was harmless, but now wouldn't let me assert stuff properly.

Reviewers: xidorn

Bug #: 1445682

Differential Revision: https://phabricator.services.mozilla.com/D748

MozReview-Commit-ID: K0W2Rv0qK8X
2018-03-19 15:50:31 +01:00
Emilio Cobos Álvarez 8c135989e9 Bug 1438210: another followup: Appease the static analysis. r=me
MozReview-Commit-ID: D2SvKWjOGeX
2018-03-14 11:57:41 +01:00
Emilio Cobos Álvarez 7be5ad6f23 Bug 1438210: another followup: Avoid the previous patch busting new toolchains (sigh). r=me
MozReview-Commit-ID: 7PkoklZLCk7
2018-03-14 11:40:10 +01:00
Emilio Cobos Álvarez a527c6019f Bug 1438210: followup: Add a constructor to unbust builds on older toolchains. r=me
MozReview-Commit-ID: Cx0vnHt0OW6
2018-03-14 11:36:14 +01:00
Emilio Cobos Álvarez d44be89a37 Bug 1438210: Make slot assignment sound with layout after bug 1409975. r=smaug
Summary:
Before that bug, we carefully told layout about all distribution changes before
they happened, so layout could cleanup frames and styles synchronously properly
(since otherwise there's no way afterwards to figure out what the tree shape
was).

That bug made it not do it correctly, causing this.

I obviously need to write a bunch of tests for this...

Reviewers: smaug

Bug #: 1438210

Differential Revision: https://phabricator.services.mozilla.com/D724

MozReview-Commit-ID: 8uupNhoFwme
2018-03-14 10:54:28 +01:00
Olli Pettay 3faf40c897 Bug 1425864 - Ensure printing documents which have ShadowDOM works, r=mrbkap,emilio 2018-03-04 19:41:13 +09:00
Emilio Cobos Álvarez 6c417367d6 Bug 1425759: Make Shadow DOM not use XBL anymore. r=smaug,xidorn
More improvements to come. In particular, this still iterates through Shadow DOM
in each_xbl_cascade_data, but that should be changed later. That allows to
cleanup a bunch of stuff and finally fix Shadow DOM cascade order.

We still rely on the binding parent to be setup properly in the shadow tree, but
that requirement can go away later (we can walk the containing shadow chain
instead).

This mostly focuses on removing the XBL binding from the Shadow host.

It'd be nice to do EnumerateShadowRoots faster. I think that should also be a
followup, if needed.

MozReview-Commit-ID: Jf2iGvLC5de
2018-02-27 12:39:35 +01:00
Emilio Cobos Álvarez 02b71da95a Bug 1441014: Deindent / Simplify some code for slot removal. r=smaug
MozReview-Commit-ID: LcbZSXnbVLL

--HG--
extra : rebase_source : 4837bad53294892b7b625f565e99b14a75cb3a5c
2018-02-25 17:33:28 +01:00
Emilio Cobos Álvarez 30b133d3c7 Bug 1439223: Stop ShadowRoot::Host from being a useless function call. r=smaug
Also, change DocumentFragment to use RefPtr, since that's the usual style.

MozReview-Commit-ID: 4PQ19nbmhUh

--HG--
extra : rebase_source : 2afb214b764ba48a4a8718190a6853ae6d6ea80b
2018-02-18 14:33:14 +01:00
Emilio Cobos Álvarez 6dd24e93ac Bug 1439016: Remove dead code from Shadow DOM v0. r=bholley
Could do that on a different bug but...

MozReview-Commit-ID: L1ri2s8z75f

--HG--
extra : rebase_source : cfdd998081cb8ef49cc5e66801fc706774f5497a
2018-02-19 18:15:38 +01:00
Emilio Cobos Álvarez bdc288daf0 Bug 1438129: Remove ShadowRoot.applyAuthorStyles. r=smaug
MozReview-Commit-ID: E7xk2V78ssq

--HG--
extra : rebase_source : a5be8d3b9cb5543c47f03f91798315f03939c994
2018-02-14 11:41:40 +01:00
Jessica Jong bf1d5c0073 Bug 1429656 - Implement ShadowRoot.activeElement. r=smaug 2018-01-15 14:42:47 +08:00