Commit Graph

767 Commits

Author SHA1 Message Date
Nicholas Nethercote
a518709339 Bug 1587162 - Fix UBSAN complaints about pref callbacks. r=erahm
Lots of these callbacks have a non-`void*` final parameter, which UBSAN
complains about. This commit changes them to have a `void*` parameter.

This requires undoing the machinery added in the first two commits of bug
1473631: `TypePrefChangeFunc` and `PREF_CHANGE_METHOD`. The resulting code is
simpler (which is good) and more boilerplate-y (which is bad) but avoids the
undefined behaviour (which is good).

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

--HG--
extra : moz-landing-system : lando
2019-11-01 02:57:20 +00:00
Timothy Nikkel
ede6368cfb Bug 1590551. Allow nsPresContext::GetNearestWidget to work when there is no frame tree. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D50135

--HG--
extra : moz-landing-system : lando
2019-10-23 23:37:11 +00:00
Emilio Cobos Álvarez
a3278b6dad Bug 1575806 - Cleanup a bit preference-stylesheet-related code. r=heycam
Some of it was dead code, another was inlining a not very useful function (and
in one case redundant, since EnsureInitialized() happened right after
Refresh()).

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

--HG--
extra : moz-landing-system : lando
2019-08-22 23:15:13 +00:00
Masayuki Nakano
cf0604278c Bug 1564639 - Make BrowserParent use nsPresContext::GetRootWidget() when handling IME related messages r=hsivonen
When contents notify IME or requests something to IME, they need to use
an `nsIWidget` instance which may have focus if active, and handles
native keyboard/IME events since that knows correct native IME context.

Currently, such widget exactly matches with the result of
`nsPresContext::GetRootWidget()`.  However, this is unclear for most developers.
Therefore, this patch creates a wrapper method of it named
`nsPresContext::GetTextInputHandlingWidget()`.  Then, also adds
`BrowserParent::GetTextInputHandlingWidget()` wraps it.  Finally, makes
`IMEStateManager` call `GetTextInputHandlingWidget()` of them.

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

--HG--
extra : moz-landing-system : lando
2019-08-19 08:27:32 +00:00
Edgar Chen
3d16032632 Bug 1572007 - Remove unused nsPresContext::IsTopLevelWindowInactive; r=smaug
It was introduced in bug 508482 and the consumer went away in bug 1424816.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 09:54:16 +00:00
Emilio Cobos Álvarez
0548a84746 Bug 1570721 - Add an API to nsPresContext to override the prefers-color-scheme value. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D40248
2019-08-02 15:18:27 +02:00
Emilio Cobos Álvarez
d93f6419d8 Bug 1570721 - Move the overrides to a separate struct in nsPresContext. r=heycam
Just so that we can keep track of these together.

Differential Revision: https://phabricator.services.mozilla.com/D40247
2019-08-02 15:18:24 +02:00
Emilio Cobos Álvarez
e288006e4e Bug 1570721 - Simplify emulated medium setup in nsPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D40246
2019-08-02 15:18:19 +02:00
Dan Glastonbury
f804fbbfd9 Bug 1567818 - Convert nsLayoutPhase into enum class. r=heycam
This allows nsLayoutPhase to be fwd declared.

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

--HG--
extra : moz-landing-system : lando
2019-07-23 05:40:49 +00:00
Emilio Cobos Álvarez
c17be889ab Bug 1218456 - Remove nsILinkHandler. r=smaug
Interfaces with just one implementation don't seem very useful.

Differential Revision: https://phabricator.services.mozilla.com/D37406
2019-07-09 23:08:05 +02:00
Emilio Cobos Álvarez
28801c9e84 Bug 1218456 - Allow navigating when there's no pres context. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37404
2019-07-09 23:07:29 +02:00
Dorel Luca
9925ca654c Backed out 5 changesets (bug 1218456) for Crashtest failures on dom/l10n/tests/mochitest/dom_localization/test_overlay.html. CLOSED TREE
Backed out changeset 31afe89c2d42 (bug 1218456)
Backed out changeset 8bd57ebc4528 (bug 1218456)
Backed out changeset e5d37afff36a (bug 1218456)
Backed out changeset e3da86278ecf (bug 1218456)
Backed out changeset 343046089f8e (bug 1218456)

--HG--
extra : rebase_source : f092d903c8c80581d187493e036b1875d8668b3d
2019-07-09 22:04:13 +03:00
Emilio Cobos Álvarez
23a7cb7a68 Bug 1218456 - Remove nsILinkHandler. r=smaug
Interfaces with just one implementation don't seem very useful.

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

--HG--
extra : moz-landing-system : lando
2019-07-09 16:17:47 +00:00
Emilio Cobos Álvarez
d5db3842a0 Bug 1218456 - Allow navigating when there's no pres context. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37404

--HG--
extra : moz-landing-system : lando
2019-07-09 16:17:27 +00:00
Csoregi Natalia
5663c7541b Backed out 4 changesets (bug 1488953) for causing Bug 1559690. a=backout
Backed out changeset 6b9cfebe8076 (bug 1488953)
Backed out changeset 6759badeec0e (bug 1488953)
Backed out changeset 5555e12078d3 (bug 1488953)
Backed out changeset 2a638724408b (bug 1488953)
2019-06-27 01:03:50 +03:00
Emilio Cobos Álvarez
4e5f983137 Bug 1488953 - Use a script runner for scrollport events. r=mats
This is consistent with the scroll area events too, and allows us to
remove the WillPaintObserver stuff.

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

--HG--
extra : moz-landing-system : lando
2019-06-13 02:30:25 +00:00
Andreea Pavel
2c4bcdbd1d Backed out 3 changesets (bug 1488953) for failing bc at browser_windowopen.js on a CLOSED TREE
Backed out changeset 8646ea969443 (bug 1488953)
Backed out changeset 519acd8e145f (bug 1488953)
Backed out changeset 3a5cbbb9bc48 (bug 1488953)
2019-06-10 11:48:07 +03:00
Emilio Cobos Álvarez
ea497c3671 Bug 1488953 - Use a script runner for scrollport events. r=mats
This is consistent with the scroll area events too, and allows us to
remove the WillPaintObserver stuff.

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

--HG--
extra : moz-landing-system : lando
2019-06-10 03:06:25 +00:00
Matt Woodrow
bf2de70741 Bug 1554832 - Add versions of nsPresContext::IsRootContentDocument to specify whether you want to consider OOP parent documents. r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D34098

--HG--
extra : moz-landing-system : lando
2019-06-07 15:24:47 +00:00
Masayuki Nakano
1c74a4dc50 Bug 253889 - part 2: Move all methods and public structs of nsIPresShell into mozilla::PresShell r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29311

--HG--
extra : moz-landing-system : lando
2019-05-01 02:27:53 +00:00
Sylvestre Ledru
96da5036ad Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-28 09:30:05 +00:00
Emilio Cobos Álvarez
11ea945833 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

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

--HG--
extra : moz-landing-system : lando
2019-04-25 23:03:04 +00:00
Jeff Gilbert
544759b391 Bug 1545892 - Reduce includes in gfx2DGlue.h, nsLayoutUtils.h, nsPresContext.h. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D28266

--HG--
extra : moz-landing-system : lando
2019-04-22 19:58:52 +00:00
Masayuki Nakano
9165a150a1 Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio
`nsPresContext` should use `mozilla::PresShell` directly instead of
`nsIPresShell`.  This patch makes it.

Unfortunately, `nsPresContext` and `nsIFrame` have `PresShell()`.  Therefore,
we cannot use `PresShell*` in its methods so that this patch uses `mozilla::`
namespace prefix.

It might be better to rename them as `PresShellPtr()` in another bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 12:40:26 +00:00
Emilio Cobos Álvarez
d8e2990d8a Bug 1535788 - Make the Document own the StyleSet. r=heycam
This is the last step to be able to call matchMedia on display: none iframes.

This is green, except for some startup preference query tests that I'm going to
address in a blocking bug (making LangGroupFontPrefs global, basically).

The setup is similar to the ShadowRoot one, except we don't eagerly keep the
StyleSet around up-to-date, we only fill it if it ever had a pres context.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 07:02:00 +00:00
Masayuki Nakano
b7fbcf781f Bug 1540015 - part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug
`*Inlines.h` shouldn't be included by another header file, but `nsPresContext.h`
does it.  This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between `PresShell.h` vs.
`nsIPresShell.h` and `nsPresContext.h if `Document.h` includes `PresShell.h`.
Therefore, this patch also solves this include hell with adding
`nsPresContextInlines.h`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:11:22 +00:00
Dorel Luca
5a0fa68b78 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano
2137fa4b14 Bug 1540015 - part 2: Make nsPresContext.h stop including nsIPresShel.h and nsIPresShellInlines.h r=smaug
`*Inlines.h` shouldn't be included by another header file, but `nsPresContext.h`
does it.  This causes include-hell which blocks the following fix.

Additionally, it causes an include hell between `PresShell.h` vs.
`nsIPresShell.h` and `nsPresContext.h if `Document.h` includes `PresShell.h`.
Therefore, this patch also solves this include hell with adding
`nsPresContextInlines.h`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 12:13:08 +00:00
Olli Pettay
ac08265665 Bug 1538517, use higher frame rate right after first contentful paint, r=farre
fcp is often almost blank paint, but the next couple paints have more content.
But in order to not regress page load time, reduce frame rate later during the page load.

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

--HG--
extra : moz-landing-system : lando
2019-03-26 20:47:50 +00:00
Emilio Cobos Álvarez
5aa8533517 Bug 1533963 - Use a single RestyleHint representation. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D22828

--HG--
extra : moz-landing-system : lando
2019-03-14 11:47:50 +00:00
Emilio Cobos Álvarez
759875a3fe Bug 1530193 - followup: Fix default type and value of browser.display.focus_ring_style.
It warns on debug builds.
2019-03-07 15:06:35 +01:00
Emilio Cobos Álvarez
2028cb1479 Bug 1530751 - Make the pres context optional in the style system. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D21239

--HG--
extra : moz-landing-system : lando
2019-03-06 21:36:12 +00:00
Emilio Cobos Álvarez
8c9a745531 Bug 1530193 - Refactor preference stylesheet prefs to not require a pres context. r=jwatt
We really only have two sets of prefs, one for chrome-like documents
(stuff in chrome docshells + chrome-origin images), and one for the rest.

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

--HG--
extra : moz-landing-system : lando
2019-03-06 21:34:30 +00:00
Emilio Cobos Álvarez
a59f4ed1fb Bug 1528914 - Tidy the relationship between the doc shell and the pres context. r=qdot
Make it always forward to the document's docshell. We rely on it being setup by
the time our stuff runs, and we cannot have multiple pres contexts per document
in different docshells anymore.

This allows me to also move some state to the document (about whether it's
currently loaded in a chrome docshell (nsPresContext::mIsChrome) and whether
it's a chrome origin image (nsPresContext::mIsChromeOriginImage), which will
help for bug 1490401 / bug 1418159.

The pres context already relies on having the docshell available on `Init` and
we don't properly handle dynamic changes to it.

The reason I store some state like whether the doc URI is chrome:// and whether
we're in a chrome docshell is not (only) to avoid recomputing it over and over,
but also to allow me to read them from Stylo (main-thread blocked, but poke at
that from multiple non-main-threads).

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

--HG--
extra : moz-landing-system : lando
2019-02-19 22:53:40 +00:00
Emilio Cobos Álvarez
8ccb77e27d Bug 1528712 - Remove a couple trivial dependencies on nsPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D20141
2019-02-19 14:54:01 +01:00
Ciure Andrei
965d533ca4 Backed out 2 changesets (bug 1528712) for Linux spcshell and reftest failures (test_ext_browserSettings.js, 1022481-1.html) CLOSED TREE
Backed out changeset 2d5c4e71e258 (bug 1528712)
Backed out changeset d981515b874b (bug 1528712)
2019-02-19 14:25:57 +02:00
Emilio Cobos Álvarez
522e6c9366 Bug 1528712 - Remove a couple trivial dependencies on nsPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D20141

--HG--
extra : moz-landing-system : lando
2019-02-19 11:17:28 +00:00
Markus Stange
f3d9f254c8 Bug 1506976 - Make FirstContentfulPaint timing measure until the composite end of the paint. r=bas
Differential Revision: https://phabricator.services.mozilla.com/D18880

--HG--
extra : moz-landing-system : lando
2019-02-12 19:09:06 +00:00
Emilio Cobos Álvarez
0ebf739646 Bug 1523181 - Don't implicitly flush the user font set.
Summary:
Flushing it at a bad time can cancel loads whose timer / completion
handler is in progress, which makes no sense.

Reviewers: jfkthame, jwatt, heycam

Tags: #secure-revision

Bug #: 1523181

Differential Revision: https://phabricator.services.mozilla.com/D17856
2019-02-05 13:30:13 +01:00
Emilio Cobos Álvarez
97bafbef75 Bug 1521137 - Remove another font API outside of the pres context. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D17005
2019-01-22 15:54:06 +01:00
Emilio Cobos Álvarez
8addc7a883 Bug 1521137 - The pres context's base min font size is dead code. r=heycam
Nobody uses it from js, and we only thread the value around in layout. Let's
kill all this code.

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

--HG--
extra : moz-landing-system : lando
2019-01-21 07:15:02 +00:00
Cosmin Sabou
7ccc9d8b0b Merge mozilla-inbound to mozilla-central. a=merge 2019-01-19 11:57:49 +02:00
Emilio Cobos Álvarez
62fdf6f313 Bug 1430623 - Move the lang font prefs to Document instead of nsPresContext. r=jfkthame
This will allow me to (in different patches):

 * Make the default style structs constructible without a pres context (default
   color and co. would need to be faked or moved to Document as well, but that's
   ok, since those cannot affect media queries, the default font-size does).

 * Remove the nsPresContext pointer from ComputedStyle (moving it to nsFrame,
   probably).

That would in turn allow me to have the default style computed without a pres
context, which allows us to fix both bug 1490401 and bug 1471231.

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

--HG--
extra : moz-landing-system : lando
2019-01-18 13:43:06 +00:00
Brad Werth
4af0e76c46 Bug 1518965: Remove nsPresContext::mLastResizeEventVisibleArea and accessor functions that are never used. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D16126

--HG--
extra : moz-landing-system : lando
2019-01-10 01:56:41 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Miko Mynttinen
aafa85ee9d Bug 1512251 - Remove unused render only selection code r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D13829

--HG--
extra : moz-landing-system : lando
2018-12-06 19:40:50 +00:00
Emilio Cobos Álvarez
df6ab0194b Bug 1511570 - Make content-language invalidate style data. r=jfkthame
This is needed because content-language can affect the default
computed values for a given document.

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

--HG--
extra : moz-landing-system : lando
2018-12-04 18:44:40 +00:00
Cameron McCormack
a9c935c355 Bug 1511854 - Part 1: Fix some formatting oddities in layout/ after the clang-format. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D13686

--HG--
extra : moz-landing-system : lando
2018-12-05 18:44:03 +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