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

586 Коммитов

Автор SHA1 Сообщение Дата
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
Brian Grinstead 8e29f09232 Bug 1478999 - Don't check for -moz-binding on dropmarker to avoid getting computed style in GetBindingURL;r=emilio
This is slow to do when the element isn't visible, and we know it
won't have a XBL binding anyway, since it's a Custom Element.

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

--HG--
extra : moz-landing-system : lando
2018-08-17 16:41:59 +00:00
Olli Pettay 9ea97a4cf5 Bug 1484040, unbind shadow DOM content when uninstalling shadow DOM based XML Pretty Printer, r=timdream 2018-08-17 02:49:16 +03:00
Csoregi Natalia 0f4d50ff52 Merge inbound to mozilla-central. a=merge 2018-08-08 12:58:36 +03:00
Brad Werth eea863c791 Bug 1479508 Part 2: Change GetElementsWithGrid to use a more conservative traversal that skips subtrees without frames. r=bz
MozReview-Commit-ID: 1hTQD8LoLQw

--HG--
extra : rebase_source : e8651e1a78818a25c98cc34db2ac217756596666
2018-08-01 15:33:06 -07:00
Olli Pettay 5a669d2747 Bug 1469521 - Change storage of previous and next children in nsINode, r=bz
--HG--
extra : rebase_source : 4cb50889c2cfc788cab7037d26d114e35205e998
2018-08-06 22:29:27 +03:00
Olli Pettay 1617b3d39a Bug 1481501 - cleanup AttrArray, r=mrbkap
--HG--
extra : rebase_source : 51faf5ebfd6225eaaed90fb2f50c63184a9516a5
2018-08-07 22:11:11 +03:00
Olli Pettay 7315a671e1 Bug 1481399 - rename nsAttrAndChildArray to AttrArray, r=mrbkap
--HG--
rename : dom/base/nsAttrAndChildArray.cpp => dom/base/AttrArray.cpp
rename : dom/base/nsAttrAndChildArray.h => dom/base/AttrArray.h
extra : rebase_source : 488f4d9c87bf337686abfa98e79466343a9e6685
2018-08-07 22:07:26 +03:00
Coroiu Cristina 3a66c3c087 Backed out 3 changesets (bug 1479508) for devtools failures at devtools/client/inspector/grids/test/browser_grids_no_fragments.js on a CLOSED TREE
Backed out changeset cba3360692b8 (bug 1479508)
Backed out changeset c42fa0ccd335 (bug 1479508)
Backed out changeset 09d7d2f8fe4f (bug 1479508)
2018-08-04 00:48:56 +03:00
Brad Werth 9e2d7f6dd2 Bug 1479508 Part 2: Change GetElementsWithGrid to use a more conservative traversal that skips subtrees without frames. r=bz
MozReview-Commit-ID: 1hTQD8LoLQw

--HG--
extra : rebase_source : e8651e1a78818a25c98cc34db2ac217756596666
2018-08-01 15:33:06 -07:00
Noemi Erli 58e27f3dd9 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-08-02 12:04:24 +03:00
Jan de Mooij 3bbc9aa20d Bug 1479363 part 1 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in dom/base. r=bz 2018-08-02 08:48:40 +02:00
Xidorn Quan 8421040c69 Bug 1479995 - Rename ScrollbarStyles to ScrollStyles. r=mstange
This change also renames several related functions, as well as fields,
and the header is moved into EXPORTS.mozilla given it is defined under
mozilla namespace.

MozReview-Commit-ID: LqCdcW8fmUN

--HG--
rename : layout/base/ScrollbarStyles.cpp => layout/base/ScrollStyles.cpp
rename : layout/base/ScrollbarStyles.h => layout/base/ScrollStyles.h
extra : rebase_source : 8933f3bca88d5db4b9508e3947f695ecf7511b3e
2018-08-01 16:14:26 +10:00
Emilio Cobos Álvarez 8f34c12e14 Bug 1479860: Remove unused aCompileEventHandlers argument from BindToTree. r=bz
Mostly automatic via sed. Only parts which I touched manually (apart from a
couple ones where I fixed indentation or which had mispelled arguments) are the
callers. I may have removed a couple redundant `virtual` keywords as well when
I started to do it manually, I can revert those if wanted.

Most of them are just removing the argument, but in Element.cpp I also added an
assertion for GetBindingParent when binding the ShadowRoot's kids (the binding
parent is set from the ShadowRoot constructor, and I don't think we bind a
shadow tree during unlink or what not which could cause a behavior difference).

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

MozReview-Commit-ID: 2oIgatty2HU
2018-08-01 10:42:54 +02:00
Jan de Mooij 80adc67aba Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke 2018-07-28 12:12:26 +02:00
Olli Pettay e909e859a5 Bug 1100912, make dir-state to propagate through shadow DOM, r=mrbkap 2018-07-21 13:11:06 +03:00
Neil Deakin 0cc9fd046c Bug 1461742, add a mechanism so that custom elements can implement interfaces akin to XBL implements. This is accomplished by an additional chrome-only callback getCustomInterface that can be implemented by custom elements, r=bz 2018-07-19 08:38:45 -04:00
Csoregi Natalia 143b18ba60 Backed out 2 changesets (bug 1461742) for build bustage on CustomElementRegistry.cpp:97. CLOSED TREE
Backed out changeset ca5415dbc51a (bug 1461742)
Backed out changeset 30bd77de7bf5 (bug 1461742)
2018-07-19 13:36:31 +03:00
Neil Deakin c2c722be92 Bug 1461742, add a mechanism so that custom elements can implement interfaces akin to XBL implements. This is accomplished by an additional chrome-only callback getCustomInterface that can be implemented by custom elements, r=bz 2018-07-19 06:15:26 -04:00
Emilio Cobos Álvarez fdc6136265 Bug 1475203: Fix id table handling in UnbindFromTree(). r=smaug
Only remove from the table when we're actually disconnecting the
element from the shadow root.

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

MozReview-Commit-ID: 1Ubdz57PNc0
2018-07-12 14:10:40 +02:00
Boris Zbarsky e2156c39cb Bug 820891 part 3. Make scroll* properties for tables work with the table wrapper box, not the table box. r=dholbert
--HG--
rename : testing/web-platform/tests/css/cssom-view/table-client-props.html => testing/web-platform/tests/css/cssom-view/table-scroll-props.html
2018-07-10 09:28:11 -07:00
Boris Zbarsky ebe5685319 Bug 820891 part 2. Make client* properties for tables work with the table wrapper box, not the table box. r=dholbert
--HG--
rename : testing/web-platform/tests/css/cssom-view/table-offset-props.html => testing/web-platform/tests/css/cssom-view/table-client-props.html
2018-07-10 09:28:09 -07:00
Jonathan Kingston 59b20406b3 Bug 1469592 - Add support for Element.toggleAttribute. r=bzbarsky,smaug!
MozReview-Commit-ID: KkDLMlQgESs

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

--HG--
extra : moz-landing-system : lando
2018-07-03 19:12:49 +00:00
Olli Pettay d87b0df953 Bug 1331334 - Implement :defined pseudo-class for custom elements, r=emilio
--HG--
extra : rebase_source : 5f95c38166d00ae07ef523ab8ecb5b4cb59eceaf
2018-06-28 14:55:45 +03:00
Olli Pettay 51b5db9342 Bug 1440382, there should be no is-attribute, only internal is-value, in custom elements, r=mrbkap 2018-06-28 14:22:58 +03:00
Margareta Eliza Balazs e5cb974437 Backed out changeset 9fe49c825ba3 (bug 1440382) for causing bustage in builds/worker/workspace/build/src/dom/base/nsNodeUtils.cpp 2018-06-28 14:00:18 +03:00
Olli Pettay 7a0ce01ed8 Bug 1440382, there should be no is-attribute, only internal is-value, in custom elements, r=mrbkap 2018-06-28 13:39:05 +03:00
Emilio Cobos Álvarez a24ebbee4e Bug 1470545: Add chromeonly "shadowrootattached" event for devtools. r=smaug
Summary:

document.addEventListener("shadowrootattached", e => {
  // Do stuff with composedTarget.
});

I didn't bother to add tests for the event itself since this is going to get
tested in bug 1449333, but I can look into writing a chrome mochitest if you
want.

Test Plan: See above.

Reviewers: smaug

Bug #: 1470545

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

MozReview-Commit-ID: 55cVMSsznMS
2018-06-27 11:24:43 +02:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Olli Pettay abf54817b9 Bug 1428246 - The attributeChangedCallback is fired twice for the *first* style attribute change, r=peterv
The idea with this patch is that style code will first call
InlineStyleDeclarationWillChange before style declaration has changed, and SetInlineStyleDeclaration once it has changed.

In order to be able to report old attribute value, InlineStyleDeclarationWillChange reads the value and also calls AttributeWillChange (so that DOMMutationObserser can grab the old value). Later SetInlineStyleDeclaration passes the old value to
SetAttrAndNotify so that mutation events and attributeChanged callbacks are handled correctly.

Because of performance, declaration can't be cloned for reading the old value. And that is why the recently-added callback is used to detect when declaration is about to change (bug 1466963 and followup bug 1468665).

To keep the expected existing behavior, even if declaration isn't changed, but just a new declaration was created (since there wasn't any), we need to still run all these
willchange/set calls. That is when the code has 'if (created)' checks.

Since there are several declaration implementation and only nsDOMCSSAttributeDeclaration needs the about-to-change callback, GetPropertyChangeClosure is the one to initialize the callback closure, and the struct which is then passes as data to the closure.

Apparently we lost mutation event testing on style attribute when the pref was added, so test_style_attr_listener.html is modified to test both pref values.

--HG--
extra : rebase_source : 9e605d43f22e650ac3912fbfb41abb8d5a2a0c8f
2018-06-26 12:54:00 +03:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07: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 3438cdd0ae Bug 1469276: Remove some unnecessary nsAttrAndChildArray usage. r=smaug
We relied already in DestroyContent not fiddling with child lists, so added
assertions to that effect.

The GetChildCount comment in UnbindSubtree looks outdated (there's no
GetChildCount impl which does anything like creating children).

MozReview-Commit-ID: 6UXVbT6Urgt
2018-06-18 16:07:07 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nazım Can Altınova 361380987c Bug 1464496 - Part 1: Merge ServoDeclarationBlock and DeclarationBlock r=emilio
MozReview-Commit-ID: By9fV70Oq0K

--HG--
extra : rebase_source : 837afe9c33b21d7db41ff19d3aaf6cf3e9eedbdf
2018-05-30 18:15:25 +02:00
Johann Hofmann ded334a8cb Bug 1444394 - Remove Element::UnsafeSetInnerHTML. r=bz,kmag
The last remaining user is already turned off and being removed
in bug 1444395 so that we can finally remove this unsafe code and
sleep a little better knowing that XSS through markup injections
will be impossible in chrome contexts.

MozReview-Commit-ID: KcZq8fRPiD4

--HG--
extra : rebase_source : 5def3abb50ed8f1b43e17072088e38a44394488b
2018-05-28 22:55:52 +02:00
Emilio Cobos Álvarez d7bfa8a3bb Bug 1460382: Make element-backed pseudos inherit from NAC subtree roots and other NAC inherit from their parents. r=heycam
Currently, NAC always inherits from the closest non-NAC ancestor element,
regardless of whether it is for an element-backed pseudo or not.

This patch changes the inheritance so that for element-backed pseudos, we
inherit from the closest native anonymous root's parent, and for other NAC we
inherit from the parent.

This prevents the following two issues and allows us to remove the
NODE_IS_NATIVE_ANONYMOUS flag:

 * Avoiding inheriting from the non-NAC ancestor in XBL bindings bound to NAC.

   - This is no longer a problem since we apply the rule only if we're a
     pseudo-element, and all pseudo-elements are in native anonymous subtrees.

   - This also allows to remove the hack that propagates the
     NODE_IS_NATIVE_ANONYMOUS flag from the ::cue pseudo-element from
     BindToTree.

 * Inheriting from the wrong thing if we're a nested NAC subtree.

   - We no longer look past our NAC subtree, with the exception of
     ::-moz-number-text's pseudo-elements, for which we do want to propagate
     ::placeholder to.

A few rules from forms.css have been modified because they're useless or needed
to propagate stuff to the anonymous form control in input[type="number"] which
previously inherited from the input itself.

MozReview-Commit-ID: IDKYt3EJtSH
2018-05-30 10:14:46 +02:00
Boris Zbarsky cb08b0de7d Bug 1455676 part 21. Remove nsIDOMNode. r=qdot 2018-05-29 22:58:51 -04:00
Emilio Cobos Álvarez 3240b9b6d9 Bug 1462618: The restyle root machinery could work better. r=heycam
Consider the test-case where we have:

<div>
  <span id=a />
  <span id=b />
</div>

We try to set one bit on "a", and a different one on "b".

Ideally we'll end up with <div> as the root with both bits. But with the current
code we'd go all the way to the document unnecessarily. This fixes it by
checking the bits we've propagated up to the top instead of existingBits.

MozReview-Commit-ID: GfwjwCBpkuy
2018-05-28 10:45:49 +02:00
rahul0379 a074d3d299 Bug 1458580 - Rename GetSMILStyleOverride since it can't return null. r=emilio
MozReview-Commit-ID: JzV5hQBvlpJ
2018-05-25 12:12:37 +02:00
Emilio Cobos Álvarez da9f6c6d11 No bug - Remove code that does nothing. r=me
Scoped stylesheets are long gone, and this code just looks at stuff without
using it.

MozReview-Commit-ID: 9pVxND9i23v
2018-05-20 18:47:06 +02:00
Timothy Guan-tin Chien 08741f30ed Bug 1460962 - Support customized built-in element in XUL r=smaug
This patch enables us to specify a custom element type with |is| attribute
or property when creating a XUL element. Because non-dashed names are valid
custom element names in XUL (bug 1446247), other checks has to modified
accordingly.

The checks I am settling with are
1) Forbids the custom built-in element names to be a non-dashed name.
2) Forbids the custom built-in element to extend a dashed built-in element name.

This also ensures the custom built-in element types don't take on the same
name as the element name it extends.

MozReview-Commit-ID: GCQ9RnfvvrC

--HG--
extra : rebase_source : 2fa13742525d2107580d50872ff5b0fc42539498
extra : source : 2dc5513660d78a4de4801109140743ffc9297f71
2018-05-11 12:44:46 -07:00
Jan de Mooij 80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Emilio Cobos Álvarez 11794a944d Bug 1461701: Remove nsUpdateType and UPDATE_CONTENT_MODEL. r=smaug
MozReview-Commit-ID: 33iBMZqnkAc
2018-05-15 18:47:16 +02:00
Olli Pettay 20c34cefa0 Bug 1461278 - Print a note to the web console when a web site is using shadow DOM (v1), preffed off by default, r=emilio 2018-05-15 02:04:32 +03:00
Adrian Wielgosik c501e3beb0 Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
MozReview-Commit-ID: LKRnyDPNlle

--HG--
extra : rebase_source : a48b7c72a0f7ede38c91149a04d5de53987736f1
2018-05-11 19:46:15 +02:00
Brian Birtles 3184f30162 Bug 1456394 - Merge KeyframeEffectReadOnly and KeyframeEffect; r=bz,hiro
MozReview-Commit-ID: FvTMGjxfRXk

--HG--
extra : rebase_source : 8f7fd0903c9ca2f545dce2633eb797345a7517f8
2018-05-07 11:08:59 +09:00
Brian Birtles 9622b88217 Bug 1456394 - Rename KeyframeEffectReadOnly.{h,cpp} to KeyframeEffect.{h,cpp}; r=bz,hiro
MozReview-Commit-ID: 5Q7oQV8vmgS

--HG--
rename : dom/animation/KeyframeEffectReadOnly.cpp => dom/animation/KeyframeEffect.cpp
rename : dom/animation/KeyframeEffectReadOnly.h => dom/animation/KeyframeEffect.h
extra : rebase_source : cdc8448e7d07376691ef9187f7d6f4424800b690
2018-05-07 11:07:06 +09:00
Brian Birtles 81725f45de Bug 1456394 - Move KeyframeEffect constructors to KeyframeEffectReadOnly.{h,cpp}; r=bz,hiro
By doing this we will have all the KeyframeEffect* related code in
KeyframeEffectReadOnly.{h,cpp} so we can rename them to KeyframeEffect.{h,cpp}
in the next patch and make it easier to examine the history for the bulk of this
code.

The added [HeaderFile] annotation will be removed in a subsequent patch in this
series.

MozReview-Commit-ID: Fxk6fPukgAS

--HG--
extra : rebase_source : 0bb0f846aba69e2b79724adb3148948317667eae
2018-05-07 11:07:01 +09:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Eugen Sawin 8bee753352 Bug 1458687 - [1.0] Remove obsolete isUserTriggered argument in nsContentUtils::TriggerLink. r=smaug 2018-05-03 16:05:34 +02:00
Boris Zbarsky 25aa42d9a4 Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Boris Zbarsky 8a0b50bea8 Bug 1456588 part 1. Change nsIFocusManager::SetFocus to take Element. r=enndeakin 2018-04-26 10:37:46 -04:00
Adrian Wielgosik b3c501adc4 Bug 1447389 - Remove nsIDOMNodeList. r=bz
MozReview-Commit-ID: 11szZP6dS6V

--HG--
extra : rebase_source : 9acfb352750e53d3b36684fa945a18e817c9b82e
2018-04-25 23:01:30 +02:00
Emilio Cobos Álvarez f8233b4454 Bug 1456471: Remove nsCSSParser.h. r=xidorn
MozReview-Commit-ID: 4qa7llzCXeR
2018-04-25 10:38:37 +02:00
Boris Zbarsky 0ba35d199f Bug 1455052 part 8. Stop using nsIDOMEvent in docshell and dom. r=masayuki
MozReview-Commit-ID: ASkuyN3xSwB
2018-04-20 12:55:30 -04:00
Boris Zbarsky 38ecaf4bb7 Bug 1452183 part 3. Stop using nsIDOMDocumentFragment in C++. r=mccr8 2018-04-17 21:13:03 -04:00
Emilio Cobos Álvarez 9509cd7e32 Bug 1453789: Remove Element.createShadowRoot. r=smaug
MozReview-Commit-ID: Hgxbp1Icgvh
2018-04-13 20:51:55 +02:00
Brian Grinstead 6cb530800d Bug 1446247 - Pass namespace into IsCustomElementName to allow for non-dashed XUL elements;r=e7358d9c+590837,smaug
This will make it possible to migrate existing bindings without also needing to
mass-rewrite frontend code at the same time.

MozReview-Commit-ID: IBBqC4eeDDX

--HG--
extra : rebase_source : e901ac665208b3a683668c1bb33a26dcf479580c
2018-03-29 09:34:56 -07:00
Ciure Andrei 873d562bc3 Backed out 8 changesets (bug 1451169) on request from njn a=backout
Backed out changeset b92f856e15a8 (bug 1451169)
Backed out changeset 348e825756fa (bug 1451169)
Backed out changeset 624d82428726 (bug 1451169)
Backed out changeset 4d51610ca08e (bug 1451169)
Backed out changeset bb76a9589717 (bug 1451169)
Backed out changeset c145fbd03947 (bug 1451169)
Backed out changeset 6d36289e0f54 (bug 1451169)
Backed out changeset 914fb7cd9fc3 (bug 1451169)

--HG--
extra : histedit_source : 94de6631919f895dec422bc0e564f5baf885ba4a%2C18f52c6c11d3064d3137a6847575effb7d407894
2018-04-11 11:22:05 +03:00
Emilio Cobos Álvarez d7fe23bd25 Bug 1452324: Remove outdated references to bug 1326028. r=smaug
DONTBUILD, since it's comment-only.

MozReview-Commit-ID: KzZRo3FhwDr
2018-04-07 19:06:52 +02:00
Emilio Cobos Álvarez e128bf7b1a Bug 1447827: Remove ServoRestyleManager. r=xidorn
MozReview-Commit-ID: CFafQsb4rQn
2018-04-07 15:50:06 +02:00
Emilio Cobos Álvarez c0f2f96f66 Bug 1303605: Remove the undisplayed maps. r=bz,mats
This is mostly code removal, changing GetDisplayContentsStyle(..) checks by an
FFI call to Servo.

The tricky parts are:

 * MaybeCreateLazily, which I fixed to avoid setting bits under display: none
   stuff. This was a pre-existing problem, which was wallpapered by the
   sc->IsInDisplayNoneSubtree() check, which effectively made the whole
   assertion useless (see bug 1381017 for the only crashtest that hit this
   though).

 * ContentRemoved, where we can no longer know for sure whether the element is
   actually display: contents if we're removing it as a response to a style
   change. See the comment there. That kinda sucks, but that case is relatively
   weird, and it's better than adding tons of complexity to handle that.

 * GetParentComputedStyle, which also has a comment there. Also, this function
   has only one caller now, so we should maybe try to remove it.

The different assertions after DestroyFramesForAndRestyle are changed for a
single assertion in the function itself, and the node bit used as an
optimization to avoid hashtable lookups is taken back.

MozReview-Commit-ID: AZm822QnhF9
2018-04-07 15:21:56 +02:00
Andreea Pavel d9706dbbb9 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-04-06 13:26:13 +03:00
Andreea Pavel 9f9457503a Backed out changeset e220521c6ff6 (bug 1446247) on request a=backout r=smaug 2018-04-06 13:23:59 +03: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
Nicholas Nethercote a560608963 Bug 1451169 - Use `nsStaticAtom*` instead of `nsStaticAtom**` in Element.h. r=baku
And then fix up everything else that needs to change as well.

MozReview-Commit-ID: GDMfERqdQAc

--HG--
extra : rebase_source : 01fe06c3182245a409099a53383d92bf4fa0155c
2018-04-03 13:21:06 +10:00
Emilio Cobos Álvarez 3218d73ada Bug 1441136: Some other minor cleanup. r=smaug
Now that XBL and Shadow DOM are not entangled we don't really need to do this.

MozReview-Commit-ID: GdgnE5QT2NR
2018-04-04 07:40:50 +02:00
Brian Grinstead a5543400b1 Bug 1446247 - Pass namespace into IsCustomElementName to allow for non-dashed XUL elements;r=e7358d9c+590837,smaug
This will make it possible to migrate existing bindings without also needing to
mass-rewrite frontend code at the same time.

MozReview-Commit-ID: IBBqC4eeDDX

--HG--
extra : rebase_source : e901ac665208b3a683668c1bb33a26dcf479580c
2018-03-29 09:34:56 -07:00
Emilio Cobos Álvarez 55b77aee5c Bug 1449502: Cleanup a bit more the selector cache and CSSOM methods. r=xidorn
MozReview-Commit-ID: 32FgbGFUdCM
2018-03-29 17:12:55 +02:00
Xidorn Quan afea770358 Bug 1448728 part 3 - Remove mention of servo in memory report as it's the only style system now. r=njn
MozReview-Commit-ID: CJl0LboV1Gj

--HG--
extra : source : e468e93bc9cf4171197f79fa7db6b5ac6bfc07ea
2018-03-28 10:44:49 +11:00
Xidorn Quan 1962625a79 Bug 1448728 part 1 - Make popular headers not include nsWindowSizes.h. r=njn
MozReview-Commit-ID: EC5J9Im3gfu

--HG--
extra : source : 9fa9209aeeb00009143c5c21f21210c93184e61f
2018-03-28 10:44:49 +11:00
Boris Zbarsky 17509bc9da Bug 1449019. Actually propagate out exceptions from the innerHTML getter. r=smaug
I moved the IgnoreErrors decl so it would come after the OOMReporter decl and I
could add the new conversion operator.

MozReview-Commit-ID: B1S6DXmZfvE
2018-03-26 16:41:43 -04:00
Jonathan Watt 82ebebe276 Bug 1448714 - Fix up comments referring to 'style context' after the rename of nsStyleContext. r=emilio 2018-03-23 13:49:21 +00:00
Coroiu Cristina f7507f7dd5 Merge mozilla-central to inbound a=merge on a CLOSED TREE 2018-03-27 01:33:50 +03:00
Boris Zbarsky 98a683f9e1 Backed out changeset 1023e033bfa6 (bug 1132934) because it hasn't been reviewed yet.
MozReview-Commit-ID: LXefIp2OG6Q
2018-03-26 16:47:31 -04:00
Boris Zbarsky 0ce4de30db Bug 1132934 part 1. Actually propagate out exceptions from the innerHTML getter. r=smaug
MozReview-Commit-ID: KEqsx836qQn
2018-03-26 16:41:43 -04:00
Emilio Cobos Álvarez 8fcda0e92d Bug 1448690: Remove IsStyledByServo. r=xidorn
MozReview-Commit-ID: I3MDbo2Yu7d
2018-03-26 09:39:26 +02:00
Emilio Cobos Álvarez 2265ef0801 Bug 1448688: Remove RestyleTracker, ComputedStyle::AsServo, old style system element bits. r=xidorn
MozReview-Commit-ID: ALiOngGqozN
2018-03-26 09:38:07 +02:00
Jonathan Watt 384c345f21 Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

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

MozReview-Commit-ID: KJq2i9nrg7y
2018-03-25 20:49:58 +02:00
Narcis Beleuzu 47581f78e2 Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Jonathan Watt 21bff4e120 Summary: Bug 1448294 - Clean up naming of 'styleContext' variables after the big nsStyleContext rename. r=emilio
Reviewers: emilio

Bug #: 1448294

Differential Revision: https://phabricator.services.mozilla.com/D796
2018-03-22 13:49:21 +00:00
Margareta Eliza Balazs 190225b29c Backed out changeset 794ee6857d83 (bug 1421070) for 15 failures in toolkit/components/payments/test/mochitest/test_ObservedPropertiesMixin.html on a CLOSED TREE
--HG--
extra : amend_source : 0574ce1b5b6a6e8735245684eb8e9ec7b0ac2647
2018-03-23 03:42:25 +02:00
Noemi Erli 1270a21724 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-03-23 01:00:18 +02:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Boris Zbarsky 29d232e53f Bug 1447098 part 1. Rename FromContent on various DOM classes to FromNode. r=mystor
MozReview-Commit-ID: 202nkbmkwfR
2018-03-21 17:39:04 -04:00
arthur.iakab abcb47d8cc Merge inbound to mozilla-central. a=merge 2018-03-21 21:13:11 +02:00
Adrian Wielgosik af8740d569 Bug 1447392 - Remove all members from nsIDOMNodeList. r=bz
MozReview-Commit-ID: 68xF7CTMpKB

--HG--
extra : rebase_source : 28b9c5e31d1c93b5c56743e12909eb749e8688f9
2018-03-20 19:02:08 +01:00
Emilio Cobos Álvarez f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Boris Zbarsky 89ea512161 Bug 1446711 part 7. Switch the nsIDOMMouseEvent::MOZ_SOURCE_* constants over to MouseEventBinding. r=qdot
We can't include MouseEventBinding.h in MouseEvents.h because that produces
this include loop:

MouseEventBinding.h -> UIEventBinding.h ->
nsGlobalWindow.h -> nsGlobalWindowInner.h -> nsRefreshDriver.h ->
AnimationEventDispatcher.h -> AnimationComparator.h -> Animation.h ->
EffectCompositor.h -> PseudoElementHashEntry.h -> Element.h ->
PointerEventHandler.h -> MouseEvents.h -> MouseEventBinding.h

MozReview-Commit-ID: 6FNksGil7uD
2018-03-20 00:16:06 -04:00
arthur.iakab 8976abf9ca Merge inbound to mozilla-central. a=merge 2018-03-14 12:00:13 +02:00
Boris Zbarsky 12b661df01 Bug 1445140 part 5. Remove nsIDOMDocumentType. r=mystor
MozReview-Commit-ID: B6iktNYbWn9
2018-03-13 16:24:01 -04:00
Dave Townsend c70f34995e Bug 1421070: Always enable custom elements in chrome. r=smaug, rs=MattN
This allows custom elements to work in any document in the parent process that
allows XUL and XBL. The test takes the easy option of moving the existing XUL
custom element test to a run with the custom element pref disabled.

MozReview-Commit-ID: CMiLzmp60jA

--HG--
extra : rebase_source : 735688061116c633b816f4f9d488712408df11a5
extra : source : 794ee6857d83dfe0b18629c12e96a622fc899586
2017-10-20 11:02:33 -07:00
Dave Townsend 2626e1c261 Bug 1421070: Always enable custom elements in chrome. r=smaug
This allows custom elements to work in any document in the parent process that
allows XUL and XBL. The test takes the easy option of moving the existing XUL
custom element test to a run with the custom element pref disabled.

MozReview-Commit-ID: CMiLzmp60jA

--HG--
extra : rebase_source : b9632de82cf79c1df15be09fadf1d25817c8a894
extra : amend_source : 235a76453d1d6782903d5051ee8e234b965dcc36
2017-10-20 11:02:33 -07:00
Emilio Cobos Álvarez de099db7bd Bug 1444905: Remove scoped style support from the old style system. r=xidorn,smaug
Summary: It uses two node bits that can be better suited for something else.

Reviewers: xidorn, smaug

Bug #: 1444905

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

MozReview-Commit-ID: HIPDtHm6xpM
2018-03-13 10:26:13 +01:00
Boris Zbarsky 5d37a40578 Bug 1444231. Fix QI implementation for FragmentOrElement. r=mccr8
MozReview-Commit-ID: 9mPO2ezk2Y7
2018-03-13 00:59:23 -04:00
Hiroyuki Ikezoe 93d38258f6 Bug 1442817 - Don't flush throttled animations on getAnimations(). r=birtles
If the element has throttled animations that will be affected by pending style
changes, the throttled animations will be updated though sequential tasks after
normal styling process.  E.g. UpdateEffectProperties, UpdateCascadeResults etc.
So we don't need to flush them in advance of the sequential tasks.

The first test case in this patch fails without this fix.

MozReview-Commit-ID: GystAqK2bQE

--HG--
extra : rebase_source : c01160e14bb5a2984dcc4d63ec44d4d465b829a2
2018-03-09 09:38:40 +09:00
Emilio Cobos Álvarez c976615ed6 Bug 1024082: Remove PresShell::FrameManager(), use PresShell::FrameConstructor instead. r=dholbert
Unfortunately this means that we need to export a couple more headers, but that
should be ok.

In particular, we have to export some headers that are #included by
nsCSSFrameConstructor.h, because nsCSSFrameConstructor.h itself will now be
included in more places outside of layout/, by .cpp files that don't necessarily
have the ability to indirectly #include its other headers, unless we export
them.

MozReview-Commit-ID: 2n9KHW6Yjrd
2018-03-07 10:17:52 +01:00
Olli Pettay 51b6aa1b21 Bug 1066965, make contentEditable and spellchecking to work in ShadowDOM, r=mrbkap 2018-03-06 09:34:40 +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 ac779f9004 Bug 1439395: Avoid leaving an stale restyle root if there's no servo data on it. r=bholley
If a single element is inserted in the document, from the lazy frame
construction path we mark it as the restyle root.

It has no restyle data, and we weren't calling ClearServoData when its parent
was being removed from ClearServoDataFromSubtree, thus leaving the stale restyle
root.

MozReview-Commit-ID: GY812b8tDk0

--HG--
extra : rebase_source : e6d1035e7d3a72b931aa53ac8dcbf7db58982479
2018-02-26 18:50:19 +01:00
Emilio Cobos Álvarez f3fc2e4852 Bug 1439395: Clear Servo data only when the DOM is in a consistent state. r=bholley
We used to do it this way effectively until I fixed it in bug 1400936.

Per the list of fuzz bugs that bug has in the "Depends on" field, some of those
without a super-clear fix, and others that aren't listed in there, and all the
complexity we had to deal with while receiving restyle requests mid-unbind, etc,
I think this is the right call.

This clears data on RestyleManager::ContentRemoved for non-anonymous nodes, and
on UnbindFromTree for subtrees rooted at anonymous nodes.

This will hopefully yield enforceable invariants.

MozReview-Commit-ID: IMwX5Uh1apv

--HG--
extra : rebase_source : 6cafc4499c9b80cbc96f1c4d1496e524f59e3c4d
2018-02-19 14:46:38 +01:00
Emilio Cobos Álvarez 7dffe29d8f Bug 1432490: Make nsComputedDOMStyle::GetStyleContext / GetStyleContextNoFlush not take a presShell. r=bz
Everyone calls them with the shell of the current composed document, and this
allows the multi-presShell stuff to just be in UpdateCurrentStyleSources /
DoGetStyleContextNoFlush.

The only reason we need to use OwnerDoc()->GetShell() instead of the composed
doc in GetStyleContext / GetStyleContextNoFlush is Element::GetBindingURL, which
does expect to get the binding URL for stuff outside of the composed doc (and
changing that gave me a useless browser).

That's technically a behavior change on the cases that used to pass nullptr, but
I think all callers are fine with that. I could also just add a special function
for that particular case, it may be worth it.

MozReview-Commit-ID: 2XlnkgdgDCK
2018-02-25 02:23:59 +01:00
Brian Grinstead 9c65b7b0cb Bug 1443948 - Remove NODE_FORCE_XBL_BINDINGS;r=bz
This was used to attach a binding to a cloned node before it got inserted
into the doc. This is no longer used in the browser chrome, so this patch
removes the feature to prevent future usage and simplify dom code.

MozReview-Commit-ID: KnkHWJ8oQig

--HG--
extra : rebase_source : 52c175afbbfc0cf5cd33c39b6f0577452a90f1a0
2018-03-12 13:24:10 -07:00
Hiroyuki Ikezoe 467ed67c74 Bug 1388557 - Call RequestRestyle(Layer) in the case where we attach orphaned animating element to the document. r=birtles
MozReview-Commit-ID: IIcyYFROqDx

--HG--
extra : rebase_source : f096635d400528660d5243d2884d125e7b623db2
2018-02-21 10:13:13 +09:00
Hiroyuki Ikezoe 4606fafb88 Bug 1417354 - Clear pending restyle requests for the element and its pseudos where the element is detached from the document. r=hiro
MozReview-Commit-ID: GLHjtHNusuB

--HG--
extra : rebase_source : aaf05c7773d11cf61a28803d4ba70546c2b98e27
2018-02-21 07:00:20 +09:00
Hiroyuki Ikezoe 1b0cba9367 Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr

--HG--
extra : rebase_source : 8d2a917eb62cf341e4e1810451fd01c01dbc3bad
2018-02-21 07:00:10 +09:00
Andreea Pavel 4f8782dc6e Backed out changeset 3ab4e934cd7f (bug 1439395) for crashtest failures at tests/layout/style/crashtests/1400936-2.html on a CLOSED TREE 2018-02-20 17:43:31 +02:00
Emilio Cobos Álvarez eb044841b5 Bug 1439395: Clear Servo data only when the DOM is in a consistent state. r=bholley
We used to do it this way effectively until I fixed it in bug 1400936.

Per the list of fuzz bugs that bug has in the "Depends on" field, some of those
without a super-clear fix, and others that aren't listed in there, and all the
complexity we had to deal with while receiving restyle requests mid-unbind, etc,
I think this is the right call.

This clears data on RestyleManager::ContentRemoved for non-anonymous nodes, and
on UnbindFromTree for subtrees rooted at anonymous nodes.

This will hopefully yield enforceable invariants.

MozReview-Commit-ID: IMwX5Uh1apv
2018-02-20 15:19:03 +01:00
Tooru Fujisawa 9a81f2437f Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:

1. GlobalObject::CallerType(), that is ultimately passed to
   nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
   to decide whether to copy mIterationComposite/mComposite to
   KeyframeEffectParams.

   GlobalObject::CallerType() can now be different than the target window's one,
   if the caller has the system principal and the target is web content, and
   in that case nsDocument::IsWebAnimationsEnabled there always returns true
   while Web Animations can be disabled on web content.

   honoring the mIterationComposite/mComposite properties is OK, since it just
   changes the animation behavior, and this is disabled by default until
   remaining spec issues are resolved.

2. GlobalObject::Context(), that is ultimately passed to
   KeyframeUtils::GetKeyframesFromObject and used while extracting information
   from passed-in keyframe object, with iterable/iterator protocols.

   Performing that operation in the caller side is okay, since the same thing
   can be done on caller, and the operation doesn't perform any GCThing
   allocation on the target window global.
2018-02-17 17:21:13 +09:00
Tooru Fujisawa d70a10cbd8 Backed out changeset c3f16a179c93 (bug 1414674) 2018-02-18 01:24:08 +09:00
Tooru Fujisawa d58a217b1c Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because of the following reasons:

1. The target window global is used for most operation:
     * KeyframeEffectReadOnly::ConstructKeyframeEffect uses the target window
       global instead of current global.
     * KeyframeEffectParamsFromUnion which receives `aGlobal.CallerType()`

   In Xray case, Web Animations API can be disabled on web content
   (currently disabled on beta/release by default), and in that case some API
   won't work even it's triggered from WebExtensions, but it should be fine.

2. GetKeyframesFromObject is executed in the caller's compartment to access
   the passed-in JSObject that is keyframe, with iterable/iterator protocols.
   This operation doesn't perform any GCThing allocation on the target window
   global.
2018-02-17 17:21:13 +09:00
Bas Schouten 628d3b7134 Bug 1437492 - Part 2: Based on profile data, use the simple-matrix optimized matrix class in some places. r=mattwoodrow
MozReview-Commit-ID: EBRrGXc2wEj
2018-02-17 00:43:38 +01:00
Boris Zbarsky 3660ff5632 Bug 1436508 part 13. Remove nsIDOMMutationEvent constants. r=masayuki
MozReview-Commit-ID: Anl5QJZknJL
2018-02-09 11:17:10 -05:00
Cameron McCormack d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Boris Zbarsky 65bf16222e Bug 1434399 part 19. Remove nsIXULDocument. r=mystor
MozReview-Commit-ID: 9jQu4sjOhb2
2018-01-31 14:49:29 -05:00
Cosmin Sabou 94617f91cf Backed out 19 changesets (bug 1434399) for build bustages on nsXULPopupManager.cpp on a CLOSED TREE
Backed out changeset 499f6dffd9cb (bug 1434399)
Backed out changeset 018290612415 (bug 1434399)
Backed out changeset f4c3179f8e59 (bug 1434399)
Backed out changeset f3ce2826b857 (bug 1434399)
Backed out changeset 6d2391af01dd (bug 1434399)
Backed out changeset dc98ed8c609a (bug 1434399)
Backed out changeset 8eaa395d6200 (bug 1434399)
Backed out changeset 19b18f4a53be (bug 1434399)
Backed out changeset 8ff378a6e96a (bug 1434399)
Backed out changeset 60fe73be1a26 (bug 1434399)
Backed out changeset faefb2751fdc (bug 1434399)
Backed out changeset 55cdf8b3a959 (bug 1434399)
Backed out changeset b578cc8efb92 (bug 1434399)
Backed out changeset 54cc4cb2fca1 (bug 1434399)
Backed out changeset f5343ef34d6c (bug 1434399)
Backed out changeset 8fb30e066cbd (bug 1434399)
Backed out changeset 21341b656b0f (bug 1434399)
Backed out changeset fab1f8b087a2 (bug 1434399)
Backed out changeset 55250a54852a (bug 1434399)
2018-01-31 22:45:26 +02:00
Boris Zbarsky 95e268e32f Bug 1434399 part 19. Remove nsIXULDocument. r=mystor
MozReview-Commit-ID: 9jQu4sjOhb2
2018-01-31 14:49:29 -05:00
Boris Zbarsky 7c83759ad4 Bug 1428610 part 2. Change Element::GetSMILOverrideStyle to return nsDOMCSSAttributeDeclaration. r=emilio
MozReview-Commit-ID: 9R6ywUEKagK
2018-01-30 14:48:26 -05:00
Ashish 91ad3c0fa5 Bug 1430450 - Remove Logically dead code. r=emilio
MozReview-Commit-ID: Jk2CfMZOQPG
2018-01-30 10:37:51 +01:00
Boris Zbarsky f60fd673d6 Bug 1432186 part 19. Remove the nsIDOMNode::*_NODE constants. r=mccr8
MozReview-Commit-ID: KvKjeKIOB9K
2018-01-29 23:10:53 -05:00
Kris Maglione b3cac601f6 Bug 1432966: Sanitize HTML fragments created for chrome-privileged documents. r=bz f=gijs
This is a short-term solution to our inability to apply CSP to
chrome-privileged documents.

Ideally, we should be preventing all inline script execution in
chrome-privileged documents, since the reprecussions of XSS in chrome
documents are much worse than in content documents. Unfortunately, that's not
possible in the near term because a) we don't support CSP in system principal
documents at all, and b) we rely heavily on inline JS in our static XUL.

This stop-gap solution at least prevents some of the most common vectors of
XSS attack, by automatically sanitizing any HTML fragment created for a
chrome-privileged document.

MozReview-Commit-ID: 5w17celRFr

--HG--
extra : rebase_source : 1c0a1448a06d5b65e548d9f5362d06cc6d865dbe
extra : amend_source : 7184593019f238b86fd1e261941d8e8286fa4006
2018-01-24 14:56:48 -08:00
Boris Zbarsky e38dec29f4 Bug 1431964 part 8. Remove nsIDOMMozNamedAttrMap. r=mccr8
MozReview-Commit-ID: C7z0hcjC0Tg
2018-01-20 20:57:26 -05:00
Bobby Holley f458d41b8e Bug 1398119 - Rearrange NoteDirtyElement for faster bailouts on the same restyle root. r=emilio
This eliminates ~90% of the time spent in NoteDirtyElement on this testcase.

MozReview-Commit-ID: Lm5hf7QRiOK
2018-01-12 12:05:40 -08:00
Cameron McCormack 8731df3c34 Bug 1427512 - Part 29: Remove nsIDOMCSSDeclaration. r=xidorn,jryans,bz
This removes the .style attribute from nsIDOMSVGElement, but there
shouldn't be any users of that.

MozReview-Commit-ID: LOBSFo85Utn
2018-01-11 16:17:57 +08:00
Bogdan Tara 73b4d6b26a Merge inbound to mozilla-central r=merge a=merge 2018-01-09 00:05:31 +02:00
John Dai d480d5e221 Bug 1419662 - Fix incorrect custom element type in CustomElementData. f=echen, r=smaug 2018-01-07 18:45:00 +02:00
Edgar Chen 821531562b Bug 1428244 - Part 2: Set correct oldValue/newValue for the attributeChangedCallback which is fired from style attribute change; r=smaug
MozReview-Commit-ID: 4l6XuCUHUh8

--HG--
extra : rebase_source : 23d825684dbd47ca125cd8468d2c8d22425e3cdf
2017-12-15 11:52:07 -06:00
Emilio Cobos Álvarez 1cda1ad876 Bug 1427511: Make GetFlattenedTreeParent more straight-forward. r=smaug
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 18:00:25 +01:00
Emilio Cobos Álvarez fd120385c7 Bug 1427001: Move SetXBLBinding and SetShadowRoot to Element. r=smaug
MozReview-Commit-ID: 6FL1HR2Isa
2017-12-31 13:45:58 +01:00
Boris Zbarsky 04324f18ad Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05:00
Emilio Cobos Álvarez 87520df9da Bug 1426503: Remove DestInsertionPoints stuff. r=smaug
MozReview-Commit-ID: KtaEqZn9GH3

--HG--
extra : rebase_source : 54b76e2437cd3031d12973b7021ba740474f07e3
2017-12-20 22:08:15 +01:00
Olli Pettay 2acfb90235 Bug 1422092 - Revert the changes made by bug 1399603. r=mrbkap 2017-12-10 14:52:49 -05:00
Brad Werth 2b55f1e881 Bug 1409083 Part 2: Stub webidl definitions to support flex container/item properties. r=smaug
MozReview-Commit-ID: KwNykBkJfPi

--HG--
extra : rebase_source : 6b858035d6d2850afbe310658a65a6f7dd2baa8f
2017-11-15 13:20:35 -08:00
Phil Ringnalda 9d10710b26 Backed out 5 changesets (bug 1409083) for eslint failures
Backed out changeset 9de539be3665 (bug 1409083)
Backed out changeset 660e79af5c93 (bug 1409083)
Backed out changeset 574cd09aad41 (bug 1409083)
Backed out changeset b21b06a24705 (bug 1409083)
Backed out changeset b21e6a795493 (bug 1409083)
2017-12-07 19:47:09 -08:00
Brad Werth c9a6a8be69 Bug 1409083 Part 2: Stub webidl definitions to support flex container/item properties. r=smaug
MozReview-Commit-ID: KwNykBkJfPi

--HG--
extra : rebase_source : 0e879bc306ca2d17d7e5412bf7d76e8af248b2f2
2017-11-15 13:20:35 -08:00
Emilio Cobos Álvarez 3125691c3f Bug 1422528: Inline and make stylo take the rare path for GetClasses directly. r=bz
Servo already checks MayHaveClass. This should improve Gecko performance, too.

MozReview-Commit-ID: KpVOVsKh6pe

--HG--
extra : rebase_source : b0384546b1430915a18536b6ee8b29a936599873
2017-12-02 21:45:33 +01:00
Emilio Cobos Álvarez 50dad1e139 Bug 1422529: Make some trivial element methods final and inline. r=bz
Give the compiler the chance to devirtualize / inline a bit more.

MozReview-Commit-ID: D5u2AxaZ7a1

--HG--
extra : rebase_source : e235b8b60322a113f459067e2762ea237cb26ec5
2017-12-02 22:13:31 +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
Boris Chiou 00c502e025 Bug 1408310 - Part 4: Store mIsServo into DOMMatrixReadOnly. r=heycam
So we can know which backend we are using.

MozReview-Commit-ID: Jfpt82lv0hw

--HG--
extra : rebase_source : 3b0c130f70430589f7823439435ab3f0a6459ebe
2017-11-14 16:47:07 +08:00
Edgar Chen f6cde405ab Bug 1419310 - Part 2: Enqueue an attributeChanged reaction when mutating the value of an observed attribute to the same value; r=smaug
MozReview-Commit-ID: GyRL6Xt8HWt

--HG--
extra : rebase_source : 657cdf6dcad0f886f99a2e466a19cfb45c9195dc
2017-11-22 23:48:34 +08: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
Cosmin Sabou a5d613086a Merge mozilla-inbound to mozilla-central r=merge a=merge 2017-11-23 11:42:46 +02:00
Emilio Cobos Álvarez 72a1d3ff81 Bug 1419554: Teach the restyle root code about elements outside of the flattened tree. r=heycam
The textarea is inserted under a Shadow host, with no matching insertion point,
so its flattened tree parent node is null.

We're treating this case in the restyle root code as "the parent is the
document", but that's very wrong.

MozReview-Commit-ID: JlzUMRIYaYZ

--HG--
extra : rebase_source : feeaf7a7333097aa87b35358172472790f6c74a7
2017-11-22 14:15:34 +01:00
Kris Maglione 0af54ad118 Bug 1415352: Part 4a - Capture subject principal in innerHTML setters. r=bz
This is necessary in order to capture the correct triggering principal for
inline <style> nodes.

MozReview-Commit-ID: 9EaD40vRNkH

--HG--
extra : rebase_source : cdd4a730f24dc57783edcf666ae803379c0d6173
2017-11-07 13:48:58 -08:00
Kris Maglione 1c66345e09 Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz
This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la

--HG--
extra : rebase_source : 5dba46f61d70ec647cae16383b62961ac72d2f47
2017-11-01 20:35:52 -07:00
Brad Werth c9815751c2 Bug 1414920 Part 1: Add chrome-only API getElementsWithGrid(), for devtools. r=dholbert,smaug
MozReview-Commit-ID: L44Q95wEqDA

--HG--
extra : rebase_source : d3892120516b30b1ee090ed7b9f5a108313d0532
2017-10-31 12:05:02 -07:00