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

156 Коммитов

Автор SHA1 Сообщение Дата
Henrik Skupin 1ed947aff2 Bug 1587627 - [marionette] Remove `Anon` and `AnonAttribute` strategies from "WebDriver:FindElement" and "WebDriver:FindElements" command. r=webdriver-reviewers,maja_zf
Differential Revision: https://phabricator.services.mozilla.com/D50804

--HG--
extra : moz-landing-system : lando
2019-10-29 12:55:35 +00:00
Narcis Beleuzu 41e019fb57 Backed out changeset 79be8382d57a (bug 1587627) for bc failures on browser_all_files_referenced.js . CLOSED TREE 2019-10-29 14:06:44 +02:00
Henrik Skupin e8f5161a31 Bug 1587627 - [marionette] Remove `Anon` and `AnonAttribute` strategies from "WebDriver:FindElement" and "WebDriver:FindElements" command. r=webdriver-reviewers,maja_zf
Differential Revision: https://phabricator.services.mozilla.com/D50804

--HG--
extra : moz-landing-system : lando
2019-10-28 18:31:17 +00:00
Brendan Dahl 0a8d6f243d Bug 1551344 - Part 2: Update outdated comments referencing XULDocument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D41239

--HG--
extra : moz-landing-system : lando
2019-08-09 17:47:41 +00:00
Victor Porof 2b036e45c5 Bug 1561435 - Format testing/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : c0948f31e520ca087279cf429ca5f1db5a8341b8
2019-07-05 11:01:24 +02:00
Frederik Braun 18a04317f0 Bug 1548773: Remove support for typemustmatch r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D29803

--HG--
extra : moz-landing-system : lando
2019-05-05 14:41:59 +00:00
Myk Melez 25349d2601 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

--HG--
extra : moz-landing-system : lando
2019-01-30 17:26:25 +00:00
Kris Maglione e930b89c34 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

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Olli Pettay 25784a5a17 Bug 1512259 - No need to special case <button> in marionette, r=ato
--HG--
extra : rebase_source : 8489d12617508e0a7ab2e1ef526d854d031405ab
2018-12-04 17:30:43 +02:00
Andreas Tolfsen 67c1b23922 bug 1499360: marionette: convert in-view centre point to css pixels; r=whimboo
When the in-view centre point contains a floating point, we need to
ensure to convert it to CSS pixels before passing it on to Gecko internals
such as DOMElement.elementsFromPoint and DOMWindowUtils.sendMouseEvent.

For example, with a click target that is a 1x1 square, the in-view
centre point prior to this patch was calculated to (0.5,0.5).
elementsFromPoint will (correctly?) round this coordinate down and
return the paint tree for the DOM element at (0,0) coordinates.

By contrast, sendMouseEvent will click coordinates (1,1) because it
rounds up.  To make sure we all speak the same language internally,
we round the centre point down.

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

--HG--
extra : moz-landing-system : lando
2018-10-22 14:21:27 +00:00
Henrik Skupin c1af84a166 Bug 1405370 - [marionette] Avoid usage of "window" for function arguments.
To avoid confusion with the global "window" object we should
avoid using this name as function argument.

Changes for driver.js are left-out and will be done by the
patch on bug 1311041.

--HG--
extra : rebase_source : f15714af3a422476923d096eb8cb837ae474c675
2018-09-18 14:51:21 +02:00
Wambui ed1ae60ec8 Bug 1400233 - Drop ContentWebElement.LegacyIdentifier key from Marionette. r=ato,whimboo
Remove the legacy key that Marionette uses to identify web elements.
2018-07-27 16:06:39 +01:00
Paolo Amadini 98b8539d10 Bug 1472555 - Part 4 - Remove the "listbox" bindings. r=bgrins
MozReview-Commit-ID: Cw90DjEMJpn

--HG--
extra : rebase_source : 74a64794699d65b2a9fe5ae4cb215403657d9e4a
2018-07-18 11:23:22 +01:00
David Burns dd33e2c33f Bug 1387678 - Call elementsFromPoint on the correct document node; r=ato
elementsFromPoint will return the top level element of a shadow DOM
and not the elements within. If we are on the top level document we
need to make sure to use the correct rootNode.

MozReview-Commit-ID: ATvCidAFEeM

--HG--
extra : rebase_source : c6c8e20745a64b19cc0d1784044efe4fed4af9bf
2018-04-28 00:24:58 +01:00
David Burns 7b1dbf5a3f Bug 1387678 - Remove unused reference to container variable; r=ato
MozReview-Commit-ID: IVWtmbSuXiw

--HG--
extra : rebase_source : a7d75cb615cdfbc4b4a8d55c5be9d7ca57e0e970
2018-04-28 00:18:53 +01:00
Boris Zbarsky 16e02a5e28 Bug 1460735 part 1. Remove use of nsIDOMDocument in JS. r=qdot
There are some places where we have a thing which may not even be a node, and
we end up hardcoding the value of DOCUMENT_NODE there, because
"foo.nodeType == foo.DOCUMENT_NODE" will test true if foo is not a node: both
sides will be undefined.
2018-05-29 13:39:00 -04:00
Andreea Pavel d45f43c124 Backed out changeset 6fd96d40bdb3 (bug 1400233) at request a=backout r=whimboo 2018-04-06 10:08:55 +03:00
wambui e4f7f97546 Bug 1400233 - Drop ContentWebElement.LegacyIdentifier key from Marionette; r=ato
Remove the legacy key that Marionette uses in addition to the identifier key.

MozReview-Commit-ID: 6IVtLxOJPoS

--HG--
extra : rebase_source : 8c4628d32cdcc7b1b7145b8c7c2660708f3bd20d
2018-03-13 11:56:13 +03:00
Henrik Skupin 30775ef148 Bug 1381519 - Find element for (partial) link text has to use rendered content. r=ato
To retrieve links via "link text" or "partial link text" the rendered
content of the element has to be used. This can be the case for CSS
transformations like "uppercase".

MozReview-Commit-ID: fxaHEuWnbf

--HG--
extra : rebase_source : d283275a538662e1f199fd5646997f302c4b8ac7
2017-12-05 13:25:09 +01:00
Coroiu Cristina 6915bab3ba Backed out changeset 5ba7d67fddaa (bug 1381519) for linting failures at builds/worker/checkouts/gecko/testing/marionette/element.js on a CLOSED TREE 2018-03-21 20:40:38 +02:00
Henrik Skupin 524588210f Bug 1381519 - Find element for (partial) link text has to use rendered content. r=ato
To retrieve links via "link text" or "partial link text" the rendered
content of the element has to be used. This can be the case for CSS
transformations like "uppercase".

MozReview-Commit-ID: fxaHEuWnbf

--HG--
extra : rebase_source : 9336a5ede468046e06f065f401a461dde5848a18
2017-12-05 13:25:09 +01:00
Cameron McCormack 234b89c117 Bug 1435666 - Part 3: Remove nsIDOMXPathResult. r=bz
MozReview-Commit-ID: 9j6dUlanNTi

--HG--
extra : rebase_source : 9a790516379441d4e048009bcacdd26e93fde6ae
2018-02-05 11:39:18 +08:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Andreas Tolfsen 44b2be2861 Bug 1430575 - Adjust editable definition to match WebDriver. r=automatedtester
Introduces a new function, isMutableFormControl, to the element
module in Marionette that tests if an element is a form control
that can be edited by the user.  This replaces the proprietary
UNEDITABLE_INPUTS set used previously.

An editable element is, according to the WebDriver standard, an
element which belongs to the two subcategories of editable elements.
This patch implements the first category of the mutable form controls.

MozReview-Commit-ID: Aix19mq3lcb

--HG--
extra : rebase_source : 1e3d671cd2d3ff618bf2fff3a2d8dadbd82d0540
2018-01-15 17:14:37 +00:00
Andreas Tolfsen 730854f761 Bug 1354211 - Add element.isEditingHost and element.isEditable. r=automatedtester
Introduces two new functions called element.isEditingHost, for
determining if an element is content-editable or part of a document
in design mode, and element.isEditable, which implements the
WebDriver-defined concept of what it means for an element to be editable.

WebDriver consideres an element editable if it is not read-only or
disabled, and one of the following conditions are met:

  - It is a <textarea> element.

  - It is an element that is not of the checkbox, radio, hidden,
    submit, button, or image types.

  - It is content-editable.

  - It belongs to a document in design mode.

MozReview-Commit-ID: 6U71uSUNwoI

--HG--
extra : rebase_source : c5702362d5be531b2e5b764fac13bb9db9f20f23
2017-12-31 14:52:46 +00:00
Andreas Tolfsen e2bea6dd58 Bug 1354211 - Add element.isDisabled. r=automatedtester
Adds a new function called element.isDisabled to test for disabledness.
An element is only considered disabled if it is indeed an element
that can be disabled, for example that it is a <button>, <input>,
<select>, <textarea>, <optgroup>, or <option> element.  All other
elements are not disabled.

In nested trees the disabledness state of a containing element
affects child elements, without this being refelected in the child
element's content IDL attribute.  In the following example, the
<option> element is disabled:

	<select disabled>
	  <option>foo
	</select>

Similarly:

	<select>
		<optgroup disabled>
			<option>bar
		</optgroup>
	</select>

This means we have to traverse the tree to find the closest ancestral
parent element, whether it is <optgroup> or <select>, and inspect
its state before we can be sure the element in question is not disabled.

MozReview-Commit-ID: 578zLNj7nXK

--HG--
extra : rebase_source : fb8f4dc519a57a8fb4849a098f1e06f79aa02c9f
2017-12-31 14:48:46 +00:00
Andreas Tolfsen 20643a5532 Bug 1354211 - Add element.isReadOnly. r=automatedtester
Introduces new function for testing whether an element is read-only.
This content IDL attribute only applies to <input> and <textarea>
elements.

MozReview-Commit-ID: 1YLizKUYMU6

--HG--
extra : rebase_source : 2d7dcd34d20cf0dd2f0e0087b28e5eeebfa72fad
2017-12-31 14:44:02 +00:00
Andreas Tolfsen d5a964bb11 Bug 1354211 - Use element.findClosest in element.getContainer. r=automatedtester
element.findClosest is a more generalised version of findAncestralElement,
which is limited to a list of element tag names.  By using
element.findClosest and CSS matching we also avoid a redundant iteration.

MozReview-Commit-ID: 32QwmkwiGf5

--HG--
extra : rebase_source : 5197971bd950cd0d90514a12bacb4642779a9090
2017-12-31 14:41:56 +00:00
Andreas Tolfsen 662639d9ba Bug 1354211 - Add element.findClosest for finding ancestor by CSS selector. r=automatedtester
Introduces a new function, element.findClosest, that finds the
closest parent node by a CSS selector expression.  This is useful to
find arbitrary elements in the tree above us and is quite possibly
reusable for element.getContainer.

MozReview-Commit-ID: 8rBEepmDdPm

--HG--
extra : rebase_source : 3055d23ce7aeba355de93fdeff52eb4ffdffbc24
2017-12-31 14:39:14 +00:00
Andreas Tolfsen 27edd882b6 Bug 1354211 - Consider <optgroup> when finding container element. r=automatedtester
It is a bug in element.getContainer that <optgroup> is not considered
when locating the containing context element, <select>.  <optgroup>
is also a child element of <select> on the same level as <option>.

MozReview-Commit-ID: 2GJJrRuY5Th

--HG--
extra : rebase_source : 2bfabe6f79bc0d6d473657ef34cded04c51857a3
2017-12-31 14:32:38 +00:00
Andreas Tolfsen 07e106bfb3 Bug 1429111 - Remove unused nsITimer from element.Store. r=maja_zf
There is an unused nsITimer instance in element.Store#timer that
this patch safely removes.

MozReview-Commit-ID: APvPsXfHUk9

--HG--
extra : rebase_source : f936abcb20d42c0eb27cfdee62d461d276cc2e5c
2018-01-09 16:29:13 +00:00
Andreas Tolfsen 82905af7f5 Bug 1424635 - Consider DOCUMENT_NODE a valid web element. r=automatedtester
When looking up the parent of <html> using an XPath parent expression
such as "..", the nodeType of the returned HTMLDocument will be 9
(DOCUMENT_NODE).  <html> is a valid web element and we should be
able to serialise and return it to the user.

It is worth noting that other WebDriver implementations fail this
test because they fail on the nodeType check.

MozReview-Commit-ID: 4FMJEd8B4PZ

--HG--
extra : rebase_source : 24e7cb9da64cde0f133a09781c595b23f919ed59
2017-12-14 12:14:56 -06:00
Henrik Skupin 88c43fb94d Bug 1414322 - Refactor sendKeysToElement methods. r=ato
Each call to sendKeysToElement should go through the interaction
module, and never by directly calling event.sendKeysToElement. This
will make sure that keyboard interactability checks will always be
performed, even for chrome scope like alerts or modal dialogs.

MozReview-Commit-ID: GoDKjMsNZsq

--HG--
extra : rebase_source : c305c748e68e60abd01dab37d00a7e3aff7d3d64
2017-11-09 20:39:51 +01:00
Henrik Skupin f58fa132cb Bug 1406505 - Fix element.isInView to use table cells instead of rows. r=ato
As long as bug 1413493 has not been fixed the <tr> nodes will not be part
of the element tree. To workaround this problem we could use the first
found cell of the given row to check for visibility.

MozReview-Commit-ID: 57nuvxYrSMg

--HG--
extra : rebase_source : 8a27105bf3a0ff9d226869fe0fa6b70c89dc4c0e
2017-11-01 16:33:08 +01:00
Henrik Skupin 61e9302acf Bug 1406505 - Fix element.getContainer() to return button as container. r=ato
Because as long as bug 1089326 is not fixed child nodes of <button>
are not part of the element tree. As such the button has to be returned
as container for any of those nodes.

MozReview-Commit-ID: Jq6B9Kn7VAf

--HG--
extra : rebase_source : 8c89322d14b14bc1409f36de6cf897c2635a5603
2017-10-20 17:52:03 +02:00
Andreas Tolfsen 34669663f4 Bug 1410796 - Add nodeType existence check. r=whimboo
If the node variable is an object that is not null, and nodeType is
not an own property of it, node.nodeType === node.ELEMENT_NODE might be
evaluated as undefined === undefined if ELEMENT_NODE is also missing.
This will pass the condition, which is an unintended consequence.

To remedy this, we first check that nodeType indeed exists on node
before proceding.

MozReview-Commit-ID: G0eaRvwm5mv

--HG--
extra : rebase_source : 8c08e0363f26095cf672d2b11699431b1fb4ef9f
2017-10-31 19:59:41 +00:00
Andreas Tolfsen e944eb5cdb Bug 1410796 - Drop element.isSVGElement. r=whimboo
This drops the now-superfluous element.isSVGElement.  SVG elements
are matched with element.isDOMElement because there is no special
need to distinguish them from other elements, apart from chrome elements.

MozReview-Commit-ID: 3AgEtyaAsPU

--HG--
extra : rebase_source : 7ec52aa9a7b7404eff5b6daf8ebe8259f06265da
2017-10-31 19:57:40 +00:00
Andreas Tolfsen b91e906a0c Bug 1410796 - element.isDOMElement to match any non-XUL element. r=whimboo
This patch makes element.isDOMElement match any non-XUL element,
meaning it will henceforth match both SVG elements as well as any
custom XML namespaced element.

In the bug 1410796, Marionette does find the element, but is unable
to add it to the known web element store.  This is a result of the
changes made in bug 1400256, where I introduced a set of functions
for element type recognition needed for determining which web
element abstraction to use for an element.

We use element.isDOMElement to distinguish content elements from chrome
elements, and this change consequently makes element.isSVGElement
superfluous.

MozReview-Commit-ID: AkEHm6zroKz

--HG--
extra : rebase_source : c6f101e12839241f60c8c1b3908df3a3e4a89a51
2017-10-31 19:55:49 +00:00
Andreas Tolfsen 089e754126 Bug 1410652 - Use invalid argument error for web element deserialisation. r=whimboo
For user input we will want to return the appropriate invalid
argument error.  For internal input using TypeError is fine.

MozReview-Commit-ID: AlOnZuhaczN

--HG--
extra : rebase_source : f16aa13b6fc53da6261594dab0c9df34d6c3df6e
2017-10-24 17:42:32 +01:00
Andreas Tolfsen f9a44482f3 Bug 1410652 - Fix various API documentation in element module. r=whimboo
MozReview-Commit-ID: AaGnolglX5n

--HG--
extra : rebase_source : 5fccbd53ab96849df2aece2679db2df84aced804
2017-10-24 17:38:55 +01:00
Sebastian Hengst 7eb270c395 Backed out 4 changesets (bug 1410652) for eslint failure at testing/marionette/element.js: Line 1456 exceeds the maximum line length of 78. r=backout
Backed out changeset 97031d4ea2bd (bug 1410652)
Backed out changeset 66754caa4c52 (bug 1410652)
Backed out changeset 48048929bb17 (bug 1410652)
Backed out changeset 265a168b4e37 (bug 1410652)
2017-10-30 19:32:43 +01:00
Andreas Tolfsen 8cd7e47451 Bug 1411307 - Return iterators for element retrieval. r=whimboo
These functions currently return sequences or arrays of elements, which
wastes cycles and memory because we spend time constructing these data
collections in cases where we only need the first element.  This is
the case for WebDriver:FindElement and WebDriver:FindElementFromElement.

This patch changes the Marionette element retrieval functions to
consistently provide iterators instead of sequences when looking
up elements.  Making them generator functions means the iterable
can be expanded using [...iterable] when necessary.

MozReview-Commit-ID: FZbKLuRWqgA

--HG--
extra : rebase_source : 1e7dc8c614004444f8b2476cb1a136ed36943374
2017-10-24 16:51:38 +01:00
Andreas Tolfsen d15a90317a Bug 1410652 - Use invalid argument error for web element deserialisation. r=whimboo
For user input we will want to return the appropriate invalid
argument error.  For internal input using TypeError is fine.

MozReview-Commit-ID: AlOnZuhaczN

--HG--
extra : rebase_source : 57992fc62c08736cb24f7ee229a4c8930751e068
2017-10-24 17:42:32 +01:00
Andreas Tolfsen 4b10cb69dd Bug 1410652 - Fix various API documentation in element module. r=whimboo
MozReview-Commit-ID: AaGnolglX5n

--HG--
extra : rebase_source : de1c338530fbbb68f695c2af8de53a9fe9c1c8e0
2017-10-24 17:38:55 +01:00
Andreas Tolfsen 84d01f24d6 Bug 1400256 - Marshal IPC messages to and from frame script. r=whimboo
MozReview-Commit-ID: BTDQDvu2pVE

--HG--
extra : rebase_source : 03f6c064dd0dbe973750cb5cfe5f9ae4ea86aee3
2017-10-05 17:57:17 +01:00