mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 06:09:19 +00:00
![Frédéric Wang](/assets/img/avatar_default.png)
network.fetchpriority.enabled
check from nsContentSink::ProcessStyleLinkFromHeader. r=smaug
Follow-up of https://phabricator.services.mozilla.com/D191745#6355404 This check can actually be removed without observable behavior change, as detailed below: 1. In `nsContentSink::ProcessLinkFromHeader`, the `aHeader.mFetchPriority` string is passed to `nsContentSink::ProcessStyleLinkFromHeader`: https://searchfox.org/mozilla-central/rev/6b8a3f804789fb865f42af54e9d2fef9dd3ec74d/dom/base/nsContentSink.cpp#338 2. In `nsContentSink::ProcessStyleLinkFromHeader`, `aFetchPriority` is only parsed into a `fetchPriority` value by `nsGenericHTMLElement::ToFetchPriority`. That value is only wrapped into a `Loader::SheetInfo` info. And that info is only passed to `Loader::LoadStyleLink`: https://searchfox.org/mozilla-central/rev/6b8a3f804789fb865f42af54e9d2fef9dd3ec74d/dom/base/nsContentSink.cpp#381 3. In `Loader::LoadStyleLink`, `aInfo` is only used to access some specific members and `aInfo.mFetchPriority` only passed to the `SheetLoadData` constructor where it is stored as a member: https://searchfox.org/mozilla-central/rev/6b8a3f804789fb865f42af54e9d2fef9dd3ec74d/layout/style/Loader.cpp#309 4. Finally, the only place where `SheetLoadData.mFetchPriority` is actually used is in `Loader::AdjustPriority`. But if `network.fetchpriority` is disabled, we actually return early without using it: https://searchfox.org/mozilla-central/rev/6b8a3f804789fb865f42af54e9d2fef9dd3ec74d/layout/style/Loader.cpp#1354 Differential Revision: https://phabricator.services.mozilla.com/D200909
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
An explanation of the Firefox Source Code Directory Structure and links to project pages with documentation can be found at: https://firefox-source-docs.mozilla.org/contributing/directory_structure.html For information on how to build Firefox from the source code and create the patch see: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html If you have a question about developing Firefox, and can't find the solution on https://firefox-source-docs.mozilla.org/, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel. Nightly development builds can be downloaded from: https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/ - or - https://www.mozilla.org/firefox/channel/desktop/#nightly Keep in mind that nightly builds, which are used by Firefox developers for testing, may be buggy.
Description
Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Languages
JavaScript
32.3%
C++
25.4%
HTML
21%
C
10.8%
Python
2.8%
Other
7.2%