Commit Graph

62 Commits

Author SHA1 Message Date
Mihai Alexandru Michis
c358baf0c3 Backed out changeset 0f9626b48a66 (bug 1553451) for linting failures. CLOSED TREE 2019-05-23 10:58:22 +03:00
Patrick Brosset
18bd75fb8c Bug 1553451 - Lower the eslint complexity level to 20 for devtools and exlude more complex functions; r=jdescottes
We want to go back to ESLint's default complexity level so that newly introduced code is checked for complexity.
At the same time, to make that work, we're excluding all of the more complex functions for now.
We should fix them: make them less complex, and remove the eslint-disable comment.
See bug 1553449 for more information about this.

Differential Revision: https://phabricator.services.mozilla.com/D32139
2019-05-23 07:07:49 +00:00
Razvan Caliman
9f60058f4f Bug 1553194 - Remove unrelated code comment from shared/css-logic.js r=pbro
Depends on D32016
The code comment is perhaps a leftover from a file duplication to extract shared methods to `shared/inspector/css-logic.js` from `server/actors/inspector/css-logic.js`.

The comment is confusing because there is no usage of any of the CssLogic terminology within the file.

Differential Revision: https://phabricator.services.mozilla.com/D32017
2019-05-22 07:35:02 +00:00
Ian Moody
c47a45bb68 Bug 1539265 - Handle ::marker pseudo-elements in css-logic.js, so their rules show in the rule view. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D25071
2019-04-02 07:45:31 +00:00
arthur.iakab
215148fa05 Backed out 11 changesets (bug 1539265) for causing debugger failures CLOSED TREE
Backed out changeset 8206b880f9ec (bug 1539265)
Backed out changeset be9f5f73bdfe (bug 1539265)
Backed out changeset f78146b8aa17 (bug 1539265)
Backed out changeset 18fa7e971a0d (bug 1539265)
Backed out changeset 6eaf5bdd945c (bug 1539265)
Backed out changeset 3add7d4d4853 (bug 1539265)
Backed out changeset 8015aeb5279d (bug 1539265)
Backed out changeset 19c8e404ac5f (bug 1539265)
Backed out changeset 637a9d6af0f3 (bug 1539265)
Backed out changeset 72bbb4b28932 (bug 1539265)
Backed out changeset 931e98129878 (bug 1539265)
2019-04-02 02:44:43 +03:00
Ian Moody
eb0723bb74 Bug 1539265 - Handle ::marker pseudo-elements in css-logic.js, so their rules show in the rule view. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D25071
2019-04-01 21:45:28 +00:00
Michael Ratcliffe
e08b4dffb7 Bug 1509620 - Computed style inspector CSS cascade calculation is wrong r=ladybenko
### Try

https://treeherder.mozilla.org/#/jobs?repo=try&revision=f1bad5e5282812225da95c0ea9e2ef173640b5da

### Summary

!!Comparing numerous complex websites such as github, facebook, cnn etc. the cascade now matchers that of Chrome so we are in a much better place.!!

According to https://www.w3.org/TR/css-cascade-3/#cascading (which platform follows now) and https://www.w3.org/TR/css-cascade-4/#cascading we should now be doing this (descending order):

  - Transition declarations
  - User-Agent & !important
  - User & !important
  - Author & !important
  - CSS Animations, @keyframes
  - Author, normal weight
  - User, normal weight
  - User-Agent, normal weight
  - specificity
  - Sheet Index
  - Rule Line
  - Rule Column

We are only dealing with CSS selectors here so we can safely drop Transition declarations and CSS Animations because their presence here is irrelevant when it comes to the CSS cascade information we display in the computed view.

This leaves us with:

  - User-Agent & !important
  - User & !important
  - Author & !important
  - Author, normal weight
  - User, normal weight
  - User-Agent, normal weight
  - specificity
  - Sheet Index
  - Rule Line
  - Rule Column

### Changes

- References to content stylesheets have been changed to author stylesheet to closely match the technical terms author, user and agent stylesheets.
- Simplified and modernized a bunch of for loops to make the code easier to understand.
- Previous to these changes all matching parent rules were classed as equal e.g. color on the body tag was equal to color on a node's immediate container. We now use the `distance` variable to tell how close a rule is to the current node. This is the highest qualifier in our cascade calculation.
- The `_agentSheet`, `_authorSheet` and `_userSheet` properties are now used to obtain a sheets origin.
- `elementStyle` was renamed to `inlineStyle` in order to correctly identify the rule's origin.
- We used to sort the matchedSelectors to move rules with `STATUS.MATCHED` above `STATUS.PARENT_MATCH` but this is unnecessary now that we have the `distance` property so we no longer do this.
- The `compareTo()` method has been updated to match https://www.w3.org/TR/css-cascade-3/#cascading (which platform follows now) and https://www.w3.org/TR/css-cascade-4/#cascading. It has also been simplified and made far less prone to error.

Differential Revision: https://phabricator.services.mozilla.com/D23711
2019-03-25 16:32:19 +00:00
Daisuke Akatsuka
ee03773936 Bug 1114929: Apply line count of comments. r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D24118
2019-03-20 22:31:14 +00:00
Julian Descottes
94466afba0 Bug 1502346 - Retrieve ::slotted rules in InspectorUtils getCSSStyleRules;r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D14759
2018-12-17 21:33:40 +00:00
Razvan Caliman
b061a132ff Bug 1499049 - (Part 1) Log ancestor rule tree for changes to CSS declarations; r=pbro
⚠️ **To build locally, this change series depends on the [change series](https://phabricator.services.mozilla.com/D4399) which adds the ChangesActor**.
🏋️‍♂️ **To test hands-on, you can download a [custom macOS build](https://queue.taskcluster.net/v1/task/HIiZcwLXTuuSYYjfwEDmmA/runs/0/artifacts/public/build/target.dmg)  (updated Wed, Oct 24) which includes both change series.**

- Introduce ancestorRules getter to StyleRuleActor to get a flattened rule tree with the ancestors of the current rule;
- Introduce CSSRuleTypeName to css-logic helpers to map between CSS rule type and human-readable name;
- Log rule index position with each CSS declaration change to help differentiate between changes to rules with identical selectors at the same level of nesting.

Differential Revision: https://phabricator.services.mozilla.com/D8718
2018-10-24 17:43:33 +00:00
Patrick Brosset
62e82d2f1c Bug 1114932 - Break after commas in CSS selectors r=tromey
Differential Revision: https://phabricator.services.mozilla.com/D9232
2018-10-22 14:17:27 +00:00
Mark Banner
3d6aaad3f5 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389
2018-10-19 12:55:39 +00:00
Gabriel Luong
8f4e006e3c Bug 1494162 - Part 19: Backed out changeset 5fd32a2fbc66. r=me 2018-09-28 16:19:30 -04:00
Gabriel Luong
b320d6b627 Bug 1494162 - Part 19: Directly import getCssPath, getXpath and findCssSelector. r=pbro 2018-09-28 13:14:34 -04:00
Gabriel Luong
fcfa41008e Bug 1464192 - Part 18: Lazy load modules in the css-logic. r=pbro 2018-09-28 13:14:34 -04:00
Noemi Erli
3ebb8480ac Backed out 16 changesets (bug 1494162, bug 1464192) for failures in test_css-logic-getCssPath.html CLOSED TREE
Backed out changeset 0d5a593adfda (bug 1494162)
Backed out changeset ea5d67d3c2ae (bug 1494162)
Backed out changeset 98c531e6f8d4 (bug 1494162)
Backed out changeset 973fbb5bbadc (bug 1464192)
Backed out changeset bbbf97a5802e (bug 1494162)
Backed out changeset c1dac4bffc06 (bug 1494162)
Backed out changeset c90d929f87f2 (bug 1494162)
Backed out changeset f90da1a0201b (bug 1494162)
Backed out changeset ee129a8c5e00 (bug 1494162)
Backed out changeset 10143ae649e5 (bug 1494162)
Backed out changeset f700e44ea63f (bug 1494162)
Backed out changeset cb2b02dc4b47 (bug 1494162)
Backed out changeset 4880d9571aa7 (bug 1494162)
Backed out changeset b9e187182a0f (bug 1494162)
Backed out changeset f077ffe76ca5 (bug 1494162)
Backed out changeset ef609de4cd5c (bug 1494162)
2018-09-28 21:57:12 +03:00
Gabriel Luong
937ac38f73 Bug 1494162 - Part 19: Directly import getCssPath, getXpath and findCssSelector. r=pbro 2018-09-28 13:14:34 -04:00
Gabriel Luong
6045b40dd5 Bug 1464192 - Part 18: Lazy load modules in the css-logic. r=pbro 2018-09-28 13:14:34 -04:00
Julian Descottes
c68fa50651 Bug 1449972 - part2: Move getCssPath and getXPath to toolkit css-selector;r=bgrins
getCssPath and getXPath will need to reuse the same logic as findCssSelector
to handle shadowDOM support.

This patch moves the methods next to findCssSelector, in toolkit's css-selector.js
to avoid duplicating logic between devtools/ and toolkit/

The content of the methods is stricltly the same, except for the Node global
not available in css-selector.js. Instead we use `ele.ownerGlobal.Node` here.

MozReview-Commit-ID: J0KuORWLUoO
2018-07-18 07:33:21 +02:00
Margareta Eliza Balazs
7ca6067c2c Backed out 3 changesets (bug 1449972) for ES lint failure in /builds/worker/checkouts/gecko/devtools/shared/inspector/css-logic.js on a CLOSED TREE
Backed out changeset 952a605a3b21 (bug 1449972)
Backed out changeset c3379a87de69 (bug 1449972)
Backed out changeset 5f678f861c4d (bug 1449972)
2018-07-19 08:31:56 +03:00
Julian Descottes
e015732400 Bug 1449972 - part2: Move getCssPath and getXPath to toolkit css-selector;r=bgrins
getCssPath and getXPath will need to reuse the same logic as findCssSelector
to handle shadowDOM support.

This patch moves the methods next to findCssSelector, in toolkit's css-selector.js
to avoid duplicating logic between devtools/ and toolkit/

The content of the methods is stricltly the same, except for the Node global
not available in css-selector.js. Instead we use `ele.ownerGlobal.Node` here.

MozReview-Commit-ID: J0KuORWLUoO
2018-07-18 07:33:21 +02:00
Julian Descottes
5661629b9a Bug 1078374 - Return empty string in getPath/Selector methods for nodes outside document;r=bgrins
MozReview-Commit-ID: 5hxtjz23vXh
2018-06-23 08:29:16 +02:00
Julian Descottes
82711b9a8f Bug 1454696 - Run eslint --fix for prefer-const;r=yulia
MozReview-Commit-ID: F6xUXCgdRE4
2018-06-01 12:36:09 +02:00
J. Ryan Stinnett
8d1c817851 Bug 1443081 - Apply spacing via eslint --fix for DevTools. r=jdescottes
MozReview-Commit-ID: 2RVNt140Zte
2018-03-12 13:44:41 -05:00
Cameron McCormack
90e1256cb0 Bug 1427512 - Part 16: Remove nsIDOMCSSRule. r=xidorn,jryans,bz
MozReview-Commit-ID: GvVdW9w5Cc4
2018-01-11 16:17:56 +08:00
Cameron McCormack
1e1294a44a Bug 1427419 - Part 3: Move inIDOMUtils.getCSSStyleRules to InspectorUtils. r=bz
MozReview-Commit-ID: 3pcxsYhguOk
2018-01-11 12:37:59 +08:00
Patrick Brosset
b04d081c3f Bug 1419301 - Make HTML comments removal in prettifyCSS faster; r=tromey
MozReview-Commit-ID: LG8GKccRlXr
2017-12-01 16:58:48 +01:00
Hiroyuki Ikezoe
05d87ec883 Bug 1399314 - Introdue CssLogic.getCSSStyleRules to get style rules for ::before and ::after pseudo elements handy. r=bgrins
For pseudo elements, inIDOMUtils.getCSSStyleRules needs to take the parent
element of the pseudo element and pseudo name. This new function wraps
inIDOMUtils.getCSSStyleRules so that we can get style rules for pseudo elements
handy.

MozReview-Commit-ID: LRQBdiizoL7
2017-10-13 07:19:54 +09:00
Hiroyuki Ikezoe
e780a1d2b8 Bug 1399314 - Move getBindingElementAndPseudo into shared/inspector/css-logic.js. r=ochameau
MozReview-Commit-ID: 4Ka61REglh
2017-10-13 07:19:54 +09:00
Sebastian Zartner
a96e0107fb Bug 1360868 - Properly formatted data URLs in source links. r=gl
MozReview-Commit-ID: 7loVwUynHhw
2017-07-29 11:31:13 +02:00
Patrick Brosset
34ce4eae43 Bug 987877 - Add Copy XPath menu item to the inspector; r=miker
MozReview-Commit-ID: A5g0MmWovjk
2017-06-12 16:25:48 +02:00
Julian Descottes
5a449a6b18 Bug 1356415 - move devtools helper findCssSelector to shared module in toolkit;r=mixedpuppy
MozReview-Commit-ID: 2KOeij1oJnT
2017-04-26 15:30:36 +02:00
Ajay
ac7b5a729e Bug 1327773 - Fix non-functioning devtools option 'Indent using spaces' by modifying prettifyCSS.js; r=tromey
MozReview-Commit-ID: 5m5nNgwX6v2
2017-02-07 21:06:28 +05:30
Patrick Brosset
d045689e66 Bug 1323700 - Adding a copy full path option to the inspector menu; r=gl
MozReview-Commit-ID: IvRnek7e7Xq
2017-01-17 14:14:41 +01:00
Julian Descottes
5323d54c49 Bug 1323713 - fix prettify CSS error when encountering extra closing brace;r=tromey
MozReview-Commit-ID: 5TAxEP5561K
2017-01-10 22:19:47 +01:00
Alexandre Poirot
b1fb773627 Bug 1154645 - Move findCssSelector from server to shared. r=pbro
MozReview-Commit-ID: DjEO1hjFSc5
2016-11-09 09:22:42 -08:00
Tom Tromey
1976c3df85 Bug 1312041 - remove requireRawId rewriting in favor of Loader paths; r=jryans
MozReview-Commit-ID: 6OSszbKpp74
2016-10-25 21:30:18 -06:00
Wes Kocher
20d9f9713d Backed out 2 changesets (bug 1312041) for mass failures a=backout
Backed out changeset c4f42d7d5453 (bug 1312041)
Backed out changeset 9bfbc8480d43 (bug 1312041)
2016-11-01 10:30:45 -07:00
Tom Tromey
d1b2d82846 Bug 1312041 - remove requireRawId rewriting in favor of Loader paths; r=jryans
MozReview-Commit-ID: 6OSszbKpp74
2016-10-25 21:30:18 -06:00
Greg Tatum
0fc28c2ff3 Bug 1290988 - Collect devtools/shared/css-* files into a folder. r=tromey
In preparation for the additional files in the `mach generate-css-db`
command, collect the CSS files into a folder.

MozReview-Commit-ID: 9JRVsC2NMK8
2016-09-14 10:00:27 -05:00
Sebastian Hengst
93c9c62451 Backed out changeset 1bca17123507 (bug 1290988) for xpcshell failures (test_rewriteDeclarations.js) and devtools failures (browser_styleeditor_syncAddProperty.js). r=backout 2016-09-13 17:43:44 +02:00
Greg Tatum
36e0a1b1fa Bug 1290988 - Collect devtools/shared/css-* files into a folder; r=tromey
In preparation for the additional files in the `mach generate-css-db`
command, collect the CSS files into a folder.

MozReview-Commit-ID: 9JRVsC2NMK8
2016-08-29 11:02:34 -05:00
Julian Descottes
ea152e80ca Bug 1295608 - Migrate devtools/shared to use l10n.js instead of Services.string;r=tromey
I explicitly did not migrate the localizations of the external properties file brand.properties.
This should be handled as part of Bug 1297733.

MozReview-Commit-ID: JXomOmr37xV
2016-08-26 15:01:52 +02:00
Sebastian Hengst
d5a21ac842 Backed out changeset 85fabbd4395a (bug 1295608) 2016-08-25 14:20:02 +02:00
Julian Descottes
dbc7171cd2 Bug 1295608 - Migrate devtools/shared to use l10n.js instead of Services.string;r=tromey
I explicitly did not migrate the localizations of the external properties file brand.properties.
This should be handled as part of Bug 1297733.

MozReview-Commit-ID: JXomOmr37xV
2016-08-23 12:19:42 +02:00
Tom Tromey
0940713d29 Bug 1278625 - remove some lazy loading from devtools; r=jlongster
MozReview-Commit-ID: HwV7DFVJhAF
2016-08-05 08:46:37 -06:00
Tom Tromey
6892a50d74 Bug 1292574 - make CSS a global rather than a module in devtools loader; r=gregtatum
MozReview-Commit-ID: 5RYwDAW4wxt
2016-08-05 08:32:59 -06:00
Tom Tromey
3ae78bc3e0 Bug 1265802 - Add Services.appinfo.OS shim for devtools; r=jryans
MozReview-Commit-ID: L41zmBEyqPH
2016-07-14 12:48:47 -06:00
Tom Tromey
0f4354f2cd Bug 1266844 - use URL, not nsIURL, in css-logic.js; r=pbro
MozReview-Commit-ID: F8eBQEJZkv7
2016-06-24 13:55:55 -06:00
Tom Tromey
a1c55e31b0 Bug 1225254 - split css-logic.js into server and shared files; r=pbro
MozReview-Commit-ID: BTFVQJcVI5d
2016-06-24 08:26:21 -06:00