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

586 Коммитов

Автор SHA1 Сообщение Дата
Cosmin Sabou 6b126c3ff0 Backed out 2 changesets (bug 1519185) build bustages on nsMenuGroupOwnerX.mm. CLOSED TREE
Backed out changeset e1de5282e21a (bug 1519185)
Backed out changeset 00d8afb01890 (bug 1519185)

--HG--
extra : rebase_source : d92a7d4606992503f24c66093d35676e12a84ff0
2019-01-29 18:22:46 +02:00
garvitdelhi 3b6550b93f Bug 1519185: Remove AttributeWillChange aNewValue parameter r=emilio,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D17073

--HG--
extra : moz-landing-system : lando
2019-01-29 15:27:02 +00:00
garvitdelhi d7ec2f37e6 Bug 1519185: Remove the class attribute preparsing code. r=emilio,bzbarsky
Refactoring code base

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

--HG--
extra : moz-landing-system : lando
2019-01-29 15:24:21 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez 729263c3df Bug 1511563 - Don't make NAC editable by default. r=masayuki
I think this is a more consistent fix for the issue.

Differential Revision: https://phabricator.services.mozilla.com/D16521
2019-01-15 11:52:35 +01:00
James Teh 5dc4d81ca1 Bug 1514687 - Allow accessibility code to focus XUL radio buttons without selecting them. r=bgrins,smaug,MarcoZ,paolo
1. This requires exposing radiogroup's focusedItem property to C++.
Unfortunately, there's no existing equivalent in nsIDOMXULSelectControlItemElement.
radiogroup is the only element that needs this, so a new interface has been created for it.

2. Accessibility uses focusedItem instead of selectedItem when setting focus.

3. When an item is focused, accessibility needs to be notified.
This is done using a DOMMenuItemActive event.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 04:52:50 +00:00
Masayuki Nakano f8844f0d9b Bug 181137 - part 7: Get rid of nsIContentIterator interface r=smaug
Now, nobody requires nsIContentIterator interface.  So, we can get rid of it.

Unfortunately, there is no macro to keep the inherited class,
ContentSubtreeIterator, in the cycle collection to make it keep managing
ContentSubtreeIterator::mRange without nsISupports interface.  Therefore, this
patch moves it into ContentIteratorBase temporarily.  Anyway, the following
patch makes those classes not refcountable.  At that time, this issue will be
fixed.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 01:51:42 +00:00
Csoregi Natalia 13506c036a Backed out 8 changesets (bug 181137) for bustage on FragmentOrElement.cpp:1751. CLOSED TREE
Backed out changeset 99a977d519a0 (bug 181137)
Backed out changeset 65a4b245e851 (bug 181137)
Backed out changeset 5385d5fd9b8b (bug 181137)
Backed out changeset 83bec02c21d9 (bug 181137)
Backed out changeset b7ab59bf545e (bug 181137)
Backed out changeset b6fc7a332db7 (bug 181137)
Backed out changeset 654fdbad67db (bug 181137)
Backed out changeset 90a1ff49b6b1 (bug 181137)

--HG--
rename : dom/base/ContentIterator.h => dom/base/nsContentIterator.cpp
rename : editor/spellchecker/FilteredContentIterator.cpp => editor/spellchecker/nsFilteredContentIterator.cpp
rename : editor/spellchecker/FilteredContentIterator.h => editor/spellchecker/nsFilteredContentIterator.h
2019-01-10 11:42:27 +02:00
Masayuki Nakano 91a9670801 Bug 181137 - part 7: Get rid of nsIContentIterator interface r=smaug
Now, nobody requires nsIContentIterator interface.  So, we can get rid of it.

Unfortunately, there is no macro to keep the inherited class,
ContentSubtreeIterator, in the cycle collection to make it keep managing
ContentSubtreeIterator::mRange without nsISupports interface.  Therefore, this
patch moves it into ContentIteratorBase temporarily.  Anyway, the following
patch makes those classes not refcountable.  At that time, this issue will be
fixed.

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

--HG--
extra : moz-landing-system : lando
2019-01-10 08:47:54 +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
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Emilio Cobos Álvarez 63814207cb Bug 1516853 - Merge nsIDocument and nsDocument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D15498

--HG--
extra : moz-landing-system : lando
2018-12-31 14:10:19 +00:00
Emilio Cobos Álvarez 006a4ab94a Bug 1516366 - Move nsOnloadBlocker and nsDocumentOnStack to nsDocument.cpp, and shrink nsDocument.h to the minimmum. r=smaug
This needs to add a few of includes in other places which were relying on the
massive (now gone) list in nsDocument.h.

I also needed to move an AnimationTimeline destructor out of line because it
relied on dom::Animation being defined, yet Animation.h includes
AnimationTimeline.h, so include hell.

Differential Revision: https://phabricator.services.mozilla.com/D15366
2018-12-29 20:41:42 +01:00
longsonr 3d04ba9c9e Bug 1515187 - Part 4 Rename nsSVGElement to SVGElement and put it in the mozilla:dom namespace r=dholbert
--HG--
rename : dom/svg/nsSVGElement.cpp => dom/svg/SVGElement.cpp
rename : dom/svg/nsSVGElement.h => dom/svg/SVGElement.h
2018-12-21 08:58:14 +00:00
Timothy Guan-tin Chien 3913ded230 Bug 1510848 - Do not unattach UA Widget Shadow Root if the element is already re-attached to the tree r=emilio,smaug
This patch moves all UA Widget calls to helper functions in Element.cpp. The helper function AttachAndSetUAShadowRoot sets the shadow root in a runnable, so that it is in the same order of NotifyUAWidget* runnables.

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

--HG--
extra : moz-landing-system : lando
2018-12-15 02:48:46 +00:00
Neil Deakin 2ceb209681 Bug 1492326, revert some of bug 1478372, so that callers need to get the custom interface from a custom element without using QueryInterface, r=peterv 2018-12-04 11:33:06 -05:00
Neil Deakin 90cfd345ef Bug 1492326, add helpers to Element to get nsIDOMXUL* and nsIBrowser interfaces implented by custom elements, r=peterv 2018-12-04 11:25:42 -05:00
Olli Pettay 1ceeb71b80 Bug 1512256 - Move FragmentOrElement::mAttrs to Element, r=ehsan 2018-12-06 15:58:40 +02: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
Mats Palmgren 0196497399 Bug 1510674 - Remove a few unnecessary #include "nsCSSFrameConstructor.h". r=emilio
There are no uses of any frame-ctor things in these files AFAICT.
2018-11-29 00:17:25 +01:00
Jonathan Watt 181d407b43 Bug 1510167. Mark some nsGkAtom* arguments as const in DOM code. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D13049

--HG--
extra : rebase_source : 66db700ce58e88ab95c24e9dbc70ba4815e94df1
2018-11-13 12:48:21 +00:00
Emilio Cobos Álvarez 9ed36d7ba6 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

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

--HG--
extra : moz-landing-system : lando
2018-11-26 09:21:37 +00:00
Brindusan Cristian 31f0c21cca Backed out changeset 1575904619b5 (bug 1506547) for mochitest failures on test_reftests_with_caret.html. 2018-11-26 03:03:14 +02:00
Emilio Cobos Álvarez b74c31e4d9 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

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

--HG--
extra : moz-landing-system : lando
2018-11-25 20:01:07 +00:00
Tim Huang 6df9f5c18d Bug 1492766 - Part 2: Makes the set/releasePointerCapture working properly when fingerprinting resistance is enabled r=masayuki,arthuredelstein,smaug
When fingerprinting resistance is enabled, content should only view the
pointer capture events from the spoofed interface. In order to do so,
first, we need to restrict content to only set or release pointer capture
for only the spoofed pointer id. Second, we have to map other interfaces
into the spoofed one for pointer capture events.

Depends on D9531

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

--HG--
extra : moz-landing-system : lando
2018-11-19 16:36:14 +00:00
Olli Pettay 38e707f631 Bug 1508085 - Track the sizes of commonly used node types also in 32 bit builds, r=ehsan
--HG--
extra : rebase_source : 78d99f7dff782404d7dbb0a27624f7d8cd060eaa
2018-11-19 18:33:42 +02:00
Timothy Guan-tin Chien af2973ef61 Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

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

--HG--
extra : moz-landing-system : lando
2018-11-15 06:52:01 +00:00
Andreea Pavel d51566f085 Backed out 2 changesets (bug 1503019) for failing crashtests at dom/base/crashtests/1505811.html on a CLOSED TREE
Backed out changeset 06b12fd41ff1 (bug 1503019)
Backed out changeset 7b845eac9dd7 (bug 1503019)
2018-11-15 01:52:30 +02:00
Timothy Guan-tin Chien c69315234b Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

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

--HG--
extra : moz-landing-system : lando
2018-11-14 19:37:42 +00: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
Alexander Surkov 3395e926b6 Bug 1497940 - add nsGenericHTMLElement::AttachAndSetUAShadowRoot helper method, r=smaug 2018-11-02 12:18:20 +08:00
Emilio Cobos Álvarez 647ca98295 Bug 1502875 - Don't let GetElementById work across anonymous subtree boundaries in XUL documents. r=smaug
According to comment 3 the front-end no longer needs it.

Differential Revision: https://phabricator.services.mozilla.com/D10076
2018-10-29 22:43:35 +01:00
Emilio Cobos Álvarez d08ae18dd8 Bug 1502875 - Don't call AddToIdTable when moving around a shadow root. r=smaug
This is needed to make the following patch work.

Differential Revision: https://phabricator.services.mozilla.com/D10083
2018-10-29 22:43:30 +01:00
Ryan Hunt d4c042f28a Bug 1453425 - Use ScrollByCSSPixels in relative scrolling DOM API's. r=botond
This commit changes `Window::ScrollBy` and `Element::ScrollBy` to use
ScrollByCSSPixels in preparation for marking ScrollByCSSPixels as a
relative scroll API.

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

--HG--
extra : rebase_source : fa82acc12395569bd332573718f8a8013ac20b60
extra : histedit_source : 7ac061e65a2522051ed73f3ba6349d5ea696e15f
2018-10-05 19:06:40 -05:00
Cameron McCormack a7510da8d0 Bug 1499408 - Part 2: Have css::URLValue get URLExtraData from its CssUrlData. r=emilio
MozReview-Commit-ID: IqZGzkHlSZD

Depends on D8874

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

--HG--
extra : moz-landing-system : lando
2018-10-17 09:43:32 +00:00
Cameron McCormack 4c8408b3c2 Bug 1496308 - Require URLExtraData::mPrincipal to be non-null r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D7682

--HG--
extra : moz-landing-system : lando
2018-10-10 03:10:07 +00:00
Andrea Marchesini cf687d4b6a Bug 1495362 - FeaturePolicy: fullscreen, r=smaug 2018-10-04 14:34:37 +02:00
Nicholas Nethercote 36c48819d1 Bug 1451169 - Use `nsStaticAtom*` instead of `nsStaticAtom**` in Element.h. r=baku
--HG--
extra : rebase_source : db09f7ab93a1c41ace03a645623f78a27ecfff8c
2018-04-03 13:21:06 +10:00
Emilio Cobos Álvarez 27d103ae6b Bug 1484285 - Avoid loading XBL bindings for stuff that is very likely to be a custom-element. r=smaug
This should be more generic than hardcoding the tags, and be enough for our
chrome to avoid regressions as they migrate more stuff to CE, avoiding calling
into the GetComputedStyle machinery..

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

--HG--
extra : moz-landing-system : lando
2018-09-21 21:29:25 +00:00
Brian Grinstead 6f15c7154f Bug 1465592 - Enable Shadow DOM unconditionally in chrome documents;r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D6278

--HG--
extra : moz-landing-system : lando
2018-09-20 18:18:32 +00:00
Xidorn Quan 93d16f9841 Bug 1491212 part 2 - Have a new FullscreenChange superclass split from FullscreenRequest. r=smaug
The next patch would create another subclass of FullscreenChange for
handling fullscreen exit.

Depends on D5988

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

--HG--
rename : dom/base/FullscreenRequest.h => dom/base/FullscreenChange.h
extra : moz-landing-system : lando
2018-09-17 23:20:28 +00:00
Xidorn Quan 8327aa1e34 Bug 1188256 part 7 - Have Element.requestFullscreen return a Promise. r=smaug
Depends on D5858

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

--HG--
extra : moz-landing-system : lando
2018-09-14 22:44:21 +00:00
Xidorn Quan ddbf5f6f54 Bug 1188256 part 4 - Move fullscreenerror dispatching into FullscreenRequest. r=smaug
Depends on D5850

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

--HG--
extra : moz-landing-system : lando
2018-09-14 19:07:10 +00:00
Xidorn Quan 1cb11a93d6 Bug 1188256 part 2 - Make constructor of FullscreenRequest private and use create functions for building the object. r=smaug
This is done so that we can encapsulate more logic in this struct in following commits.

Depends on D5847

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

--HG--
extra : moz-landing-system : lando
2018-09-14 19:01:33 +00:00
Xidorn Quan 740ca1c8f3 Bug 1188256 part 1 - Move FullscreenRequest into a separate header and inline its methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D5847

--HG--
extra : moz-landing-system : lando
2018-09-14 18:57:08 +00:00
Xidorn Quan abdaa90858 Bug 1375319 part 3 - Try dispatching fullscreen events to element first rather than document. r=smaug
Some steps in file_fullscreen-api.html are adjusted in order to test
the behavior that the event is correctly dispatched to the document
when element is disconnected.

Depends on D5415

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

--HG--
extra : moz-landing-system : lando
2018-09-14 00:06:16 +00:00
Xidorn Quan 2629806922 Bug 1490539 part 3 - Put CallerType into FullscreenRequest. r=smaug
Depends on D5640

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

--HG--
extra : moz-landing-system : lando
2018-09-12 19:28:53 +00:00
Xidorn Quan 30703bafcb Bug 1490539 part 1 - Change FullScreen to Fullscreen in various names. r=smaug
Some methods on Window are not changed because they are part of public
interface. Method names from widget are also unchanged.

Many "full-screen" in comments are also updated to "fullscreen" instead.

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

--HG--
extra : moz-landing-system : lando
2018-09-12 15:51:30 +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
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