зеркало из https://github.com/mozilla/gecko-dev.git
639bed7bb2
### 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 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
acorn | ||
adb | ||
client | ||
css | ||
discovery | ||
fronts | ||
heapsnapshot | ||
inspector | ||
jsbeautify | ||
layout | ||
locales | ||
node-properties | ||
performance | ||
platform | ||
preferences | ||
protocol | ||
qrcode | ||
screenshot | ||
security | ||
specs | ||
sprintfjs | ||
test-helpers | ||
tests | ||
transport | ||
webconsole | ||
worker | ||
.eslintrc.js | ||
DevToolsUtils.js | ||
Loader.jsm | ||
Parser.jsm | ||
ThreadSafeDevToolsUtils.js | ||
async-storage.js | ||
async-utils.js | ||
base-loader.js | ||
builtin-modules.js | ||
content-observer.js | ||
debounce.js | ||
defer.js | ||
deprecated-sync-thenables.js | ||
dom-node-constants.js | ||
dom-node-filter-constants.js | ||
event-emitter.js | ||
extend.js | ||
flags.js | ||
generate-uuid.js | ||
indentation.js | ||
indexed-db.js | ||
jar.mn | ||
l10n.js | ||
loader-plugin-raw.jsm | ||
moz.build | ||
multi-e10s-helper.js | ||
path.js | ||
plural-form.js | ||
protocol.js | ||
system.js | ||
task.js | ||
throttle.js | ||
wasm-source-map.js |