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

187 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez f3e71a1931 Bug 1599160 - Allow caching stylesheets across documents. r=heycam
This patch implements a per-process cache of parsed stylesheets for
non-inline sheets. The entries are evicted when the document gets
destroyed and there's no other document with the same principal around.

This works fine in practice even when navigating because CC happens
pretty late, but we could add an extra timer if we deem it worth it.

I had to adapt some tests so that they keep passing. They were already
clearing various image / network caches so it seems fine to also clear
this one.

Note that there's a very subtle change in the load data key: We only
miss the cache if the referrer _policy_ is different, not if the
referrer is different. While that is slightly dubious, that is the only
think that makes this effort somewhat worth it. Otherwise stylesheets
would have to be re-fetched if the referrer is different, which
effectively would mean to re-parse it if the document URI is different,
which is bad.

It seems like the network cache only keys on the referrer policy, so it
seems fine to do the same.

Differential Revision: https://phabricator.services.mozilla.com/D77457
2020-06-12 19:31:32 +00:00
Razvan Maries 7b30d6e82e Backed out 7 changesets (bug 1599160) for damp failures. CLOSED TREE
Backed out changeset edb0e17f3c98 (bug 1599160)
Backed out changeset 64b42ac358e6 (bug 1599160)
Backed out changeset ce1521b895e1 (bug 1599160)
Backed out changeset 0b0ff0ad8db7 (bug 1599160)
Backed out changeset c7ef05dae614 (bug 1599160)
Backed out changeset 466cfd0ad5db (bug 1599160)
Backed out changeset b3f28494f0e7 (bug 1599160)
2020-06-12 02:40:38 +03:00
Emilio Cobos Álvarez 208b60eed2 Bug 1599160 - Allow caching stylesheets across documents. r=heycam
This patch implements a per-process cache of parsed stylesheets for
non-inline sheets. The entries are evicted when the document gets
destroyed and there's no other document with the same principal around.

This works fine in practice even when navigating because CC happens
pretty late, but we could add an extra timer if we deem it worth it.

I had to adapt some tests so that they keep passing. They were already
clearing various image / network caches so it seems fine to also clear
this one.

Note that there's a very subtle change in the load data key: We only
miss the cache if the referrer _policy_ is different, not if the
referrer is different. While that is slightly dubious, that is the only
think that makes this effort somewhat worth it. Otherwise stylesheets
would have to be re-fetched if the referrer is different, which
effectively would mean to re-parse it if the document URI is different,
which is bad.

It seems like the network cache only keys on the referrer policy, so it
seems fine to do the same.

Differential Revision: https://phabricator.services.mozilla.com/D77457
2020-06-11 11:42:46 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Gabriele Svelto 69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Cameron McCormack 81848f2228 Bug 1559093 - Handle font load cancellation better. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D34971

--HG--
extra : moz-landing-system : lando
2019-06-14 19:25:50 +00:00
Cameron McCormack 7db6869429 Bug 1490792 - Part 4: Perform OpenType sanitization OMT. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D33897

--HG--
extra : moz-landing-system : lando
2019-06-06 19:08:52 +00:00
Cameron McCormack 082aab3aaf Bug 1534471 - Reformat a couple of layout/style/ files. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D23059

--HG--
extra : moz-landing-system : lando
2019-03-12 00:14:00 +00:00
Ryan Hunt b936c00a65 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115

--HG--
extra : rebase_source : 4d65c07d8822f3a54ac881b5d0f55468ce884554
2019-02-25 16:09:24 -06:00
Jonathan Kingston c4853316e7 Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770

--HG--
extra : moz-landing-system : lando
2019-02-27 23:41:31 +00:00
Jonathan Kingston f7e35ae39e Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769

--HG--
extra : moz-landing-system : lando
2019-02-27 23:41:04 +00:00
Dorel Luca 4a4dcd57fa Backed out 4 changesets (bug 1525319) for Android failures in dom/base/test/test_progress_events_for_gzip_data.html
Backed out changeset b73f033efb41 (bug 1525319)
Backed out changeset 1d318d5c6b98 (bug 1525319)
Backed out changeset 6d73418988d4 (bug 1525319)
Backed out changeset 84ca79bd2dc3 (bug 1525319)
2019-02-25 04:06:11 +02:00
Jonathan Kingston 332531fa9c Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770

--HG--
extra : moz-landing-system : lando
2019-02-24 20:26:59 +00:00
Jonathan Kingston 2441197975 Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769

--HG--
extra : moz-landing-system : lando
2019-02-24 20:26:16 +00:00
Emilio Cobos Álvarez 45f1a56cd2 Bug 1526216 - Add a null-check for mChannel in nsFontFaceLoader::Cancel. r=heycam
If there's no channel the request is over and the Cancel() call would be a no-op
anyway.

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

--HG--
extra : moz-landing-system : lando
2019-02-11 02:10:52 +00:00
Emilio Cobos Álvarez 76df029933 Bug 1524246 - Cancel font loads from unlinking. r=jfkthame
When the FontFaceSet gets unlinked, we remove the strong pointer it holds to to
the UserFontSet.

This is not strictly necessary, since that object will no longer have any
reference to any other cycle collected object.

In any case, the loaders keep alive the user font entries, which _don't_ keep
alive the user font set (they have a weak reference instead). So if the user
font set is gone, all is bad.

Ensure we cancel all loads when unlinking rather than just when the object is
destroyed, and that the font face loader doesn't keep a reference to the user
font entry anymore after being canceled (this shouldn't be necessary either, but
it's better IMO).

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

--HG--
extra : moz-landing-system : lando
2019-02-05 14:41:57 +00:00
Sylvestre Ledru 14486004b6 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-02-04 19:10:18 +00:00
Emilio Cobos Álvarez f2065bb0b0 Bug 1522417 - Add diagnostics. r=jwatt
I haven't managed to find a way stuff should unexpectedly die around these
functions, so add a few diagnostics to catch this hopefully, before papering
over the bug / backing out / adding a kungfudeathgrip.

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

--HG--
extra : moz-landing-system : lando
2019-01-25 20:52:00 +00:00
Emilio Cobos Álvarez 5ef86a8143 Bug 1519918 - Drop nsFontFaceLoader::mChannel more often. r=jfkthame
Doesn't look like the HTTP channel breaks the reference cycle at all, so do it
when we know we're done with it.

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

--HG--
extra : moz-landing-system : lando
2019-01-21 10:39:07 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Emilio Cobos Álvarez c6c06c7f48 Bug 1496486 - Remove nsCSSValue usage from font code. r=heycam
Really sorry for the size of the patch.

Differential Revision: https://phabricator.services.mozilla.com/D7753
2018-10-09 19:07:41 +02:00
Narcis Beleuzu e7a8994c37 Backed out 5 changesets (bug 1496486) for valgrind bustages. CLOSED TREE
Backed out changeset d2f1e35ee4b7 (bug 1496486)
Backed out changeset 7f843f4ee162 (bug 1496486)
Backed out changeset 2f629a60f12c (bug 1496486)
Backed out changeset 4dd15fa31474 (bug 1496486)
Backed out changeset e8d8e2f3f00b (bug 1496486)
2018-10-09 19:44:51 +03:00
Emilio Cobos Álvarez 804148c319 Bug 1496486 - Remove nsCSSValue usage from font code. r=heycam
Really sorry for the size of the patch.

Differential Revision: https://phabricator.services.mozilla.com/D7753
2018-10-09 17:33:24 +02:00
Brindusan Cristian 3b4ca07db8 Backed out 5 changesets (bug 1496486) for build bustages on gfxUserFontSet.h. CLOSED TREE
Backed out changeset 6b740afea403 (bug 1496486)
Backed out changeset 5cf44e254ac3 (bug 1496486)
Backed out changeset 8e465202c355 (bug 1496486)
Backed out changeset 86382b2249f6 (bug 1496486)
Backed out changeset ab92ed3e0a23 (bug 1496486)
2018-10-09 16:58:38 +03:00
Emilio Cobos Álvarez d6c743191f Bug 1496486 - Remove nsCSSValue usage from font code. r=heycam
Really sorry for the size of the patch.

Differential Revision: https://phabricator.services.mozilla.com/D7753
2018-10-09 15:33:03 +02:00
Daniel Holbert 0878eb4d7e Bug 1483394: Remove unneeded #includes of nsContentUtils.h in /layout. r=TYLin
For each file touched in this patch, the file had an #include for nsContentUtils.h, but no other mentions of the string "nsContentUtils", nor any mention of its "ScriptBlocker"-related types. So these files likely don't need their nsContentUtils.h include anymore, and we can remove it to get a marginal win on build time/complexity.

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

--HG--
extra : moz-landing-system : lando
2018-08-15 07:04:43 +00:00
Emilio Cobos Álvarez f75cc9db05 Bug 1481905 - When canceling a user font load, make sure to not leave mUserFontLoadState as LOADING. r=jfkthame
Since that's what we use to kick off new loads, should they be needed.

Differential Revision: https://phabricator.services.mozilla.com/D3111
2018-08-12 15:30:45 +02:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Andi-Bogdan Postelnicu e91a057f78 Bug 1453795 - Layout/Style - Initialize member fields in classes/ structures. r=heycam 2018-06-14 12:54:03 +03:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Nicholas Nethercote 94289ab246 Bug 1448225 - Convert StylePrefs to StaticPrefs. r=emilio
The new StaticPrefs machinery means that StylePrefs can be removed.

Note that this approach mirrors all static prefs into Rust, but I have only
updated structs.rs for the prefs that Stylo uses.

On a CLOSED TREE, since a sheriff closed the tree while I was about to land this
via autoland.

MozReview-Commit-ID: G1SY0987WJ7
2018-04-03 09:06:20 +02:00
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Kris Maglione 663e9cb7fa Bug 1404198: Part 2e - Switch to NS_NewTimer* in layout. r=njn
MozReview-Commit-ID: 2WxyAXpJ3Fg

--HG--
extra : rebase_source : 4166c82c86558f79a4b41566a9997584e5fc94cf
2017-10-15 23:13:31 -07:00
Shih-Chiang Chien d19facee30 Bug 1381434 - off-main-thread loading web font r=heycam
MozReview-Commit-ID: 8PQdxK5K55

--HG--
extra : rebase_source : 2691c8dcfb9e49b670529526551c4ac0be271eb0
2017-09-29 10:10:13 +08:00
Xidorn Quan 7b861b9702 Bug 1386871 - Move font-display pref into StylePrefs. r=heycam
MozReview-Commit-ID: 9CDZSdTOacs

--HG--
extra : rebase_source : b1104db99fc8cdb5c2321e9ce19a0ae60d5164eb
2017-08-03 10:37:02 +10:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Ting-Yu Lin 44a41925d3 Bug 1338446 Part 6 - Label LoadTimer in nsFontFaceLoader::StartedLoading. r=heycam
Delete #include "mozilla/Logging.h" because it has been included.

Add FontFaceSet::Document() to get valid document for nsFontFaceLoader.

MozReview-Commit-ID: IAXM9UgvjOE

--HG--
extra : rebase_source : e5aa8aadea5e2f9f2e5d73cc718318cf97471d3f
2017-03-14 21:57:34 +08:00
Tom Tromey 5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00
Daniel Holbert f8a884b751 Bug 1339546 part 2: Make layout/style/*.cpp include corresponding .h file as the first header. r=xidorn
MozReview-Commit-ID: 2rZ9z0BgRvN

--HG--
extra : rebase_source : d046a915283dd45ec8ff39f1b63da8ae59d3fac8
2017-02-14 11:23:11 -08:00
Nicholas Nethercote 742fc7eb48 Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley.
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:

  nsAutoCString spec;
  uri->GetSpec(spec);
  printf("uri: %s", spec.get());

to be changed to this:

  printf("uri: %s", uri->GetSpecOrDefault().get());

This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.

I will fold this into part 1 before landing.

--HG--
extra : rebase_source : ddc19a5624354ac098be019ca13cc24b99b80ddc
2016-08-26 16:02:31 +10:00
Christoph Kerschbaumer 9ab1648f67 Bug 1195172 - Use channel->ascynOpen2 layout/style/FontFaceSet.cpp (r=bz,cam) 2016-03-01 13:06:13 -08:00
John Daggett ade0c810ea Bug 1157064 - implementation of font-display. r=heycam,khuey 2016-01-07 14:03:05 +09:00