Commit Graph

57 Commits

Author SHA1 Message Date
Brian Grinstead
336ddd77ec Bug 1541516 - Instrument base custom element class and print call information in the console r=aswan
If MOZ_INSTRUMENT_CUSTOM_ELEMENTS is set in the environment, then modify Custom Elements
to wrap each function and property lookup to keep a count and running time. Then print out
tables for each element at startup. Tables can be re-printed with `MozElements.printInstrumentation()`.

Differential Revision: https://phabricator.services.mozilla.com/D24953
2019-04-10 17:34:43 +00:00
Alexander Surkov
db46369850 Bug 1542844 - All wizards displays [Done] button from the point where they open on OS X, r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D26734
2019-04-09 21:16:07 +00:00
Paul Morris
17e2392eaa Bug 1531870 - [de-xbl] convert popup binding to custom element; r=bgrins
For now, only add the MozMenuPopup base class to MozElements,
and don't define a custom element for it with
`customElements.define`. This is to help avoid conflicts in
de-xbl work. (See the bug for details.)

Includes a function to do 'manual slotting', moving child
elements into place. Dynamically adding, modifying, or
removing child nodes after the element is connected needs
to be handled manually as well.

Differential Revision: https://phabricator.services.mozilla.com/D25467
2019-03-30 00:05:08 +00:00
Andrew Swan
b8ac7ba04c Bug 1535182 Remove BaseElementMixin and MozElementMixin from window global r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D24828
2019-03-26 21:43:13 +00:00
Alexander Surkov
2f610cf2fa Bug 1534685 - make all custom elements to use the attribute inheritance base implementation, r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D23541
2019-03-14 21:44:54 +00:00
Alexander Surkov
df3e06b6c7 Bug 1495622 - Conver wizardpage binding to Custom Elements, r=paolo 2019-03-06 10:27:25 -05:00
Alexander Surkov
3f9b78201a Bug 1525101 - Convert autocomplete-rich-result-popup into a Custom Element, r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D20506
2019-03-05 17:45:57 +00:00
Gijs Kruitbosch
50e23af3b9 Bug 1532071 - call formatAccessKey when inheriting accesskey attributes into labels, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D22102
2019-03-05 15:30:00 +00:00
Alexander Surkov
079a834145 Bug 1455433 - migrate xul:checkbox to CE, r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D21457
2019-02-28 20:32:50 +00:00
Brian Grinstead
6cee42211f Bug 1528969 - Only remove whitespace-only text nodes in parseXULToFragment r=MattN
It was supposed to be doing this already, but we were instead removing _all_ text
nodes, which led the the "Learn More" link not showing up in popupnotifications

Differential Revision: https://phabricator.services.mozilla.com/D20379
2019-02-19 23:28:30 +00:00
Brian Grinstead
e43c8faeb7 Bug 1527680 - Add MozElement inheritedAttributes helper for automatically inheriting attributes based on a map of selectors to attributes r=paolo
This allows elements to skip explicitly declaring `observedAttributes` and then imperatively
calling `inheritAttribute` on the appropriate child nodes. For simple cases this means less
boilerplate and moving this logic into the base class.

This is an opt-in feature, so more complex cases can continue to manually implement inheriting
behavior as before.

Differential Revision: https://phabricator.services.mozilla.com/D19702
2019-02-15 23:10:18 +00:00
Daniel Varga
c09ccb7631 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2019-02-15 03:51:05 +02:00
Brendan Dahl
d03c401b9b Bug 1527733 - Remove special XUL DOM tree traversal. r=smaug
Move functionality out of XULDocument::AddElementToDocumentPost:
1) Convert all XUL link elements into HTML link elements which have
code to handle when they are added to the DOM.
2) Move handling of the end of a linkset element into nsXULElement's DoneAddingChildren callback.
3) Move document direction reset to where the root element is created.

Differential Revision: https://phabricator.services.mozilla.com/D19739
2019-02-14 10:43:35 +00:00
Alexander Surkov
62ec0b0d61 Bug 1527495 - migrate text-link binding to CE, r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D19595
2019-02-12 19:14:40 -05:00
Brian Grinstead
2a3775c12b Bug 1527105 - Convert menucaption to Custom Element r=paolo
Differential Revision: https://phabricator.services.mozilla.com/D19439
2019-02-12 19:08:25 +00:00
Brian Grinstead
9b228af222 Bug 1526826 - Make BaseTextMixin extend BaseControlMixin r=surkov
Differential Revision: https://phabricator.services.mozilla.com/D19316
2019-02-11 17:33:07 +00:00
Brian Grinstead
c8a487965d Bug 1487065 - Implement popup-notification as a Custom Element r=MattN
Differential Revision: https://phabricator.services.mozilla.com/D17699
2019-02-07 22:16:26 +00:00
Alexander Surkov
387db050e8 Bug 1519486 - convert autocomplete-richlistitem-insecure-field XBL binding to CE, r=bgrins 2019-01-24 08:40:22 -05:00
Myk Melez
5ecc2c1225 Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D17526
2019-01-30 17:26:25 +00:00
Cosmin Sabou
bf63534551 Merge mozilla-inbound to mozilla-central. a=merge 2019-01-29 12:01:56 +02:00
Brian Grinstead
6f5948e68d Bug 1523429 - Skip updating child attributes in MozElement.inheritAttribute if the host attribute hasn't changed r=timdream
Differential Revision: https://phabricator.services.mozilla.com/D17887
2019-01-28 23:57:24 +00:00
Timothy Guan-tin Chien
4dc1b99fe7 Bug 1518932 - Convert menulist to custom element r=paolo
This custom element replaces XBL <content> usage by directly prepend the two needed child nodes when the element is connected.

This is doable because

- There isn't any direct access of child nodes under <menulist>. Everyone seems to access via .menupopup, which is usually the only child.
- We don't need to move the children under <menulist>. If we need to and if the child is a <xbl:children> (which could happen if <menulist> is inside an XBL <content> that just get cloned to the document), the layout will get very confused and crash (see finding in bug 1514926)

Differential Revision: https://phabricator.services.mozilla.com/D16149
2019-01-28 18:24:08 +00:00
Timothy Guan-tin Chien
5799910670 Bug 1518932 - Create BaseControlMixin, allowing BaseControl to inherit other native XULElement classes r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D14925
2019-01-28 18:24:06 +00:00
Kris Maglione
856fa07b17 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750
2019-01-17 10:18:31 -08:00
Brian Grinstead
d3484f107d Bug 1441935 - Modifications on top of the generated MozBrowser Custom Element r=mconley
In order to make the history easier to navigate, this changeset includes the
modifications required to make <xul:browser> actually work as a Custom Element,
and switches the app to use it instead of the XBL browser.

Differential Revision: https://phabricator.services.mozilla.com/D14911
2019-01-10 01:45:43 +00:00
Tim Nguyen
3cb522cf2a Bug 1437641 - Remove numberbox binding and convert usages to input[type=number]. r=bgrins,dao
Differential Revision: https://phabricator.services.mozilla.com/D15882
2019-01-09 08:51:32 +00:00
Paolo Amadini
fc8541ebe3 Bug 1472558 - Convert "richlistbox" to Custom Element. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D15502
2018-12-31 07:54:10 +00:00
Neil Deakin
4ce4b241a1 Bug 1492326, don't use 'instanceof nsiDOMXUL*' in toolkit and mobile files, r=paolo 2018-12-04 11:33:06 -05:00
Neil Deakin
fee1676951 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
Paolo Amadini
b5d46cdcfb Bug 1499947 - Part 2 - Remove the "progressmeter" element and related tests. r=bgrins,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D12145
2018-11-20 14:12:33 +00:00
Paolo Amadini
c695388eef Bug 1471403 - Part 4 - Convert "notificationbox" to a custom class. r=bgrins
As part of the conversion, support for notificationsHidden and children that are not notifications is also removed.

Differential Revision: https://phabricator.services.mozilla.com/D10894
2018-11-09 14:58:18 +00:00
Paolo Amadini
4283050926 Bug 1471403 - Part 3 - Add a MozElements namespace for element classes. r=bgrins
This provides a way to access specific element classes before any associated Custom Element is instantiated, without creating a new global for each class. This can be useful to access static methods, create derived classes in a page, or allow lazy custom constructors.

Differential Revision: https://phabricator.services.mozilla.com/D10893
2018-11-05 13:56:01 +00:00
Victor Porof
9adddfe8f6 Bug 1499423 - Migrate the 3 treecol bindings into a Custom Element, r=bgrins 2018-11-01 16:03:14 +01:00
Alexander Surkov
7b75f59a15 Bug 1502947 - Add helper function to MozXULElement for inheriting attributes;r=bgrins 2018-10-30 11:51:40 -07:00
Brian Grinstead
dfa8521d3c Bug 1501845 - Load customElements.js inside migration.xul to fix migration UI when running with commandline;r=paolo
This is another case of a document getting loaded before MainProcessSingleton,
similar to profile manager. There's another wrinkle here, though. The migration
UI can also be loaded _after_ startup (through Bookmarks manager), which is
actually the primary way this UI is surfaced. So we need to also handle customElements.js
getting loaded twice into the same window to avoid attempting to redefine everything.

Differential Revision: https://phabricator.services.mozilla.com/D9713
2018-10-26 17:22:15 +00:00
Brian Grinstead
709f8f76b3 Bug 1499476 - Add the ability to mixin the base MozXULElement;r=paolo
Differential Revision: https://phabricator.services.mozilla.com/D8898
2018-10-16 19:59:16 +00:00
Brian Grinstead
f5070f858e Bug 1496425 - Provide a mechanism for Custom Elements to delay connectedCallback until after DOMContentLoaded;r=paolo
There are two reasons for this:
1) It's faster than running the connectedCallback in the middle of document parse, at least for
   <radiogroups> in about:preferences
2) It provides a construction sequence more similar to XBL, so the translation from XBL <constructor>
   to CE connectedCallback is more likely to be correct. This is because when there is markup like:
       <parent-ce><child-ce></child-ce></parent-ce>
   the parent-ce node is empty during the first connectedCallback. If we wait for DOMContentLoaded
   then the parent-ce has the child-ce node below it.

Differential Revision: https://phabricator.services.mozilla.com/D7944
2018-10-08 21:17:39 +00:00
Alexander Surkov
36ae6997c9 Bug 1491197 - replace progressmeter XBL binding by a custom element, r=paolo 2018-10-03 11:13:05 +05:00
Brian Grinstead
2526b01318 Bug 1481949 - Migrate <radiogroup> to a Custom Element;r=timdream
Differential Revision: https://phabricator.services.mozilla.com/D6326
2018-10-01 18:01:02 +00:00
Brian Grinstead
0c63a5cfa9 Bug 1481949 - Don't load Custom Element script files for dummy.xul windows;r=kmag
They are unnecessary for most every element, and we load multiple dummy.xul
documents even in clean profiles.

Differential Revision: https://phabricator.services.mozilla.com/D7112
2018-10-01 18:01:00 +00:00
Brian Grinstead
f5fda6062b Bug 1460982 - Convert <searchbar> to a Custom Element;r=adw
Differential Revision: https://phabricator.services.mozilla.com/D5912
2018-09-27 23:09:55 +00:00
Neil Deakin
391527bbdf Bug 1478372, remove unneeded QueryInterface implementation for custom XUL elements as this is now done by nsXULElement::QueryInterface, r=bgrins 2018-09-19 06:46:55 -04:00
Brian Grinstead
0f17ed7fb6 Bug 1492247 - Allow for null document.head in browser.xhtml inserting localization links;r=zbraniecki
This prevents an exception in browser.xhtml when there's no head, since
it's currently sharing the markup with browser.xul.

Differential Revision: https://phabricator.services.mozilla.com/D6194
2018-09-18 21:45:51 +00:00
Brian Grinstead
c67338b696 Bug 1411707 - Switch findbar and findbar-textbox from XBL bindings into a Custom Element;r=paolo
MozReview-Commit-ID: F95i9H9FvYv

Differential Revision: https://phabricator.services.mozilla.com/D5596
2018-09-14 18:30:31 +00:00
Brian Grinstead
c5854a2bff Bug 1490457 - Add test for dynamically inserted localization links after parse;r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D5781
2018-09-14 00:31:36 +00:00
Mark Banner
462116b7f9 Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Automatic changes by ESLint, except for manual corrections for .xml files.

Differential Revision: https://phabricator.services.mozilla.com/D4439
2018-08-31 05:59:17 +00:00
Brian Grinstead
e12d19ba8f Bug 1469902 - Migrate <tabbox> to a Custom Element;r=dao
MozReview-Commit-ID: HNDiMYmKgkg

Differential Revision: https://phabricator.services.mozilla.com/D3989
2018-08-28 16:07:28 +00:00
ExE Boss
58ddd41f6d Bug 1473130 - Change parseXULToFragment to take an array of URLs for entities r=paolo
Differential Revision: https://phabricator.services.mozilla.com/D4024
2018-08-27 09:40:40 +00:00
Brian Grinstead
9598965724 Bug 1478139 - Migrate <editor> to a Custom Element. r=paolo
MozReview-Commit-ID: IiTzndil1MV
2018-08-06 14:22:02 +01:00
Brian Grinstead
145b5944ce Bug 1470910 - Migrate input-box and input-box-spell to a Custom Element;r=paolo
Instead of `<xul:hbox class="textbox-input-box">`, consumers now should use
`<xul:moz-input-box />`. This covers the normal case and also handles
[spellcheck=true] while sharing much of the code within one class.

MozReview-Commit-ID: DjvT8sFq3SQ
2018-08-02 20:53:59 -07:00