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

1372 Коммитов

Автор SHA1 Сообщение Дата
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
Masayuki Nakano 3622509485 Bug 1545342 - part 2: Make some public enum of nsIPresShell move to mozilla namespace and defined as enum class in PresShellForwards.h r=smaug
This patch moves some `enum` in `nsIPresShell` which are in public scope into
`mozilla` namespace and change them as `enum class`es.

Unfortunately, only "where to scroll" enum is just defines constants of
percentages of scroll destination.  Therefore, this patch makes only them
as `static const`.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 05:04:15 +00:00
Masayuki Nakano 5932f01d53 Bug 1545342 - part 1: Create mozilla/PresShellForwards.h and move global enums/constants in nsIPresShell.h and mozilla/PresShell.h into the new one r=smaug
This patch creates new header, `mozilla/PresShellForwards.h`.  It should have
all forward declarations of global class/struct in `nsIPresShell.h` and
`mozilla/PresShell.h`.

Additionally, this moves all `enum`s and `constant`s in them into the new file
with changing them to `enum class`es.

This will make other headers which require only specific types in the header
files not include them.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 05:02:20 +00:00
Masayuki Nakano 65aa369673 Bug 1543315 - part 10: Mark nsIPresShell::GoToAnchor() and nsIPresShell::ScrollToAnchor() as MOZ_CAN_RUN_SCRIPT r=smaug
Next, we should mark `PresShell::ScrollContentIntoView()` as
`MOZ_CAN_RUN_SCRIPT` because it's used widely.

This patch marks its `PresShell` users, `GoToAnchor()` and `ScrollToAnchor()`,
as `MOZ_CAN_RUN_SCRIPT`.  Additionally, this patch moves them from
`nsIPresShell` to `PresShell` because all callers refers `PresShell` directly.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 01:27:47 +00:00
Hiroyuki Ikezoe 8bd0453a43 Bug 1528052 - Suppress resize events until the initial paint has finished on mobile. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D28172

--HG--
extra : moz-landing-system : lando
2019-04-23 04:14:55 +00:00
Daniel Holbert 5f53a9bcdf Bug 1544897: Add includes, forward declarations, and namespaces to address non-unified build bustage in layout/{base,build,generic}. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D27782

--HG--
extra : moz-landing-system : lando
2019-04-16 21:18:30 +00:00
Masayuki Nakano 60e014c55e Bug 1544215 - Make nsIContentVewer::GetPresShell() return mozilla::PresShell instead of nsIPresShell r=bzbarsky
Additionally, this patch makes `nsDocumentViewer` which is the only
implementation of `nsIContentViewer` use `mozilla::PresShell` directly
rather than via `nsIPresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 02:47:26 +00:00
Masayuki Nakano 414509fe00 Bug 1543315 - part 9: Mark nsIPresShell::FlushPendingNotifications() as MOZ_CAN_RUN_SCRIPT r=smaug
So, this patch makes all caller of it safe including its arguments unless
they come from other methods.

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

--HG--
extra : moz-landing-system : lando
2019-04-13 12:43:57 +00:00
Masayuki Nakano e8514bbdc6 Bug 1543315 - part 4: Mark ResizeReflow() as MOZ_CAN_RUN_SCRIPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D27220

--HG--
extra : moz-landing-system : lando
2019-04-13 12:39:47 +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 de2d589e58 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 15:12:47 +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 9273f25ce2 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

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

--HG--
extra : moz-landing-system : lando
2019-03-29 13:09:26 +00:00
Cameron McCormack e90bcb5786 Bug 1535874 - Don't clear out nsStyleSheetService::gInstance when random other nsStyleSheetService objects are destroyed. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D23815

--HG--
extra : moz-landing-system : lando
2019-03-27 22:40:14 +00:00
Botond Ballo 573a6eaafa Bug 1538511 - Move nsIScrollableFrame::ScrollMode into a separate file. r=kats
This allows this enumeration to be used from nsIPresShell.h without introducing
a circular dependency.

Its new home in layout/base/ScrollTypes.h, included as mozilla/ScrollTypes.h.
Others similar enums can be added to that file if desired.

This patch also makes ScrollMode an enum class (as it's no longer nested
inside a class) and switches its enumerators to the |eName| naming convention.

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

--HG--
extra : moz-landing-system : lando
2019-03-25 23:17:20 +00:00
Daniel Holbert c3b4d76ce6 Bug 1535388: Don't fire PageShow from nsDocumentViewer::LoadComplete, if onload caused a new viewer to replace us. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D24112

--HG--
extra : moz-landing-system : lando
2019-03-22 06:16:14 +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
Hiroyuki Ikezoe 163a45f495 Bug 1531173 - Drop nsIContentViewer.scrollToNode. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D21458

--HG--
extra : moz-landing-system : lando
2019-02-28 01:31:47 +00:00
Boris Zbarsky 2e5c884144 Bug 1489308 part 5. Align the work we do on document.open with the spec. r=mccr8,smaug
The main behavior changes are:

1) We no longer create a new Window when doing document.open().  We use the
same Window but remove all the event listeners on it and on the existing DOM
tree before removing the document's existing kids.

2) We no longer create a new session history entry.  The existing one always
gets replaced instead.

3) We now support document.open on documents that are not in a Window.

The reasons for the various test changes are as follows:

The change to browser_modifiedclick_inherit_principal.js is because we no
longer set the docshell to a wyciwyg URL when document.open() happens and the
test was depending on that to terminate.

browser_wyciwyg_urlbarCopying.js is being removed because it's trying to test
wyciwyg URIs, which no longer exist.

The changes in docshell/test/navigation are because document.open() no longer
affects session history.  One of the tests was testing the interactions there
and is being removed; another is being repurposed to just test that
document.open() does not affect history.length.

The change to test_x-frame-options.html is because document.open() now removes
event listeners on the window, which it didn't use to do (and in the specific
case in this test reused the existing inner too, so the listener was still
around in practice).  The new behavior matches other browsers.

The removal of test_bug172261.html is because document.open() no longer affects
session history, so you can't go back across it or forward to the "opened"
state, so the situation that test is trying to test no longer exists.

The changes to test_bug255820.html are because reloading a document after
document.open() will now just load the URL of the document that was the entry
document for the open() call, not reload the written content.  So there's not
much point testing reload behavior, and in this test it was just reloading the
toplevel test file inside the frames.

The change to test_bug346659.html is because now we no longer create a new
Window on document.open().

The change to test_bug1232829.html is because document.open() (implicit in this
test) no longer adds history entries, so the back() was just leaving the test
page instead of going back across the document.open().  The test is a
crashtest in practice, so might still be testing something useful about how
document.open() interacts with animations.

The change to test_bug715739.html is because the URL of the document after
document.open() is now the URL of the entry document, not a wyciwyg URL, so
reload() has different behavior than it used to.

The change to test_bug329869.html is because now when we go back we're
reloading the original document we had, not doing a wyciwyg load, and the
security info now doesn't include the untrusted script.

The changes to the wpt expectations are removing a bunch of expected failures
now that we pass those tests and disabling some tests that are fundamentally
racy and hence fail randomly.  The latter all have github issues filed for the
test problem.

The change to testing/web-platform/tests/common/object-association.js is fixing
tests that were not matching the spec (and were failing in other browsers).

The change to parser-uses-registry-of-owner-document.html is fixing tests that
were not matching the spec (and were failing in other browsers).

The change to document-write.tentative.html is because the test was buggy: it
was using the same iframe element for all its tests and racing loads from some
tests against API calls from other tests, etc.  It's a wonder it ever managed
to pass, independent of these patches (and in fact it doesn't pass according to
wpt.fyi data, even in Firefox).

The changes in html/browsers/history/the-history-interface are because
document.open() no longer adds history entries.  The test was failing in all
other browsers for the same reason.

The changes in html/browsers/history/the-location-interface are because
reloading a document.open()-created thing now loads the URL of the page that
was the entry document for the open() call.  The test was failing in all other
browsers.

The change to reload_document_open_write.html is because we now reload the url
of the document that entered the script that called open() when we reload, not
the written content.  Other browsers were failing this test too; Gecko with
the old document.open implementation was the only one that passed.

The change to http-refresh.py is to fix a test bug: it was not returning a
Content-Type header, so we were putting up helper app dialogs, etc.

The change to test_ext_contentscript.js is because we no create a new global
for document.open() calls.  Kris Maglione OKed this part.

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

--HG--
extra : moz-landing-system : lando
2019-02-27 23:24:48 +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
Bastien Abadie 758e52fd5a Bug 1524585 - Remove unused width/height updated values. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D18349

--HG--
extra : moz-landing-system : lando
2019-02-01 16:29:15 +00: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
Jon Coppeard a96229ddb3 Bug 1512749 - Convert JS::gcreason::Reason to enum class JS:GCReason r=jonco r=mccr8 2019-01-21 13:09:12 +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
Cameron McCormack cc5d047c75 Bug 1519737 - Move pluginProblemBinding.css to the UA style sheet cache. r=emilio,timdream
Differential Revision: https://phabricator.services.mozilla.com/D16430

--HG--
rename : toolkit/pluginproblem/content/pluginProblemBinding.css => layout/style/res/pluginproblem.css
extra : moz-landing-system : lando
2019-01-16 03:37:43 +00:00
Dorel Luca de46e66fcd Backed out changeset a85699150a8b (bug 1519737) for browser chrome failure in browser/base/content/test/static/browser_parsable_css.js
--HG--
rename : layout/style/res/pluginproblem.css => toolkit/pluginproblem/content/pluginProblemBinding.css
2019-01-16 03:25:22 +02:00
Cameron McCormack f11cf08512 Bug 1519737 - Move pluginProblemBinding.css to the UA style sheet cache. r=emilio,timdream
Differential Revision: https://phabricator.services.mozilla.com/D16430

--HG--
rename : toolkit/pluginproblem/content/pluginProblemBinding.css => layout/style/res/pluginproblem.css
extra : moz-landing-system : lando
2019-01-14 21:51:59 +00:00
Cameron McCormack 7cd9d6695b Bug 1519296 - Part 1: Use a sensible order when filling the style set with User and Agent sheets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D16281

--HG--
extra : moz-landing-system : lando
2019-01-12 00:50:01 +00:00
Cameron McCormack 788d8b2454 Bug 1519006 - Stop null checking infallible style sheet accessors in nsDocumentViewer::CreateStyleSet r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D16151

--HG--
extra : moz-landing-system : lando
2019-01-11 03:12:28 +00:00
Cameron McCormack 8106cebcf9 Bug 1519001 - Rename some style sheet accessors on nsLayoutStylesheetCache to indicate they can return null r=xidorn
Differential Revision: https://phabricator.services.mozilla.com/D16150

--HG--
extra : moz-landing-system : lando
2019-01-11 03:12:05 +00: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
Emilio Cobos Álvarez 63814207cb Bug 1516853 - Merge nsIDocument and nsDocument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D15498

--HG--
extra : moz-landing-system : lando
2018-12-31 14:10:19 +00:00
Emilio Cobos Álvarez f131713362 Bug 1516366 - Move base classes from nsDocument to nsIDocument. r=smaug
This is a big step in order to merge both.

Also allows to remove some very silly casts, though it causes us to add some
ToSupports around to deal with ambiguity of casts from nsIDocument to
nsISupports, and add a dummy nsISupports implementation that will go away later
in the series.

Differential Revision: https://phabricator.services.mozilla.com/D15352
2018-12-29 20:41:28 +01:00
Emilio Cobos Álvarez ecc88f298e Bug 1516366 - Remove uses of nsCOMArray<nsIDocument>. r=bzbarsky,smaug
Just use nsTArray. They're used to keep an array of strong references to
documents, and never use nsISupports-specific methods.

Plus they're are allocated on the stack so it should be safe to access them via
ranged for, so do that.

This is needed because nsCOMArray<T> depends on the cast from T to nsISupports
not to be ambiguous. I could fix that if needed, but it seems easier to just not
use it in these two cases.

Differential Revision: https://phabricator.services.mozilla.com/D15351
2018-12-29 20:41:20 +01:00
Andrea Marchesini 9cc643f6d3 Bug 1513895 - Unify PopupBlocker algorithm in 1 single file, r=smaug 2018-12-16 10:21:16 +01:00
Daniel Holbert 7c3b31a25d Bug 1512112: Remove redundant includes from source files in layout. r=TYLin
All of the removed includes are redundant (i.e. they're #included elsewhere in
the same file).

In most cases, I'm removing the second (redundant) copy of the
#include, except when that copy makes more sense (i.e. if it's in better sorted
order, or if it's paired alongside a closely-associated header while the
earlier copy is not).

Here's the script that I used to generate candidates here -- I ran this in
every subdirectory of layout, on my linux machine (warning, this writes two
files to your /tmp directory):

for FILE in *.h *.cpp; do
  nonunique=$(grep \#include $FILE | grep -v List\.h | cut -f2 -d'"'  | cut -f2- -d'/'| cut -f2- -d'/' | sort | wc -l)
  unique=$(   grep \#include $FILE | grep -v List\.h | cut -f2 -d'"'  | cut -f2- -d'/'| cut -f2- -d'/' | sort | uniq | wc -l)
  if [[ "$unique" != "$nonunique" ]]; then
    echo "$FILE: $nonunique / $unique"
    grep \#include $FILE | cut -f2 -d'"'  | grep -v List\.h | cut -f2- -d'/'| cut -f2- -d'/' | sort  > /tmp/nonunique.txt
    grep \#include $FILE | cut -f2 -d'"'  | grep -v List\.h | cut -f2- -d'/'| cut -f2- -d'/' | sort | uniq  > /tmp/unique.txt
    diff /tmp/nonunique.txt /tmp/unique.txt
    echo
  fi
done

Depends on D13773

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

--HG--
extra : moz-landing-system : lando
2018-12-05 18:55:59 +00:00
Cameron McCormack 1ea7c3efc9 Bug 1511854 - Part 2: Fix some more formatting oddities in layout/ after the clang-format. r=TYLin
Depends on D13686

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

--HG--
extra : moz-landing-system : lando
2018-12-05 18:44:05 +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
Kyle Machulis c241567f0f Bug 1505601 - Turn nsIDocShell XPIDL const lists into cenums; r=bzbarsky
Turn all const lists and related attributes into cenums, to provide a
vague sense of type safety.

Depends on D11715

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

--HG--
extra : moz-landing-system : lando
2018-11-28 03:30:56 +00:00
Cosmin Sabou 0afa5aa670 Backed out 2 changesets (bug 1508472) for causing build bustages on JobScheduler_posix.cpp. CLOSED TREE
Backed out changeset af951294cf96 (bug 1508472)
Backed out changeset 2320933cb7bc (bug 1508472)
2018-11-28 00:08:11 +02:00
Sylvestre Ledru 9ea4a3d5c0 Bug 1508472 - Part 3: Third batch of comment fix-ups in preparation for the tree reformat (layout/) r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D13125

--HG--
extra : moz-landing-system : lando
2018-11-27 21:39:24 +00:00
Daniel Holbert 9f6e171c2f Bug 1509972 part 4: Use UniquePtr (not nsAutoPtr) to store nsDocumentViewer member mAutoBeforeAndAfterPrint. r=TYLin
Depends on D12995

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

--HG--
extra : moz-landing-system : lando
2018-11-26 22:34:20 +00:00
Boris Zbarsky 71db58cf83 Bug 1507540 part 2. Use more notxpcom attributes in docshell/. r=smaug 2018-11-19 20:17:53 -05:00
Paolo Amadini 4c61f73d61 Bug 1470873 - Part 1 - Remove support for "components.css". r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D12029

--HG--
extra : rebase_source : e8528a8f04fd888112c4c9e800d0439e07beacd4
2018-11-15 14:34:18 +00:00
Andrew McCreight 837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Olli Pettay d359c13691 Bug 1489622 - Remove unused code from nsJSEnvironment, r=mccr8 2018-09-08 15:03:02 +03:00
Gerald Squelart b099eab802 Bug 1488684 - Made nsIFrame-derived classes and some others 'final' where possible - r=dbaron
All classes deriving from nsIFrame that did not have any subclasses themselves
(at the time of writing this patch) have been marked with `final`.
Some other Layout classes have also been made final, but this was opportunistic
while working on nsIFrame subclasses, and is definitely not exhaustive, further
patches welcome; refer to bug 1332680.

Advantages of marking a class final include:
- Allowing the compiler to devirtualize some method calls (i.e., calling
  virtual functions directly instead of going through the vtable),
- Indicating that the class is not currently subclassed,
- Preventing subclassing without being aware that this would remove the
  finalization benefits of the parent class.
`final` does not signify that these classes should *never* be subclassed, this
is left for developers to decide.

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

--HG--
extra : moz-landing-system : lando
2018-09-06 01:23:14 +00:00
Nicholas Nethercote f5d9c8867c Bug 1488321 - Remove all traces of the "transaction" terminology in SHistory. r=nika.
This patch:

- removes GetTransactionAtIndex(), because getTransactionAtIndex() can be used
  instead;

- renames a lot of things;

- updates some comments.

--HG--
extra : rebase_source : 845a1c1d5fe7f84eaa03db39a344d98fd5784afd
2018-09-05 09:03:22 +10:00
Nicholas Nethercote f369a978ca Bug 1487296 - Merge nsISHistoryInternal into nsISHistory. r=nika
With legacy add-ons gone, there is no benefit to keeping them separate.
2018-08-30 11:37:40 +10:00
Ting-Yu Lin a1ed764131 Bug 1482665 Part 5 - Remove nsDeviceContext::AppUnitsPerCSSInch() and replace it with mozilla::AppUnitsPerCSSInch(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D3158
2018-08-13 14:29:30 -07:00
Andrea Marchesini 8ab9f07dd8 Bug 1462879 - PerformanceNavigationTiming must be notified correctly - part 1 - notify, r=smaug, r=valentin 2018-08-04 08:54:58 +02:00
Emilio Cobos Álvarez c7d35aa526 Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug
MozReview-Commit-ID: DsNuF7GAflJ
2018-06-26 18:22:06 +02:00
Emilio Cobos Álvarez 8138ef471d Bug 1470163: Don't load mathml/svg.css if MathML/SVG is disabled. r=heycam
This fixes a MathML-disabled reftest with the previous patch.

The reftest assumes the sheet is not loaded, so let's just do that. This
effectively preserves behavior.

MozReview-Commit-ID: KrR4pHslycz
2018-06-25 10:54:48 +02:00
Emilio Cobos Álvarez 71d364bdd1 Bug 1470163: Load mathml.css upfront, and remove the concept of on-demand builtin UA sheets. r=heycam
On top of the two depending bugs.

Funny how there's a comment referencing bug 77999.

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

MozReview-Commit-ID: LCuJROu92bo
2018-06-25 10:54:38 +02:00
shindli 7fd12b01a4 Backed out 2 changesets (bug 1470163) for math failures in layout/mathml/tests/test_disabled.html on a CLOSED TREE
Backed out changeset e34a6bdac37a (bug 1470163)
Backed out changeset e2e97e7a605f (bug 1470163)
2018-06-24 06:56:44 +03:00
Emilio Cobos Álvarez 084ced3b22 Bug 1444193: followup: Remove comment which is no longer accurate. r=me
MozReview-Commit-ID: HyynrpMgKis
2018-06-24 03:59:21 +02:00
Emilio Cobos Álvarez 2027465bad Bug 1470163: Don't load mathml/svg.css if MathML/SVG is disabled. r=heycam
This fixes a MathML-disabled reftest with the previous patch.

The reftest assumes the sheet is not loaded, so let's just do that. This
effectively preserves behavior.

MozReview-Commit-ID: KrR4pHslycz
2018-06-24 03:55:59 +02:00
Emilio Cobos Álvarez a1abd0a493 Bug 1470163: Load mathml.css upfront, and remove the concept of on-demand builtin UA sheets. r=heycam
On top of the two depending bugs.

Funny how there's a comment referencing bug 77999.

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

MozReview-Commit-ID: LCuJROu92bo
2018-06-24 03:55:58 +02:00
Emilio Cobos Álvarez 711587f9ff Bug 1469176: Load svg.css upfront. r=jwatt
Test Plan: Covered by existing tests.

Reviewers: jwatt

Reviewed By: jwatt

Bug #: 1469176

Differential Revision: https://phabricator.services.mozilla.com/D1762
2018-06-22 12:48:40 +02:00
Emilio Cobos Álvarez bd7c1e4e8c Bug 1468133: Remove the optimization to lazily load non-SVG styles since it's not relevant anymore. r=heycam
This was a memory-saving optimization introduced as part of dependencies for bug
686875, but a more general system landed in bug 77999 for Gecko and
https://github.com/servo/servo/pull/18509 for Servo.

So now it's probably even a bit of a pessimization (though probably not huge),
and given this causes bugs like bug 1462742, bug 1157592, and bug 1468145, and
fishiness like the one pointed out in this bug, we may as well remove it.

The performance impact of having to lookup through more rules should be minimal
given the bloom filter and the rule hash optimizations.

This makes me wonder whether we could remove the whole concept of on-demand UA
sheets, since they've caused pain, for example, when the frontend people try
loading <svg>s from NAC (since that triggers sheet loading from frame
construction, which is not good). I'm not concerned about loading mathml.css and
svg.css everywhere, though xul.css may not be as doable since it adds a bunch of
attribute-dependent selectors. Though on the other hand I asserted in the
xul.css code and we don't load it in content with <video> / <input
type="date/time/etc"> and such, afaict, so maybe now that legacy addons are gone
we can remove that sheet from content processes altogether.

MozReview-Commit-ID: 9JCWNZj6BkT
2018-06-22 03:42:46 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Boris Zbarsky 0a370c0291 Bug 1455676 part 6. Remove nsIDOMNode usage from docshell/. r=qdot 2018-05-29 22:58:48 -04:00
Boris Zbarsky 69f3dde06c Bug 894215 part 3. Make sure we don't bfcache pages that get mutated after we capture their state. r=smaug 2018-05-18 23:37:56 -04:00
Boris Zbarsky 6f273bf6d2 Bug 894215 part 2. Fix the document "disallow bfcaching" mechanism to work without asserting. r=smaug
There are two issues being fixed here.  First, if DisallowBFCaching is called
before CanSavePresentation, we should really return false from
CanSavePresentation.  Otherwise we'll end up doing a bunch of state-capturing
work for no reason.

Second, if DisallowBFCaching is called between CanSavePresentation and
nsDocumentViewer::Destroy, we need to actually tear down the viewer state.
What we do right now is avoid putting the viewer into the SHEntry, but still
not tear down its presshell and so forth, which leads to asserts in
~nsDocumentViewer when this case is hit.
2018-05-18 23:37:56 -04:00
Emilio Cobos Álvarez 00ee40fe4c Bug 1459529: Remove ServoStyleSet::{Begin,End}Update. r=heycam
They're empty, and make PresShell::BeginUpdate useless. Now we don't have
document observers that listen for these anymore.

MozReview-Commit-ID: GpDDNonFUFC
2018-05-15 18:44:26 +02:00
Adrian Wielgosik c501e3beb0 Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
MozReview-Commit-ID: LKRnyDPNlle

--HG--
extra : rebase_source : a48b7c72a0f7ede38c91149a04d5de53987736f1
2018-05-11 19:46:15 +02:00
Adrian Wielgosik f1457c6874 Bug 1460940 - Remove nsIDOMDocument uses in layout/. r=bz
MozReview-Commit-ID: KixJ5edlCjl

--HG--
extra : rebase_source : 677049bc7eb131dc86ed468eb8a6b06085f2c17d
2018-05-11 19:46:15 +02:00
Boris Zbarsky b47b72dae9 Bug 1387143 part 23. Remove nsISelection collapse* methods. r=mats 2018-05-08 13:52:41 -04:00
Boris Zbarsky f992e7ed0d Bug 1387143 part 22. Remove nsISelection isCollapsed/collapsed bits. r=mats 2018-05-08 13:52:39 -04:00
Boris Zbarsky 3e7d2d87cf Bug 1387143 part 12. Remove nsISelectionPrivate::Add/RemoveSelectionListener. r=mats
None of the C++ callers of RemoveSelectionListener care about whether the
listener was already-added, and the only JS caller is in a test and knows the
listener was added.  So the behavior change to no-op instead of throwing when
trying to remove a nonexistent listener is OK.  Furthermore, the removal is
null-safe, so there's no point to explicitly failing if null is passed (which
it never is).

Since content can't directly add selection listeners, we can just use an
infallible append instead of returning errors callers don't check for anyway.

Also, no one passes null to AddSelectionListener, so we don't have to worry
about that part.
2018-05-08 13:52:37 -04:00
Boris Zbarsky b23f25078d Bug 1387143 part 1. Stop using nsISelection in nsISelectionListener. r=mats 2018-05-08 13:52:35 -04:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Emilio Cobos Álvarez bf64474d79 Bug 1457920: Remove StyleSheet::AsServo. r=xidorn
MozReview-Commit-ID: IkkJvUFHykk
2018-05-02 04:13:21 +02:00
Boris Zbarsky 597b4545d2 Bug 1429903 part 4. Remove nsIDOMEventTarget. r=mccr8
MozReview-Commit-ID: 9XuenUHxfPx
2018-04-20 00:49:30 -04:00
Boris Zbarsky 2b6097ae6d Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Andreea Pavel 4114ad2cfc Merge mozilla-inbound to mozilla-central. a=merge 2018-04-11 17:36:09 +03:00
Ciure Andrei 3f4a118829 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-04-11 12:00:35 +03:00
Cameron McCormack 3a70eaa88b Bug 1317541 - Merge number-control.css back into forms.css. r=mats
MozReview-Commit-ID: AGfsSF4dORN

--HG--
extra : rebase_source : b0fbe05bcef3e7228f43f6fb417fdaf430961f03
2018-04-10 11:04:41 +10:00
Nika Layzell 8822e43271 Bug 1434768 - Part 2: Replace nsDocShell::mSessionHistory with ChildSHistory, r=bz 2018-04-10 17:49:45 -04:00
Emilio Cobos Álvarez 41af367294 Bug 1452881: Remove usechromesheets support. r=heycam
MozReview-Commit-ID: I7BAxAHMZAK
2018-04-11 08:45:39 +02:00
Emilio Cobos Álvarez e128bf7b1a Bug 1447827: Remove ServoRestyleManager. r=xidorn
MozReview-Commit-ID: CFafQsb4rQn
2018-04-07 15:50:06 +02:00
Xidorn Quan 4cf9aed667 Bug 1449400 part 5 - Remove StyleSetHandle. r=emilio
This patch basically does:
* remove StyleSetHandle and its corresponding files
* revisit #includes of related header files and change correspondingly
* change nsIPresShell::mStyleSet to be UniquePtr<ServoStyleSet>
* change the creating path of ServoStyleSet to pass UniquePtr
* change other mentions of StyleSetHandle to ServoStyleSet*
* remove AsServo() calls on ServoStyleSet

Some unfortunate bits:
* some methods of (Servo)StyleSet only accepts ServoStyleSheet while
  many places call into the methods with StyleSheet, so there are many
  ->AsServo() added to sheets

MozReview-Commit-ID: K4zYnuhOurA

--HG--
extra : rebase_source : 459e8efeb171adad089d94272e143e8c244bd279
extra : source : 65ba2f174fcf7dba4e59c00ee8908b1bd0820a48
2018-03-29 22:15:46 +11:00
Xidorn Quan efc0cdde02 Bug 1447828 part 8 - Remove remaining uses of StyleBackendType as well as the type itself. r=emilio
MozReview-Commit-ID: 6sh4eKvDpRF

--HG--
extra : rebase_source : 7d83f2b2d4e2739333016ed82754bf3a4a700de4
extra : source : 147ca562a24652c3f30add793213db70aff65e9e
2018-03-29 02:34:34 +11:00
Xidorn Quan d81392eca1 Bug 1447828 part 6 - Have only a single nsLayoutStylesheetCache instance. r=emilio
MozReview-Commit-ID: BjCgc8MZjIq

--HG--
extra : rebase_source : 104140c2eed5987b5568aca89a72bc7d5e3ed839
extra : source : cd66e264953865b0604054fb9d0b741d0ae19ebf
2018-03-29 02:34:34 +11:00
Xidorn Quan d3b8ac27c8 Bug 1447828 part 5 - Remove StyleBackendType uses from nsStyleSheetService. r=emilio
MozReview-Commit-ID: 2yQqwVPnvdE

--HG--
extra : rebase_source : 90f58d5726cb85e9bbcf56bc2eaf29c85940ddbe
extra : source : 8ffba0152d4bd16f87d2ddefefacb7081a46443b
2018-03-29 02:34:34 +11:00
Xidorn Quan 3b8cc6c6ef Bug 1447828 part 4 - Remove StyleBackendType uses from Loader. r=emilio
MozReview-Commit-ID: 8DbjibZE3Dw

--HG--
extra : rebase_source : aa664ee40199b5358e304e076c8d6853e496d7a8
extra : source : 06be08613cf88b6963033929ff5ac0d82a6327b1
2018-03-29 02:33:01 +11:00
Boris Zbarsky df07d2d834 Bug 1447890 part 5. Remove nsISelection::RemoveAllRanges. r=mystor
MozReview-Commit-ID: EeMje9KW6An
2018-03-27 00:35:23 -04:00
Boris Zbarsky 0245595d7e Bug 1447889 part 1. Change nsCopySupport to work with Selection a bit more. r=mystor
MozReview-Commit-ID: B8HePBcalWU
2018-03-27 00:35:20 -04:00
Emilio Cobos Álvarez f7522ae728 Bug 1447358: Unifdef the old style system code. r=jwatt
Summary:
This has been automatically generated using:

  http://dotat.at/prog/unifdef/

And:

find $OBJDIR -type f -name '*.h' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

find $OBJDIR -type f -name '*.cpp' |
while read FILE; do
  echo "$FILE"
  unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE";
done

MozReview-Commit-ID: I4NdKqbMXzJ

Reviewers: jwatt

Bug #: 1447358

Differential Revision: https://phabricator.services.mozilla.com/D779
2018-03-21 10:20:34 +01:00
Emilio Cobos Álvarez 432d45b460 Bug 1439027: Simplify PresShell::Initialize. r=bz
Most of the callers pass the already-existing pres-context visible area. The few
that don't can set it themselves.

MozReview-Commit-ID: KRi4ShrgOrE
2018-02-21 12:42:17 +01:00
Hiroyuki Ikezoe 1b0cba9367 Bug 1417354 - Introduce nsIDocument::GetPresContext(). r=smaug
It would be convenient to get nsPresContext from nsIDocument.

MozReview-Commit-ID: Ei6V3UE8XGr

--HG--
extra : rebase_source : 8d2a917eb62cf341e4e1810451fd01c01dbc3bad
2018-02-21 07:00:10 +09:00
Emilio Cobos Álvarez c37c40b47d Bug 1436059: Cleanup a bit after ourselves. r=xidorn
on a CLOSED TREE

MozReview-Commit-ID: DWWmdtigIkk
2018-02-16 16:56:26 +01:00
Eric Rahm 7e19ac02be Bug 1437173 - Remove warning that node is null in GetInLink. r=bz
This reverts back to just returning failure rather than warning and returning
failure in GetInLink.

--HG--
extra : rebase_source : ce32635e3c301164c3296db71fcab624e256ac93
2018-02-09 13:10:13 -08:00
Bob Owen b3ae9277a2 Bug 1379117 Part 1: MOZ_ASSERT when not retrieving nsIWebBrowserPrint through docshell for Print Preview. r=jwatt
Changing the last retrieval of the nsIWebBrowserPrint in
printpreview_bug396024_helper.xul caused problems because doing it via the
docshell interrupts the load that triggers run5.
So, I moved the test to run5, which is more consistent with run2 and run3.
I then realised that the frames would have switched anyway, so I changed it to
retrieve frame[0] for the last test, which I think makes more sense.
It's not totally clear to me what this was testing originally or whether it
continued to do so after the addition of the second iframe a long time ago.
2018-02-08 08:59:20 +00:00
Cameron McCormack d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Cameron McCormack cc7db5c40c Bug 1430014 - Part 4: #ifdef out unnecessary code when the old style system is not built. r=xidorn
MozReview-Commit-ID: 1FZ9VzjcPzN

--HG--
extra : source : de22d220635f8c059834b76f769d5215ab1a8b5b
2018-02-01 15:04:04 +11:00
Boris Zbarsky 65bf16222e Bug 1434399 part 19. Remove nsIXULDocument. r=mystor
MozReview-Commit-ID: 9jQu4sjOhb2
2018-01-31 14:49:29 -05:00
Boris Zbarsky 99c47399c4 Bug 1434399 part 1. Switch to nsINode for the popup node on windowroot. r=mystor
MozReview-Commit-ID: HyiHElDnmSH
2018-01-31 14:49:26 -05:00
Cosmin Sabou 94617f91cf Backed out 19 changesets (bug 1434399) for build bustages on nsXULPopupManager.cpp on a CLOSED TREE
Backed out changeset 499f6dffd9cb (bug 1434399)
Backed out changeset 018290612415 (bug 1434399)
Backed out changeset f4c3179f8e59 (bug 1434399)
Backed out changeset f3ce2826b857 (bug 1434399)
Backed out changeset 6d2391af01dd (bug 1434399)
Backed out changeset dc98ed8c609a (bug 1434399)
Backed out changeset 8eaa395d6200 (bug 1434399)
Backed out changeset 19b18f4a53be (bug 1434399)
Backed out changeset 8ff378a6e96a (bug 1434399)
Backed out changeset 60fe73be1a26 (bug 1434399)
Backed out changeset faefb2751fdc (bug 1434399)
Backed out changeset 55cdf8b3a959 (bug 1434399)
Backed out changeset b578cc8efb92 (bug 1434399)
Backed out changeset 54cc4cb2fca1 (bug 1434399)
Backed out changeset f5343ef34d6c (bug 1434399)
Backed out changeset 8fb30e066cbd (bug 1434399)
Backed out changeset 21341b656b0f (bug 1434399)
Backed out changeset fab1f8b087a2 (bug 1434399)
Backed out changeset 55250a54852a (bug 1434399)
2018-01-31 22:45:26 +02:00