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

16272 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke fbb5626d0e Bug 1652009 - Remove unnecessary include directives from ComputedStyle.h. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83103
2020-07-15 12:48:09 +00:00
Simon Giesecke 7701ae7587 Bug 1652003 - Remove unnecessary includes from gfxFont.h. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D83100
2020-07-15 12:47:28 +00:00
Frederik Braun a7153982e8 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Emilio Cobos Álvarez b769a57503 Bug 1651947 - Scale the page sequence in print preview so that pages don't overflow the viewport horizontally. r=dholbert
This is going to be useful for the new print preview UI, which is in a
doorhanger and thus much more likely to be less than the page size.

We (ab)use the existing print preview scaling mechanism. We only need it
after reflowing all pages, so this works.

This whole scaling mechanism is all-in-all not amazing, but the patch is
less gross than I initially thought. It's nice, actually.

We could put the new behavior behind a pref trivially, if that's wanted,
but I honestly thing this behavior is better even without the doorhanger
ui.

Differential Revision: https://phabricator.services.mozilla.com/D83309
2020-07-15 11:16:43 +00:00
Emilio Cobos Álvarez d275fd6251 Bug 1631449 - Apply a grayscale filter to pages when monochrome. r=jwatt
This hooks the "monochrome" media query and co to the
nsIPrintSettings.printInColor setting.

This print setting we're using is not exposed in the print preview UI,
but you can test it setting the print.print_in_color preference to
"false", and then print preview will correctly show up greyscale'd.

Once this lands, the UI folks just have to use it as they see fit :)

I would've liked to add a proper rendering test, but the print reftests
check only whether the PDF text matches.

I could add a test to printpreview_helper.xhtml, but I'm refactoring
that file in bug 1648064 so I'd rather wait a bit and add it in a
separate bug. The test for the media feature should make sure that we
test that code path at least.

Differential Revision: https://phabricator.services.mozilla.com/D83552
2020-07-15 03:45:33 +00:00
Daniel Holbert e45bd243c2 Bug 1652228: In test_flexbox_reflow_counts.html, don't bother pruning (nonexistent) children from 'content' node, and use consistent vars. r=TYLin
Before this patch, the test tries to remove all children from the 'content'
node except for one, as part of cleaning up. This is unnecessary, because none
of the subtests ever add any additional children to the 'content' element.
(It's also problematic because in late beta & release, 'content' is a special
variable name by default.)

While we're at it, this patch also makes us address the other nodes more
consistently, using the explicit variable declarations at the top of the
script section rather than their implicit ID-granted variable names.

Differential Revision: https://phabricator.services.mozilla.com/D83251
2020-07-13 22:59:03 +00:00
longsonr c2fc063be0 Bug 1652254 - Remove svg from some moz.build local includes r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D83247
2020-07-12 16:38:26 +00:00
longsonr 875f5e88ac Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Liang-Heng Chen e03242ddb4 Bug 1647732 - isolate font cache; r=baku,jfkthame,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D82034
2020-07-10 10:28:40 +00:00
Emilio Cobos Álvarez 8be683efd5 Bug 1648839 - Evaluate changes in all media queries, then fire change events. r=jwatt
This ensures that you can't observe an inconsistent state while we go
through the list.

It should also be marginally better as we don't build an array with all
the media queries unconditionally.

Differential Revision: https://phabricator.services.mozilla.com/D82260
2020-07-10 01:21:53 +00:00
sefeng de3bbd2feb Bug 1651089 - Use transform instead of translate to position dialog r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D82538
2020-07-09 19:46:44 +00:00
Ting-Yu Lin ffcfb6dcec Bug 1651171 - Convert NS_SUBTREE_DIRTY to an inline method of nsIFrame. r=jfkthame
This is a straightforward conversion except that
`NS_SUBTREE_DIRTY(this)` can be written terser as `IsSubtreeDirty()`.

Differential Revision: https://phabricator.services.mozilla.com/D82811
2020-07-09 18:29:15 +00:00
Daisuke Akatsuka 7ad61c2671 Bug 1625930: Fire StyleSheetApplicableStateChanged event explicitly if the stylesheet is getten from the cache. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81305
2020-07-08 15:13:03 +00:00
Emilio Cobos Álvarez c3f3931f8c Bug 1645773 - Make sure to reflow when author specified borders / backgrounds are changed if we're themed. r=jfkthame
As author-specified-background/border changes can change the effective
border and padding of form controls.

Differential Revision: https://phabricator.services.mozilla.com/D82689
2020-07-08 15:13:27 +00:00
Bogdan Tara 75881e8400 Backed out 6 changesets (bug 1625930) for test_eventemitter_basic.js failures CLOSED TREE
Backed out changeset 30a3da9f613c (bug 1625930)
Backed out changeset d4e4c3ddcc43 (bug 1625930)
Backed out changeset 0133d9c58323 (bug 1625930)
Backed out changeset 1c9cf53f2a89 (bug 1625930)
Backed out changeset f63839eff636 (bug 1625930)
Backed out changeset a6bef105a2c2 (bug 1625930)
2020-07-08 18:08:27 +03:00
Daisuke Akatsuka 2e741db198 Bug 1625930: Fire StyleSheetApplicableStateChanged event explicitly if the stylesheet is getten from the cache. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81305
2020-07-08 14:05:42 +00:00
Daniel Holbert 9542b75d5b Bug 1492538 part 2: Cache flex items' content-box sizes after reflowing them, & skip subsequent reflow if the size matches and the item's subtree isn't dirty. r=TYLin
Note: This optimization saves us from doing an extra unnecessary reflow in the
mochitest test_bug1505254.html, so I'm adjusting that test to remove its
magical "+1" fudge-factor in its expectations (and the corresponding
explanatory comment).  Similarly, I'm dropping the assertion-count for
crashtest 1488762-1.html because we now do a little bit less reflow work (and
hence assert a little bit less) in that test.

Depends on D78821

Differential Revision: https://phabricator.services.mozilla.com/D78822
2020-07-08 04:12:55 +00:00
Csoregi Natalia fe1354b164 Backed out changeset 4ed5a0e27c05 (bug 1647732) for font related wpt failures. CLOSED TREE 2020-07-07 12:31:27 +03:00
Liang-Heng Chen e69b3bc58b Bug 1647732 - isolate font cache; r=baku,jfkthame,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D82034
2020-07-07 07:49:38 +00:00
Kagami Sascha Rosylight 1afcf4d621 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Sylvestre Ledru caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Emilio Cobos Álvarez 3b9c28af7a Bug 1256980 - Make z-index only apply to positioned and grid / flex item frames. r=miko,hiro
Differential Revision: https://phabricator.services.mozilla.com/D81557
2020-06-30 22:51:12 +00:00
Zeke Medley 83e9191999 Bug 1506364 - Implement the prefers-contrast media-query. r=morgan,emilio
Differential Revision: https://phabricator.services.mozilla.com/D79553
2020-06-29 17:46:12 +00:00
Emilio Cobos Álvarez 7649856b1f Bug 1649197 - Remove StyleSheet::UnparentChildren. r=nordzilla
It leaves parent pointers nulled out when it really shouldn't when
cloning shared sheets (if there's another suitable parent, we should use
that instead of nulling out).

Fix the code in StyleSheetInfo::RemoveSheet to handle all cases
(including nulling out when removing the only remaining sheet), and rely
on that instead.

Differential Revision: https://phabricator.services.mozilla.com/D81569
2020-06-29 18:41:20 +00:00
Emilio Cobos Álvarez 67f90f0a9e Bug 1648736 - Don't mark a load as performed on a given document until it has actually finished. r=heycam
Consider the case where we have an expired entry in the cache, and we
load a new document.

We get an speculative load from the HTML parser. That's great, and we
see the entry is expired and actually fired the load.

But then, we actually get to the load that the <link> element performs,
and we see that we've already performed this load, so instead of peeking
the in-progress load, we go ahead and peek the expired "complete" cache
entry, which is not what we want.

By marking a load as performed only once it has finished, we avoid the
complete sheet cache, and glom onto the existing load instead, which is
the correct thing to do.

Differential Revision: https://phabricator.services.mozilla.com/D81318
2020-06-29 17:29:06 +00:00
Razvan Maries be1983c22c Backed out changeset 6b6e6e9ef6a5 (bug 1648736) for reftests failures. CLOSED TREE 2020-06-29 17:13:20 +03:00
Emilio Cobos Álvarez fa2b0a4ba3 Bug 1648736 - Don't mark a load as performed on a given document until it has actually finished. r=heycam
Consider the case where we have an expired entry in the cache, and we
load a new document.

We get an speculative load from the HTML parser. That's great, and we
see the entry is expired and actually fired the load.

But then, we actually get to the load that the <link> element performs,
and we see that we've already performed this load, so instead of peeking
the in-progress load, we go ahead and peek the expired "complete" cache
entry, which is not what we want.

By marking a load as performed only once it has finished, we avoid the
complete sheet cache, and glom onto the existing load instead, which is
the correct thing to do.

Differential Revision: https://phabricator.services.mozilla.com/D81318
2020-06-29 10:51:37 +00:00
Kagami Sascha Rosylight 21f2b48e01 Bug 1647525 - Use HasAnyStateBits() in remaining layout files r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81230
2020-06-28 01:00:19 +00:00
Kagami Sascha Rosylight e6be47e504 Bug 1647525 - Use HasAnyStateBits() in nsFontFaceUtils r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81215
2020-06-27 14:10:40 +00:00
Emilio Cobos Álvarez 7c995807da Bug 1646936 - Generate a single metadata file in the objdir, and feed it to cbindgen. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D80360
2020-06-26 10:41:26 +00:00
Coroiu Cristina 302c2fa31a Backed out changeset 8f948dd74aba (bug 1646936) for SM and Toolchain failures on a CLOSED TREE 2020-06-26 13:08:09 +03:00
Emilio Cobos Álvarez 9c7c03bf30 Bug 1646936 - Generate a single metadata file in the objdir, and feed it to cbindgen. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D80360
2020-06-26 09:37:16 +00:00
Emilio Cobos Álvarez 8ae606c7bf Bug 1648095 - Don't defer the same sheet load twice. r=heycam
When we call into LoadSheet when starting pending loads for a given
loader, it may be the case that the original loader may still not care
about the load. However some other loader will, so we can't defer this.

This was also causing our state to get out of sync, because if this
happened, then we'd fail to account for it in other loaders.

Differential Revision: https://phabricator.services.mozilla.com/D81119
2020-06-26 01:17:40 +00:00
Emily McDonough 9c4930c11b Bug 1633737 - Fix asserts and array accesses for oversized grid tracks with repeat-auto r=emilio
Handle grid track lists that are too large in CalculateRepeatFillCount. Check
for repeat tracks that begin or end past the maximum track limit in
InitRepeatTracks, and handle the possible size mismatch in nsComputedDOMStyle.

This may result in there being fewer than the maximum number of tracks again
after removing empty tracks in a repeat(auto-fit), but only limiting the track
count after removing empty tracks would leave the number of repeat tracks
unbounded (or require a separate limit on just the repeat track count).

Differential Revision: https://phabricator.services.mozilla.com/D76191
2020-06-24 18:25:08 +00:00
Emilio Cobos Álvarez 45dcbc2d5c Bug 1645987 - Isolate sheet cache by partitioned principal. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D80678
2020-06-24 06:47:38 +00:00
Honza Bambas 6018bc4a66 Bug 1603542 - Properly mark CSS preloads as used when processing stylesheet tags or imports, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76528
2020-06-23 17:18:47 +00:00
Emilio Cobos Álvarez 3dba84f650 Bug 1645122 - Properly block onload when coalescing loads with other documents. r=heycam
If two loading documents hit the sheet cache and we coalesce the
resource load, there's nothing that prevents the load event on the
second document from firing right now, and there should be.

While at it, also fix the handling of the pending load count, though
it has no correctness impact on the particular test we're fixing here...

We were never decrementing it, which is of course wrong. However it
kinda ended up working because it just causes us to not defer more
loads.

The new assertions and responsibility of the counter should ensure it
stays correct.

Differential Revision: https://phabricator.services.mozilla.com/D80583
2020-06-23 08:27:54 +00:00
Emilio Cobos Álvarez e696ebbe20 Bug 1646776 - Move the preloader for stylesheets to SheetLoadData rather than StreamLoader. r=mayhemer
So as to make sense in a world where we can coalesce loads across
documents. The per-load object is the SheetLoadData, so this way we
guarantee that we fire the right events in presence of the load
coalescing that the SharedStyleSheetCache does.

Differential Revision: https://phabricator.services.mozilla.com/D80380
2020-06-22 18:10:07 +00:00
Emilio Cobos Álvarez 8c691e51cb Bug 1646776 - Don't set an URL for pending constructable stylesheet parses. r=heycam
This shouldn't have any behavior change, but it makes the code make a
bit more sense. Rather than counting inline stylesheets like a pending
load, we won't (but note that any @import inside it will).

The SheetLoadData::mURL it's supposed to be the url of the stylesheet,
so for StyleSheet::Replace it should be null.

Differential Revision: https://phabricator.services.mozilla.com/D80379
2020-06-23 02:54:58 +00:00
tkhan 6ccabd4784 Bug 1602668 - M(1) manifest and test changes. r=kmag,karlt,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70362
2020-06-22 19:09:49 +00:00
Emilio Cobos Álvarez 9541790d6a Bug 1646776 - Add some logging for sheet cache misses for the same URI. r=heycam
This makes it easy to see why your test is not failing without your
patch, for example ;)

Note that we log only when the URIs are the same, which
I think is a reasonable compromise in verbosity.

Differential Revision: https://phabricator.services.mozilla.com/D80288
2020-06-22 10:48:44 +00:00
Emilio Cobos Álvarez b9b9e38dd9 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Simon Giesecke f74c1b7be0 Bug 1645339 - Use range-based for with nsTObserverArray in layout/style. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D79506
2020-06-22 08:44:05 +00:00
Jonathan Kew a2fdc0423f Bug 1533462 - Disable gfx.font_loader.delay for transition mochitests to avoid potential jank during timing-dependent tests. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D80297
2020-06-21 09:15:33 +00:00
Emilio Cobos Álvarez 8ca5b42689 Bug 1646558 - Remove the old android "native" theme. r=geckoview-reviewers,agi
We've had nsNativeBasicTheme enabled since 75, and all reported issues
were fixed real soon (and I haven't heard of any of them recently).

Given the non-native theme is likely changing in the future, I'd rather
not maintain three themes for Android :)

Differential Revision: https://phabricator.services.mozilla.com/D80105
2020-06-18 20:34:16 +00:00
Cosmin Sabou 65d75a47f3 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Emilio Cobos Álvarez 6bb08bd490 Bug 1646056 - Use const references as keys instead of raw pointers for PreloadHashKey. r=mayhemer
Feels a bit more natural for the callers this way. This should have no
behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D79831
2020-06-18 14:06:34 +00:00
Emilio Cobos Álvarez 939c7c466b Bug 1642591 - Don't make referrer policy a cache miss for sub-resource {pre,}loads. r=mayhemer,tnikkel
For preload we're already effectively not using it, I think, due to
bug 1642325.

For images, this matches the spec, see earlier comments in this bug and
https://bugzilla.mozilla.org/show_bug.cgi?id=1174921#c17.  I think it
makes sense for other sub-resources to align as well.

Differential Revision: https://phabricator.services.mozilla.com/D79812
2020-06-18 14:06:20 +00:00
Emilio Cobos Álvarez 090e3d2409 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-18 13:55:03 +00:00
Brindusan Cristian 8246b23171 Backed out changeset a59280f412c0 (bug 1633737) for crashtest assertion failures at nsGridContainerFrame.cpp. CLOSED TREE 2020-06-18 04:16:09 +03:00
Emilio Cobos Álvarez 011d524740 Bug 1646336 - Don't unnecessarily lose precision in nsComputedDOMStyle. r=hiro
We're converting to nscoord in some places unnecessarily, reducing the
precision of the computed value we return.

This makes some tests unnecessarily fail if we change the base of
nscoord.

Differential Revision: https://phabricator.services.mozilla.com/D79996
2020-06-18 00:42:47 +00:00
Brindusan Cristian f93d2c823e Backed out changeset 2011f0091ccf (bug 1646336) for dt failures at browser_accessibility_print_to_json.js. CLOSED TREE 2020-06-18 03:17:34 +03:00
Emilio Cobos Álvarez 28c68306b3 Bug 1646546 - Port the style crate to rust 2018. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D80101
2020-06-17 23:40:30 +00:00
Emily McDonough 4b9ef7886e Bug 1633737 - Fix asserts and array accesses for oversized grid tracks with repeat-auto r=emilio
Handle grid track lists that are too large in CalculateRepeatFillCount. Check
for repeat tracks that begin or end past the maximum track limit in
InitRepeatTracks, and handle the possible size mismatch in nsComputedDOMStyle.

This may result in there being fewer than the maximum number of tracks again
after removing empty tracks in a repeat(auto-fit), but only limiting the track
count after removing empty tracks would leave the number of repeat tracks
unbounded (or require a separate limit on just the repeat track count).

Differential Revision: https://phabricator.services.mozilla.com/D76191
2020-06-17 23:25:14 +00:00
Gijs Kruitbosch 222e2d1158 Bug 1644863 - fix trailing whitespace in cross-tree tests, r=emilio,marionette-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D79202
2020-06-17 22:45:31 +00:00
Emilio Cobos Álvarez 24a7deb2a4 Bug 1646336 - Don't unnecessarily lose precision in nsComputedDOMStyle. r=hiro
We're converting to nscoord in some places unnecessarily, reducing the
precision of the computed value we return.

This makes some tests unnecessarily fail if we change the base of
nscoord.

Differential Revision: https://phabricator.services.mozilla.com/D79996
2020-06-17 22:30:14 +00:00
Noemi Erli 22b81ffefa Backed out 2 changesets (bug 1603542) for causing assertion failures in Loader.cpp CLOSED TREE
Backed out changeset cc70c96b63e0 (bug 1603542)
Backed out changeset c3dcacdd97c4 (bug 1603542)
2020-06-17 18:37:45 +03:00
Honza Bambas 4339a72958 Bug 1603542 - Properly mark CSS preloads as used when processing stylesheet tags or imports, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76528
2020-06-17 14:07:16 +00:00
Philipp Zech 169b68c745 Bug 1636205 - Remove StyleFontSize enum from nsStyleConsts.h. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77511
2020-06-17 11:08:44 +00:00
Emilio Cobos Álvarez 6d77406410 Bug 1645180 - Refactor test use counters to be less repetitive, and also test <link>. r=firefox-style-system-reviewers,heycam
Without the previous patch, the tests for the second iframe fail.

Differential Revision: https://phabricator.services.mozilla.com/D79378
2020-06-13 02:03:11 +00:00
Emilio Cobos Álvarez 901e5fd0d7 Bug 1645180 - Don't under-report use counters for documents that hit the shared sheet cache. r=firefox-style-system-reviewers,heycam
This makes us refactor a bit more our setup but I think the end it's
worth it.

Differential Revision: https://phabricator.services.mozilla.com/D79377
2020-06-13 02:03:08 +00:00
Emilio Cobos Álvarez 8edda7acf2 Bug 1645180 - Allow to cache data: stylesheets across documents. r=firefox-style-system-reviewers,heycam
This is useful, simplifies testing this bug, and also matches the image
cache:

  https://searchfox.org/mozilla-central/rev/0e09b9191c02097034e46b193930f91c45b7885d/image/imgLoader.cpp#1867-1870

Differential Revision: https://phabricator.services.mozilla.com/D79376
2020-06-13 02:02:56 +00:00
Emilio Cobos Álvarez 5df2b6ec58 Bug 1599160 - Stop synthesizing performance timing entries for cache sheets. r=mayhemer
This basically undoes D77842, but it was better done on top than just
removing the patch from the stack. I could squash them if desired.

The previous patch to respect caching headers makes tests much much more
happy, to the point where I'm not sure whether we really need this or
not. Your call whether we should keep it or not.

Differential Revision: https://phabricator.services.mozilla.com/D78660
2020-06-12 19:06:12 +00:00
Emilio Cobos Álvarez e5fe143835 Bug 1599160 - Better integration of the shared stylesheet cache with the network cache. r=tnikkel,mayhemer,heycam
Make the stylesheet cache respect the same headers as the image cache
does. This makes no-cache stylesheets work as they do now, which is
useful for developers that want to develop sites locally, and for
shift-reloads, etc.

Differential Revision: https://phabricator.services.mozilla.com/D78659
2020-06-12 19:06:04 +00:00
Emilio Cobos Álvarez 10eb040bda Bug 1599160 - Add a performance resource entry when hitting the cache for the first time in a document. r=mayhemer,valentin
This matches other browsers, our current behavior, and the test
expectations from various WPTs.

Differential Revision: https://phabricator.services.mozilla.com/D77842
2020-06-12 19:05:56 +00:00
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
Emilio Cobos Álvarez 58bb0b25d9 Backed out 2 changesets (bug 477157) for border rendering regressions.
Backed out changeset 04543b8ded50 (bug 477157)
Backed out changeset 5df17ecbcaa1 (bug 477157)

MANUAL PUSH: backout
2020-06-14 11:45:06 +02: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 d1db9f246c Bug 1599160 - Stop synthesizing performance timing entries for cache sheets. r=mayhemer
This basically undoes D77842, but it was better done on top than just
removing the patch from the stack. I could squash them if desired.

The previous patch to respect caching headers makes tests much much more
happy, to the point where I'm not sure whether we really need this or
not. Your call whether we should keep it or not.

Differential Revision: https://phabricator.services.mozilla.com/D78660
2020-06-11 11:42:08 +00:00
Emilio Cobos Álvarez 5048e0ec84 Bug 1599160 - Better integration of the shared stylesheet cache with the network cache. r=tnikkel,mayhemer,heycam
Make the stylesheet cache respect the same headers as the image cache
does. This makes no-cache stylesheets work as they do now, which is
useful for developers that want to develop sites locally, and for
shift-reloads, etc.

Differential Revision: https://phabricator.services.mozilla.com/D78659
2020-06-11 11:42:01 +00:00
Emilio Cobos Álvarez d999791a43 Bug 1599160 - Add a performance resource entry when hitting the cache for the first time in a document. r=mayhemer,valentin
This matches other browsers, our current behavior, and the test
expectations from various WPTs.

Differential Revision: https://phabricator.services.mozilla.com/D77842
2020-06-11 11:41:59 +00: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
Emilio Cobos Álvarez 65e6b7b7c5 Bug 1640623 - Use enum classes for LookAndFeel::OperatingSystemVersion. r=jmathies
And simplify a bit its usage. Non-windows widget will just fail the
query, so there's no need to ifdef this.

Differential Revision: https://phabricator.services.mozilla.com/D76695
2020-06-11 11:28:59 +00:00
Emilio Cobos Álvarez ef3d21048d Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
sefeng 61d2e3133e Bug 1642364 - Add a temporary solution for modal dialog centered alignment r=emilio
Spec: https://html.spec.whatwg.org/multipage/#centered-alignment

The spec is opaque about the centered alignment mode and we couldn't
come up a satisfied solution by using the current version of the
spec. There will be discussion in CSSWG to talk about better solutions.
In the meantime, we are adding this patch as a temporary solution with
basic centered alignment support to allow us enabling the feature
in Nightly for more testing.

Differential Revision: https://phabricator.services.mozilla.com/D77678
2020-06-10 14:15:36 +00:00
neil 6b1f254a89 Bug 1641324 Remove the layout.css.scrollbar-width.enabled and layout.css.scrollbar-color.enabled prefs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D78400
2020-06-10 13:16:34 +00:00
Simon Giesecke 82dc9b2271 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 10:46:14 +00:00
Emilio Cobos Álvarez e8caef7a14 Bug 477157 - Ceil border and outline widths to 1 dev px at computed value time, but don't floor others to dev pixels until paint time. r=mats,dbaron
This seems to match what other browsers do, and seems saner layout-wise,
at least.

I only annotated outline-width-interpolation.html because it's already
fixed upstream in:

  8a489657bc

Differential Revision: https://phabricator.services.mozilla.com/D75360
2020-06-10 10:44:32 +00:00
Butkovits Atila e3dce68834 Backed out 3 changesets (bug 1643289, bug 1642949) for causing failure at test_headless_screenshot.html. CLOSED TREE
Backed out changeset 98c420f73380 (bug 1643289)
Backed out changeset 9447ea8910aa (bug 1643289)
Backed out changeset 0c827da9d847 (bug 1642949)
2020-06-10 10:07:23 +03:00
Simon Giesecke d419f0ff08 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 05:49:28 +00:00
Kenrick 08f36c530a Bug 1596160: Re-enable eslint rules within layout and address eslint failures in testcases r=dholbert
This patch was largely automated. It was generated by manually
editing .eslintrc.js and then running mach eslint layout --fix.

Additionally, this includes manual changes to test_bug533845.xhtml
and test_bug467442.xhtml that were necessary to appease eslint.

Differential Revision: https://phabricator.services.mozilla.com/D78615
2020-06-09 15:27:37 +00:00
Colomban Wendling 120fea1c42 Bug 1628762 - Fix tree column header color to follow theme. r=geckoview-reviewers,snorp
The background color for the tree column headers is drawn using the
system APIs, but the foreground uses custom colors, which didn't follow
theme.  This can lead to unreadable text with specific colors, e.g.
leading to black on black.

Fix this by using system colors for the foreground as well.  It also
adds on-hover styling to match possible background change on hover.

Differential Revision: https://phabricator.services.mozilla.com/D78073
2020-06-03 20:52:55 +00:00
Emilio Cobos Álvarez 5f15c64dda Bug 1642224 - Make sheet loads always have a sensible triggering principal. r=ckerschb
I'm going to need to always have a principal at hand for bug 1599160,
and this helps with that.

This fixes the assumptions in the comment here:

  https://searchfox.org/mozilla-central/rev/5e4d4827aa005d031580d2d17a01bae1af138b2e/layout/style/Loader.cpp#1408-1411

Which are not always true I think.

In particular, we may not always do a non-system load without an
associated DOM node. For link headers, we use the document loader, but
there's no DOM node to get a hand to. In those cases, before this patch
we're currently loading using the system principal, which seems wrong.

Differential Revision: https://phabricator.services.mozilla.com/D77614
2020-06-08 09:11:26 +00:00
Cameron McCormack 5e27c1bd6b Bug 1642261 - Part 2: Add telemetry for -moz-appearance usage. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77637
2020-06-05 00:39:50 +00:00
Emilio Cobos Álvarez 15e3db4260 Bug 1643230 - Clear last_parsed_property_id right after successfully parsing the value. r=jwatt
Rather than waiting until parsing another id (successfully or
unsuccessfully).

If we error before we even get to PropertyId::parse, we'd incorrectly
associate the error with the wrong property, incorrectly omitting it
sometimes.

Differential Revision: https://phabricator.services.mozilla.com/D78260
2020-06-05 18:13:14 +00:00
Emilio Cobos Álvarez 69e9c44fab Bug 1643279 - Fix specificity of select rules in forms.css. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D78252
2020-06-04 12:30:53 +00:00
Cameron McCormack 495960fe47 Bug 1642895 - Remove unused nsFontFaceLoader::Init declaration. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77997
2020-06-03 08:24:09 +00:00
Dorel Luca cffc8edb6f Backed out changeset 3d06403ffd5c (bug 1642364) for WPT failures in /semantics/interactive-elements/the-dialog-element/abspos-dialog-layout.html. CLOSED TREE 2020-06-04 00:59:44 +03:00
sefeng 22ba034ce8 Bug 1642364 - Add a temporary solution for modal dialog centered alignment r=emilio
Spec: https://html.spec.whatwg.org/multipage/#centered-alignment

The spec is opaque about the centered alignment mode and we couldn't
come up a satisfied solution by using the current version of the
spec. There will be discussion in CSSWG to talk about better solutions.
In the meantime, we are adding this patch as a temporary solution with
basic centered alignment support to allow us enabling the feature
in Nightly for more testing.

Differential Revision: https://phabricator.services.mozilla.com/D77678
2020-06-03 08:52:46 +00:00
Bogdan Tara ffdcf42e89 Backed out 2 changesets (bug 1642261) for browser_use_counters.js failures CLOSED TREE
Backed out changeset dd4c99038ede (bug 1642261)
Backed out changeset 308d2f7a4a13 (bug 1642261)
2020-06-03 11:43:20 +03:00
Cameron McCormack 061da14b2e Bug 1642261 - Part 2: Add telemetry for -moz-appearance usage. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77637
2020-06-03 05:15:21 +00:00
Narcis Beleuzu 726ebdec39 Backed out 2 changesets (bug 1642261) for mochitest failures on test_property_database.html . CLOSED TREE
Backed out changeset 32b26c1984f6 (bug 1642261)
Backed out changeset 68456151c046 (bug 1642261)
2020-06-03 07:30:23 +03:00
Cameron McCormack 8cf9670c90 Bug 1642261 - Part 2: Add telemetry for -moz-appearance usage. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77637
2020-06-02 13:15:04 +00:00
Narcis Beleuzu 05b019f27f Backed out changeset c3799309b95c (bug 1642364) for wpt failures on abspos-dialog-layout.html . CLOSED TREE 2020-06-02 22:39:15 +03:00
sefeng bb650da0c7 Bug 1642364 - Add a temporary solution for modal dialog centered alignment r=emilio
Spec: https://html.spec.whatwg.org/multipage/#centered-alignment

The spec is opaque about the centered alignment mode and we couldn't
come up a satisfied solution by using the current version of the
spec. There will be discussion in CSSWG to talk about better solutions.
In the meantime, we are adding this patch as a temporary solution with
basic centered alignment support to allow us enabling the feature
in Nightly for more testing.

Differential Revision: https://phabricator.services.mozilla.com/D77678
2020-06-02 04:14:04 +00:00
Ricky Stewart 0bbaac721b Bug 1641693 - Replace a bunch of uses of `GENERATED_FILES` with the `GeneratedFile` template r=necko-reviewers,geckoview-reviewers,aklotz,dragana,froydnj
Also update documentation to suggest using the `GeneratedFile` template rather than directly referencing `GENERATED_FILES` where possible.

Differential Revision: https://phabricator.services.mozilla.com/D77496
2020-06-01 16:00:28 +00:00
Emilio Cobos Álvarez f8b1e141b1 Bug 1642232 - Remove SheetState::Unknown. r=jwatt
It's unused.

Differential Revision: https://phabricator.services.mozilla.com/D77615
2020-05-31 18:56:03 +00:00
Emilio Cobos Álvarez 2f5607b8d0 Bug 1642221 - Rename SheetLoadData::mLoaderPrincipal to mTriggeringPrincipal. r=jwatt
I'm about to introduce the concept of "Loader principal" (as in "the
principal of the CSS loader"), and SheetLoadData already has an
mLoaderPrincipal.

However SheetLoadData's principal is just the triggering principal (the
principal that initiated the load). So name it that with consistency
with SheetInfo::mTriggeringPrincipal etc.

Differential Revision: https://phabricator.services.mozilla.com/D77613
2020-05-31 17:11:57 +00:00