Commit Graph

1472 Commits

Author SHA1 Message Date
Matt Woodrow
c43c973db0 Bug 1620679 - Don't fire load event from within Stop(). r=smaug
This matches what the spec says, and what blink does.

Differential Revision: https://phabricator.services.mozilla.com/D73994
2020-05-18 07:30:14 +00:00
Botond Ballo
62dd1d8c56 Bug 1556556 - Move GetCallbackTransform() into a new ViewportUtils class. r=kats
This function (and helper functions that wrap it) will be used extensively
throughout layout code, so keeping it in APZCCallbackHelper seems awkward.

nsLayoutUtils would also be a reasonable place but has the downside that
adding a new function to it triggers recompiling the world.

Differential Revision: https://phabricator.services.mozilla.com/D68296
2020-05-05 19:22:12 +00:00
Csoregi Natalia
bdf8849001 Backed out 30 changesets (bug 1556556, bug 1631568) for multiple mochitest failures. CLOSED TREE
Backed out changeset edd529f7a9c5 (bug 1631568)
Backed out changeset 1cc0881e244b (bug 1631568)
Backed out changeset ed3c1e85d5e3 (bug 1556556)
Backed out changeset 38ffc6215bbf (bug 1556556)
Backed out changeset 03c2c25d8023 (bug 1556556)
Backed out changeset 9c717eb067b8 (bug 1556556)
Backed out changeset 98e26bc98b85 (bug 1556556)
Backed out changeset 05a6a581e755 (bug 1556556)
Backed out changeset 867946cf05bb (bug 1556556)
Backed out changeset 20d72a334530 (bug 1556556)
Backed out changeset 2c62e61d9054 (bug 1556556)
Backed out changeset 62a223d057d2 (bug 1556556)
Backed out changeset 2c5d55a1f0b1 (bug 1556556)
Backed out changeset 700447945b4e (bug 1556556)
Backed out changeset 93190ae4f5ff (bug 1556556)
Backed out changeset a7bd34d961bb (bug 1556556)
Backed out changeset fccd1d3c7189 (bug 1556556)
Backed out changeset 24056e47183d (bug 1556556)
Backed out changeset 204881474cc1 (bug 1556556)
Backed out changeset 387320881876 (bug 1556556)
Backed out changeset be8f5eb58460 (bug 1556556)
Backed out changeset 629c58a9166b (bug 1556556)
Backed out changeset 4312b2b5dda8 (bug 1556556)
Backed out changeset d11dbf6403a5 (bug 1556556)
Backed out changeset 95c54c023779 (bug 1556556)
Backed out changeset 80fcb7e71188 (bug 1556556)
Backed out changeset d75a4ecb0d47 (bug 1556556)
Backed out changeset 903c4de34e7a (bug 1556556)
Backed out changeset f15334a3e803 (bug 1556556)
Backed out changeset 9553e99137ea (bug 1556556)
2020-04-28 12:43:11 +03:00
Botond Ballo
6a03dfe84c Bug 1556556 - Move GetCallbackTransform() into a new ViewportUtils class. r=kats
This function (and helper functions that wrap it) will be used extensively
throughout layout code, so keeping it in APZCCallbackHelper seems awkward.

nsLayoutUtils would also be a reasonable place but has the downside that
adding a new function to it triggers recompiling the world.

Differential Revision: https://phabricator.services.mozilla.com/D68296
2020-04-28 01:35:05 +00:00
Emilio Cobos Álvarez
eb5df42faf Bug 1612068 - Move zoom from the content viewer to the browsing context. r=nika
We need it to live in BrowsingContext instead of WindowContext, because
we need to preserve the zoom level across same-origin navigation.

It'd be nice if it only lived in the top BC, but that's not possible at
the moment because a lot of tests rely on zooming only iframes. Some of
them can be adjusted for scaling the top instead, but not sure it's
worth it's worth fixing them and moving the zoom to be top-only, as it'd
be a bunch of effort, and the complexity and overhead of propagating the
zoom is not so big.

The print-preview-specific code in nsContentViewer is from before we did
the document cloning setup, and it seems useless. I've tested print
preview scaling before and after my patch and both behave the same.

The rest is just various test changes to use the SpecialPowers APIs or
BrowsingContext as needed instead of directly poking at the content
viewer.

I named the pres context hook RecomputeBrowsingContextDependentData, as
more stuff should move there like overrideDPPX and other media emulation
shenanigans.

I also have some ideas to simplify or even remove ZoomChild and such,
but that's followup work.

Differential Revision: https://phabricator.services.mozilla.com/D71969
2020-04-22 19:32:52 +00:00
Emilio Cobos Álvarez
13a5536ca2 Bug 1612068 - Rename and simplify nsIContentViewer.deviceFullZoom. r=nika
It's only needed for a single test, and definitely not used in print
preview.

Depends on D71967

Differential Revision: https://phabricator.services.mozilla.com/D71968
2020-04-22 18:05:44 +00:00
Emilio Cobos Álvarez
03076b7277 Bug 1612068 - Remove nsIContentViewer.effectiveTextZoom. r=nika
It's unused.

Differential Revision: https://phabricator.services.mozilla.com/D71967
2020-04-22 18:05:03 +00:00
pbz
416696332f Bug 1615588 - nsDocumentViewer: Use prompt service instead of nsIPrompt. r=johannh,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D66449
2020-04-16 14:44:18 +00:00
Stefan Hindli
72b3f3eedf Backed out changeset 887f1769a2c6 (bug 1609446) for causing bc permafails in browser/base/content/test/webextensions/browser_permissions_installTrigger.js CLOSED TREE 2020-04-15 08:20:48 +03:00
Emilio Cobos Álvarez
f125fdcce4 Bug 1609446 - Make default window-constraints always show the content. r=mats,mstange
This code is used to determine the sizes of the top-level windows. However the
code doesn't cause quite desirable behavior (see the bug, and comment 15).

This patch does two things:

 * Unifies the html / xul code-paths. This shouldn't change behavior (because
   GetXULMinSize returns the fixed min-* property if present anyways), but
   makes the patch a bit simpler.

 * Makes the min-width of the XUL window be the pref size instead of the
   min-size (for the cases where you have no explicit min-width). This looks a
   bit counter intuitive, but it's the only way to guarantee that the content
   will be shown. This matches the sizing algorithm that dialogs use by default
   (via calling window.sizeToContent()), while allowing to undersize the window
   via a fixed min-width property.

This in turn makes sizeToContent() work "by default" on XUL windows, avoiding
having to make JS listen to everything that possibly could change the layout of
the document (like resolution changes).

Differential Revision: https://phabricator.services.mozilla.com/D70209
2020-04-15 01:44:25 +00:00
Botond Ballo
0c5e94c87e Bug 1629732 - Fix non-unified build errors in layout/base. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D70785
2020-04-14 03:05:26 +00:00
Kristen Wright
3aa2d68e11 Bug 1626388 - Convert two prefs in nsDocumentViewer to static pref r=njn
Converts `dom.disable_beforeunload` and `dom.require_user_interaction_for_beforeunload` to static pref.

Differential Revision: https://phabricator.services.mozilla.com/D69600
2020-04-06 19:57:01 +00:00
Emilio Cobos Álvarez
5fe67eadfa Bug 1620575 - Ensure that sizeToContent ceils when converting to dev pixels. r=dholbert
If we get a sub-pixel content size, rounding down may actually cause the content
to wrap, which is not desirable and would cause the content to be truncated.

Differential Revision: https://phabricator.services.mozilla.com/D69744
2020-04-06 07:38:25 +00:00
Sylvestre Ledru
3ce73036e5 Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D67574
2020-04-05 13:34:58 +00:00
Emilio Cobos Álvarez
66ff09f01e Bug 1624829 - Use FunctionRef for various Enumerate* callbacks. r=edgar
This avoids a bunch of ugly casts and void pointers, without much overhead
(unlike std::function or such).

Differential Revision: https://phabricator.services.mozilla.com/D68182
2020-03-26 12:44:47 +00:00
Emilio Cobos Álvarez
0180a4c63b Bug 1623837 - Use the last focused selection in nsDocViewerFocusListener. r=masayuki
This fixes the case where you have a focused input (or selection for <input
disabled>) in an <iframe> and move the focus outside of the iframe.

Differential Revision: https://phabricator.services.mozilla.com/D67596
2020-03-23 01:31:14 +00:00
Emilio Cobos Álvarez
b9ac81d824 Bug 253870 - Make disabled form controls selectable. r=masayuki,MarcoZ
This rejiggers a bit the way selection focus is handled so that focusing a
disabled form control with the mouse handles selection properly, and hides the
document selection and so on.

This matches the behavior of other browsers as far as I can tell.

Given now readonly and disabled editors behave the same, we can simplify a bit
the surrounding editor code.

Differential Revision: https://phabricator.services.mozilla.com/D66464
2020-03-19 13:18:16 +00:00
Mihai Alexandru Michis
1e7b7fcd8b Backed out changeset 9eeee9ec66d9 (bug 253870) for causing failures in browser_bug1261299.js
CLOSED TREE
2020-03-16 22:32:41 +02:00
Emilio Cobos Álvarez
b99995f100 Bug 253870 - Make disabled form controls selectable. r=masayuki,MarcoZ
This rejiggers a bit the way selection focus is handled so that focusing a
disabled form control with the mouse handles selection properly, and hides the
document selection and so on.

This matches the behavior of other browsers as far as I can tell.

Given now readonly and disabled editors behave the same, we can simplify a bit
the surrounding editor code.

Differential Revision: https://phabricator.services.mozilla.com/D66464
2020-03-16 17:41:07 +00:00
Makoto Kato
e93441044a Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Since safe area insets uses on content, we need send it from chrome process to
content process.

SafeAreaInsetsChanged will be called per window position/size change (Next
patch is Android implementation for it), we have to calculate safe area insets
on widget/window per change.

Current implementation is that this value is top level document only like Blink
since https://github.com/w3c/csswg-drafts/issues/4670 isn't resolved yet.

Differential Revision: https://phabricator.services.mozilla.com/D55084
2020-03-04 08:16:31 +00:00
Csoregi Natalia
078d08c712 Backed out 6 changesets (bug 1503656) as per request. CLOSED TREE
Backed out changeset 27faa3b167a9 (bug 1503656)
Backed out changeset 7111f9b5ad06 (bug 1503656)
Backed out changeset 43fdc889beac (bug 1503656)
Backed out changeset 332ceea26151 (bug 1503656)
Backed out changeset f31efa4ea2ec (bug 1503656)
Backed out changeset 91b847efe591 (bug 1503656)
2020-03-04 10:07:42 +02:00
Makoto Kato
ae5b78896d Bug 1503656 - Part 7. Notify of safe area insets changed. r=smaug
Since safe area insets uses on content, we need send it from chrome process to
content process.

SafeAreaInsetsChanged will be called per window position/size change (Next
patch is Android implementation for it), we have to calculate safe area insets
on widget/window per change.

Current implementation is that this value is top level document only like Blink
since https://github.com/w3c/csswg-drafts/issues/4670 isn't resolved yet.

Differential Revision: https://phabricator.services.mozilla.com/D55084
2020-03-04 07:28:04 +00:00
Jonathan Watt
bf67b6a70c Bug 1618909. Remove nsIWebBrowserPrint.documentName. r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D64774
2020-03-02 20:10:10 +00:00
Simon Giesecke
9bcfd47601 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980
2020-02-13 14:38:48 +00:00
shindli
6bb3487209 Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
d45525793f Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980
2020-02-12 17:24:41 +00:00
Tetsuharu OHZEKI
1e5bc41570 Bug 1597475 - Fix uses of nsIDocShellTreeItem in nsDocumentViewer::GetContentSize(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61415
2020-02-02 16:53:54 +00:00
Tetsuharu OHZEKI
88b6b02d0d Bug 1597478 - follow up: add the null check for mPresContext. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61416
2020-02-02 17:02:38 +00:00
Tetsuharu OHZEKI
0a127b6fb9 Bug 1597478 - Fix uses of nsIDocShellTreeItem in nsDocumentViewer::ShouldAttachToTopLevel(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61413
2020-02-02 16:47:14 +00:00
tichnas
4b1a49091b Bug 1605876 - Removed redundant #if(s). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D60347
2020-01-19 17:10:23 +00:00
Hiroyuki Ikezoe
48585fe72f Bug 1596317 - Use CallState for SubDocEnumFunc. r=smaug
`true` -> `CallState::Continue`
`false` -> `CallState::Stop`

Differential Revision: https://phabricator.services.mozilla.com/D57437
2019-12-19 07:58:45 +00:00
Bogdan Tara
e59c8c65fb Backed out 7 changesets (bug 1596317) for causing build bustages CLOSED TREE
Backed out changeset 0d3208fcb948 (bug 1596317)
Backed out changeset fe5554dc4115 (bug 1596317)
Backed out changeset 019de59cbc93 (bug 1596317)
Backed out changeset f4851472b087 (bug 1596317)
Backed out changeset a984cf515db8 (bug 1596317)
Backed out changeset d0da5bf9b4d4 (bug 1596317)
Backed out changeset abe5f2030dd9 (bug 1596317)
2019-12-19 06:49:39 +02:00
Hiroyuki Ikezoe
5575d95de1 Bug 1596317 - Use CallState for SubDocEnumFunc. r=smaug
`true` -> `CallState::Continue`
`false` -> `CallState::Stop`

Differential Revision: https://phabricator.services.mozilla.com/D57437
2019-12-19 04:16:10 +00:00
Emilio Cobos Álvarez
01ed71d1a7 Bug 1602003 - Correct writing-mode handling of nsDocumentViewer::GetContentSize. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D57640
2019-12-18 17:16:49 +00:00
Emilio Cobos Álvarez
9034de5dd0 Bug 1603313 - Subdocument enum callbacks should take a reference. r=bzbarsky
As they can never take null.

Differential Revision: https://phabricator.services.mozilla.com/D56843
2019-12-14 05:08:39 +00:00
Emilio Cobos Álvarez
fc769cdafc Bug 1603871 - Simplify some bits in nsDocumentViewer. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D57175
2019-12-14 00:25:22 +00:00
Csoregi Natalia
e55bd2f084 Backed out changeset 080ffc0db292 (bug 1603871) for bustages on nsDocumentViewer.cpp. CLOSED TREE 2019-12-14 01:29:09 +02:00
Emilio Cobos Álvarez
e2473cf6e8 Bug 1603871 - Simplify some bits in nsDocumentViewer. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D57175
2019-12-13 23:05:38 +00:00
Olli Pettay
c96e061efc Bug 1596958 - Synchronize layouthistorystate to parent process, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D53288
2019-12-05 20:30:45 +00:00
Brindusan Cristian
571f63a42b Backed out changeset 69ac0bf82505 (bug 1596958) for assertion failures at nsSHEntry.cpp. CLOSED TREE 2019-12-05 21:01:02 +02:00
Olli Pettay
5387a9b735 Bug 1596958 - Synchronize layouthistorystate to parent process, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D53288
2019-12-05 17:33:48 +00:00
Boris Zbarsky
2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Emilio Cobos Álvarez
6952f7d153 Bug 1599161 - Rename nsLayoutStylesheetCache to GlobalStyleSheetCache. r=boris
It's a better name, and will avoid confusion when I add other stylesheet caches
outside of the CSS loader.

Depends on D54556

Differential Revision: https://phabricator.services.mozilla.com/D54557
2019-11-25 22:08:43 +00:00
Ehsan Akhgari
c5ab356460 Bug 1592599 - Switch nsIDocShell.getDocShellEnumerator() away from using nsISimpleEnumerator; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D51100
2019-11-18 20:11:58 +00:00
Ting-Yu Lin
759bf8f4bf Bug 1590185 Part 2 - Support paged mode layout in layout debugger. r=dbaron
This patch adds a menu item in "Toggle" -> "Paged Mode". If the item is
toggled, after finishing loading the document, the document will be
forced into paged mode.

The print settings in `nsLayoutDebuggingTools::SetPagedMode()` are
similar to `setupPrintMode()` in reftest-content.js.

Remove the hack in nsDocumentViewer::InitInternal() because we don't
want to set a new document when mIsPageMode = false.

Differential Revision: https://phabricator.services.mozilla.com/D49993
2019-10-29 19:51:42 +00:00
Brad Werth
abed8b2a58 Bug 1561227 Part 1: Make nsDocumentViewer send a new event before setting full zoom levels on the pres contexts. r=emilio
The PreFullZoomChange event gives listeners an opportunity to capture
state before the viewport full zoom changes. Responsive Design Mode uses
this to save and later restore the resolution of the RDM pane.

Differential Revision: https://phabricator.services.mozilla.com/D48621
2019-10-25 21:05:42 +00:00
Ciure Andrei
33bb767c54 Backed out 8 changesets (bug 1561227) for causing browser_viewport_resizing_scrollbar.js to permafail CLOSED TREE
Backed out changeset aa00b1b62ea7 (bug 1561227)
Backed out changeset b22440a67078 (bug 1561227)
Backed out changeset 4776cec83ae8 (bug 1561227)
Backed out changeset ac88bbefb95f (bug 1561227)
Backed out changeset aef3cfa2f539 (bug 1561227)
Backed out changeset a3759e1a04e2 (bug 1561227)
Backed out changeset cfcf79794049 (bug 1561227)
Backed out changeset 97be65338edf (bug 1561227)
2019-10-26 00:00:48 +03:00
Brad Werth
a6dccdd7ec Bug 1561227 Part 1: Make nsDocumentViewer send a new event before setting full zoom levels on the pres contexts. r=emilio
The PreFullZoomChange event gives listeners an opportunity to capture
state before the viewport full zoom changes. Responsive Design Mode uses
this to save and later restore the resolution of the RDM pane.

Differential Revision: https://phabricator.services.mozilla.com/D48621
2019-10-24 23:42:50 +00:00
Csoregi Natalia
3cb82c8733 Backed out 8 changesets (bug 1561227) for failures on browser_viewport_resizing_scrollbar.js. CLOSED TREE
Backed out changeset 8117cafb3a20 (bug 1561227)
Backed out changeset 635534927ffc (bug 1561227)
Backed out changeset 693b0dd88f2b (bug 1561227)
Backed out changeset 257bc09f49af (bug 1561227)
Backed out changeset 1b63d555c6c1 (bug 1561227)
Backed out changeset 677da957ddcb (bug 1561227)
Backed out changeset f8b8e593316f (bug 1561227)
Backed out changeset 849e1cf51a8f (bug 1561227)
2019-10-25 02:35:11 +03:00
Brad Werth
fb7f827869 Bug 1561227 Part 1: Make nsDocumentViewer send a new event before setting full zoom levels on the pres contexts. r=emilio
The PreFullZoomChange event gives listeners an opportunity to capture
state before the viewport full zoom changes. Responsive Design Mode uses
this to save and later restore the resolution of the RDM pane.

Differential Revision: https://phabricator.services.mozilla.com/D48621
2019-10-24 16:48:14 +00:00