This will make the underlying feature more discoverable
and should help people doing accessibility work.
We take this as an opportunity to export attribute types
from node-attribute-parser.js so we can do proper check.
Since we're adding a click event listener in markup container,
to handle keyboard activation, we take care of all the
event listeners lifecycle with an abort controller.
The existing test on aria attributes is updated to also
test the button. This should be enough as this cover both
idref and idreflist cases.
Differential Revision: https://phabricator.services.mozilla.com/D193309
This will make the underlying feature more discoverable
and should help people doing accessibility work.
We take this as an opportunity to export attribute types
from node-attribute-parser.js so we can do proper check.
Since we're adding a click event listener in markup container,
to handle keyboard activation, we take care of all the
event listeners lifecycle with an abort controller.
The existing test on aria attributes is updated to also
test the button. This should be enough as this cover both
idref and idreflist cases.
Differential Revision: https://phabricator.services.mozilla.com/D193309
We can speed up the getType function by changing the dataType into an object from an array.
That way we avoid looping looking for the matching tagName and namespaceURI and access the typeData directly by their tagName.
Differential Revision: https://phabricator.services.mozilla.com/D38196
`hasAttribute` and `getAttribute` were using for..of loop to
get what they wanted, which wasn't ideal.
Moreover, most of those operations were happening because we
didn't pass the attribute value to the parseAttribute function,
only an array of all the attributes. This is a bit unfortunate
there's only one place where we call the parseAttribute function,
and there, we have easy access to the attribute value.
This patch removes direct calls to hasAttribute and getAttribute.
hasAttribute is removed, but we need to keep getAttribute for the
isValid function in parsers.
We add an `attributeValue` parameter to the parseAttribute function.
The unit test for this function is also modified to pass the attribute
value.
perfherder reports a ~2.5% improvement on custom open and ~3% on
custom reload.
Differential Revision: https://phabricator.services.mozilla.com/D37551
`ATTRIBUTE_TYPES` was an object and we used to access it's attributes using e.g.
`ATTRIBUTE_TYPES["href"]`, which is fine in almost all cases.
The problem occurred when the attribute name was `"constructor"`. This caused us
to attempt to parse `ATTRIBUTE_TYPES["constructor"]`, which returned
`{}.constructor` therefore breaking the attribute parser.
Changing `ATTRIBUTE_TYPES` to a Map fixes the issue because
`ATTRIBUTE_TYPES.get("constructor")` returns null rather than an object
constructor.
Differential Revision: https://phabricator.services.mozilla.com/D18220
- sort-statics-last is no longer meaningful now non-static (ie template) items don't exist
- we don't use the 'resource' attribute anywhere in XUL.
- sortResource/sortResource2 are unused.
- we don't have meaningful consumers for sortSeparators
MozReview-Commit-ID: C31vC9MCrDo
For simple rules like function spacing, we can auto-fix these across the code
base so they are followed in a consistent way.
To generate this patch, I ran:
./mach eslint devtools --no-ignore --fix
After this, I reverted any changes to third party files that we really do want
to ignore.
MozReview-Commit-ID: 6Q8BApkAW20
Move major DevTools files to new directories using the following steps:
hg mv browser/devtools devtools/client
hg mv toolkit/devtools/server devtools/server
hg mv toolkit/devtools devtools/shared
No other changes are made.