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

702 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert 680815cd6e Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

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

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

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

MozReview-Commit-ID: EuRsDue63tK

--HG--
extra : rebase_source : 3356d4b80ff6213935192e87cdbc9103fec6084c
2017-10-27 10:33:53 -07:00
Emilio Cobos Álvarez 4deb3bee3b Bug 1411754: Rename PresShell::DestroyFramesFor to DestroyFramesForAndRestyle. r=mats
I'm drive-by removing the comment about the frame tree state because I looked
into it, and the answer is: we properly restore it.

The gotcha is that we retain it too much, indeed, we retain it enough that it
can leak. See bug 1397239.

MozReview-Commit-ID: LP6bXkduEZ4

--HG--
extra : rebase_source : f7e18fc35e48b75c07fcc84b939614d379926828
2017-10-25 23:12:25 +02:00
angelsl bdd58219ae Bug 1393116 - Move double-reflow for sizing-to-content one level lower r=dbaron
After the fix to bug 1294442 and bug 1324499, ResizeReflow began to be called
twice for each DOM update in webext popups, and we also artificially re-set the
scroll outside of ResizeReflow to counter the DidDoReflow callback in
nsHTMLScrollFrame setting scrolltop to zero due to the first reflow, which is
done with unconstrained height.

Because of the scrollport being reset we get spurious DOM scroll events.
Replacing the scrollport also interrupts smooth scrolling.

Move the double-reflow down one level into PresShell, doing it before
DidDoReflow is called. The scrollport is no longer reset (causing a spurious
scroll event), and we don't need to replace it (interrupting smooth scrolling).

Also partially fixes bug 1396034.

MozReview-Commit-ID: HzYITyH4UeW

--HG--
extra : rebase_source : 567056300bc81c9e4c197783f48636caf67cde34
extra : intermediate-source : ef7322dfd99d79a403bb0804638a46c70ece1b45
extra : source : 4f1761bb955473026b4deba76a5e76e93b7ede35
2017-09-09 00:38:54 +08:00
Stone Shih a1d26ab3b4 Bug 1316251 Part1: Separate pointer event implementation from PresShell. r=masayuki
This patch moves pointer event related implementations to a new class.

MozReview-Commit-ID: FdBYl7vYC5I
2017-09-06 15:47:49 +08:00
Alexander Surkov 45edae968f Bug 1321960 - rename nsIPresShell::mSuppressInterruptibleReflows to mWasLastReflowInterrupted to reflect better its purpose, r=dholbert 2017-09-26 16:25:12 -04:00
Daniel Holbert 66109d5421 Bug 1398379 part 2: Remove GetRootScrollFrameAsScrollableExternal() since it has no more callers. r=mats
MozReview-Commit-ID: 5m6p7sS2jRS

--HG--
extra : rebase_source : 9b7c26006cb542968c2b92b356a2beb1a334c2c9
2017-09-08 16:36:34 -07:00
Daniel Holbert 1c67d21eda Bug 1398376 part 3: Collapse formerly-MOZILLA_INTERNAL_API-guarded Foo()/FooInternal() functions together in nsIPresShell and nsPresContext. r=mats
This is just simplifying things by eliminating a layer of now-unnecessary
abstraction.

MozReview-Commit-ID: 1MBagjYXbCD

--HG--
extra : rebase_source : a0e7e78ef4925efd00eac969ae126d1ba3f4f607
2017-09-08 16:25:03 -07:00
Daniel Holbert c6e12c7a35 Bug 1398376 part 2: Remove formerly-MOZILLA_INTERNAL_API-guarded FooExternal() functions from nsIPresShell and nsPresContext. r=mats
These functions are now dead code.  And really, they were already dead code
even before this patch-stack -- they were only called in never-evaluated
(and now-deleted) #else clauses.

MozReview-Commit-ID: AeY6Z3ybmsv

--HG--
extra : rebase_source : deb51373f4d32580ab2ffb71c5c078132e4a76a6
2017-09-08 16:25:01 -07:00
Daniel Holbert 8a68df9e64 Bug 1398376 part 1: Remove MOZILLA_INTERNAL_API guards from nsIPresShell.h and nsPresContext.h, since these headers are only used in libxul. r=mats
This patch drops all MOZILLA_INTERNAL_API checks (and the bodies of any
associated "#else" clauses) from these files.  The basic assumption here is
that MOZILLA_INTERNAL_API is #defined in all (supported) compilation units that
#include these files, so the checks are superfluous and the #else clauses are
dead code.

(If this assumption is mistaken and there is some .cpp file in our codebase
that #includes this header and yet does not have MOZILLA_INTERNAL_API, we will
find out via bustage on treeherder.)

MozReview-Commit-ID: 8dHJFBDVHwT

--HG--
extra : rebase_source : 476a6e2de8468dea2e26e11f415c3868326126e5
2017-09-08 16:24:59 -07:00
Masayuki Nakano a309c213a3 Bug 1369072 - part1: PresShell should climb up scrollable frames when there is no selection, no focused content and root scrollable frame isn't scrollable r=smaug
When there is no selection and no focused content, aContent of
nsIPresShell::GetScrollableFrameToScrollForContent() is nullptr.  Then, it'll
use root scrollable frame to scroll.  However, the root scrollable frame may
be not scrollable.  In such case, ancestor document's scrollable frame should
be scrolled instead.

MozReview-Commit-ID: 1kOPtDX6G5L

--HG--
extra : rebase_source : 4b2c48bb187e40dbddd2760b8ddd8bf4abf5b178
2017-09-05 17:17:21 +09:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Emilio Cobos Álvarez 1e6e97fed1 Bug 1389743: Only reconstruct frames synchronously from ContentRemoved when called from frame construction. r=mats
There's only one case of sync frame construction from ContentRemoved now, and
it's not on the element being removed, but on the whitespace siblings if needed,
and _only_ when they don't support lazy frame construction.

Basically, this switches all the RecreateFramesForContent calls to use
`aAsyncInsert` (which I changed to an enum class for readability), except when
we're already reframing.

Also, it switches ReframeTextIfNeeded to opt-in into lazy frame construction,
since it's used only when aFlags == CONTENT_REMOVED.

This allows to simplify the DestroyFramesFor API (which I'm happy to rename to
something more meaningful, since now it's something like
DestroyFramesForAndRecreateThemAsync), and do some other consistency cleanups.

A bunch of the ContentRemoved callsites were pretty random at passing
aAsyncInsert, and that was some kind of a mess. This patch ensures consistency,
and makes it impossible to do O(n^2) work when removing DOM nodes, which is
nice.

The underlying reason for this is explained in the description of bug 1377848,
and basically allows us to remove a bunch of Servo hacks on the longer term (a
few of them are going away already, yay!).

MozReview-Commit-ID: 2DrUTxGV8RX

--HG--
extra : rebase_source : f428d839a5482477dea22c0fea600d54f3e8799c
2017-08-23 09:58:57 +02:00
Michael Kaply 73bafcec5e Bug 1389168 - Remove unnecessary IBM license text. r=gerv
MozReview-Commit-ID: 8HdaBppsJsc

--HG--
extra : rebase_source : 617c17b1162265e44810597fa69d533316da1a6b
2017-08-16 16:10:56 -05:00
Nicholas Nethercote 9ab2597a8d Bug 1387956 (part 2) - Overhaul handling of nsWindowSizes. r=mccr8.
This patch does the following.

- Moves nsWindowSizes from nsWindowMemoryReporter.h to its own file,
  nsWindowSizes.h, so it can be included more widely without exposing
  nsWindowMemoryReporter.

- Merges nsArenaMemoryStats.h (which defines nsTabSizes and nsArenaMemoryStats)
  into nsWindowSizes.h.

- Renames nsArenaMemoryStats as nsArenaSizes, and nsWindowSizes::mArenaStats as
  nsWindowSizes::mArenaSizes. This is the more usual naming scheme for such
  types.

- Renames FRAME_ID_STAT_FIELD as NS_ARENA_SIZES_FIELD.

- Passes nsWindowSizes to PresShell::AddSizeOfIncludingThis() and
  nsPresArena::AddSizeOfExcludingThis(), instead of a bunch of smaller things.
  One nice consequence is that the odd nsArenaMemoryStats::mOther field is no
  longer necessary, because we can update nsWindowSizes::mLayoutPresShellSize
  directly in nsPresArena::AddSizeOfExcludingThis().

- Adds |const| to a few methods.

MozReview-Commit-ID: EpgFWKFqy7Y
2017-08-10 14:14:09 +10:00
Ryan Hunt f116107a57 Bug 1379280 - Only do async keyboard scrolling for a selection, not a focused element. r=smaug
This commit changes async keyboard scrolling to be enabled only if the content to
scroll is from a selection. This works around the problem of detecting whether
an arbitrary element has key listeners that should prevent async key scrolling,
because when they have the focus we will have disabled async key scrolling.

MozReview-Commit-ID: 6HhSuGZNsMX

--HG--
extra : rebase_source : 98a6449dd1e913136ca66532a67df8e0bb717e52
2017-07-13 15:53:26 -05:00
Ryan Hunt 74d75aee90 Bug 1379280 - Move FocusTarget include from nsIPresShell to PresShell. r=smaug
FocusTarget used to be needed in nsIPresShell, but it was moved to PresShell.

MozReview-Commit-ID: HQFpT9OJaUz

--HG--
extra : rebase_source : ddc29462fc71f8a71dd2419823ddf6f7e92a60ce
2017-07-13 13:00:21 -05:00
Ryan Hunt f2d4d39378 Bug 1376538 - Transmit APZ focus target updates on empty transactions. r=kats
This commit also schedules empty transactions on input events that trigger a
focus sequence number update.

MozReview-Commit-ID: 1FWXfStLsGv

--HG--
extra : rebase_source : 02c6f07287b6909493f6f88345a3cca93ab3e45b
2017-06-28 15:11:04 -04:00
Ryan Hunt c1312e5abc Bug 1351783 part 12 - Create and sync focus sequence numbers. r=kats,botond,dvander
Focus can change at any moment in a document. This causes non-determinism and
correctness problems for doing keyboard apz scrolling. To get around this, we
will maintain deterministic behavior for focus changes initiated by input events
and see if we can get away with more non-determinism for things like `setTimeout`

In order to do this, we disable async keyboard scrolling when an input event is
processed that could have a event listener. We then attach a sequence number to
that input event and dispatch it to content. In content, we record the highest
sequence number that we have processed from an event, and send that on each focus
update. Using this, we can determine in APZ if we have a current focus target or
if we are still waiting for an input event to be processed and focus to be
reconfirmed.

MozReview-Commit-ID: CWcu8YEFQz4

--HG--
extra : rebase_source : 8c54a619bd4f5ee892f0cc8768a10f3e1e4e0b59
extra : histedit_source : 601ca293a028787883841adc6b40e62c0cc829e5
2017-06-05 19:45:31 -05:00
Ryan Hunt a6a2b4f7c4 Bug 1351783 part 10 - Create and sync the current FocusTarget on each layer transaction. r=kats,botond
This commit modifies PresShell and nsDisplayList to send a FocusTarget update on
every layer transaction. Ideally we would like to send updates as often as possible,
but this seems like it works well. This can be iterated on later, if necessary.

MozReview-Commit-ID: 8PFqIOhzH77

--HG--
extra : rebase_source : 1e2c3b5620f5d7e6e789848da57b2486c3d74f14
2017-06-13 02:00:49 -04:00
Ryan Hunt 99499fb9d6 Bug 1351783 part 7 - Create FocusState and FocusTarget types. r=kats,botond
This commit begins the work needed for tracking focus by creating two new classes,
FocusTarget and FocusState. FocusState is created and used by APZCTreeManager to
track the global focus information, while FocusTarget is created per layer tree and
sent to APZ with local focus information. Between the two we are able to figure out
what the correct scrollable layer is to use in response to a keyboard scroll.

See the comment in `FocusState.h` for more details on the architecture and things
needed in future patches to complete this.

MozReview-Commit-ID: F75VZv3i9U2

--HG--
extra : rebase_source : 3d04bced8e13a9884f0c1b320bad8ba2205d7011
2017-06-05 19:12:22 -05:00
Mats Palmgren 9d353fa50b Bug 966240 - Remove support for <meta http-equiv="msthemecompatible" content="no">. r=dbaron
It appears that neither Chrome, Safari or Edge support this feature,
and it's causing web-compat issues for us, e.g. bug 1373417.

MozReview-Commit-ID: AP5LMgL6QmR
2017-06-16 17:17:22 +02:00
Alexis Beingessner adb013669b Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst f3bf820bfd Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c75211cb95 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
Mats Palmgren 357e4b9560 bug 1368547 part 2 - Remove nsFrameManager/PresShell methods dealing with placeholders and introduce a nsIFrame::GetPlaceholderFrame() convenience method. r=jfkthame
MozReview-Commit-ID: GBUiUBqJxhQ
2017-05-31 21:29:49 +02:00
Jonathan Kew 20b8376ffd Bug 1368654 - pt 1 - Implement memory reporter support for FrameProperties. r=mats 2017-05-31 19:52:47 +01:00
Emilio Cobos Álvarez d4ee389879 Bug 1367553: Move dirty style tracking to the StyleSet. r=heycam
MozReview-Commit-ID: 2ut8SAwNGN2

--HG--
extra : rebase_source : d9f7d7f1da7b38e595021795ee902e63746c8161
2017-05-24 02:53:08 +02:00
Phil Ringnalda 4dcbd3095c Backed out 2 changesets (bug 1367553) for build bustage
CLOSED TREE

Backed out changeset 3e6c9a752596 (bug 1367553)
Backed out changeset 1ee24478fa16 (bug 1367553)

MozReview-Commit-ID: B805jBJYcqL
2017-05-25 06:13:01 -07:00
Emilio Cobos Álvarez e2b5e966dc Bug 1367553: Move dirty style tracking to the StyleSet. r=heycam
MozReview-Commit-ID: 2ut8SAwNGN2

--HG--
extra : rebase_source : 5f84d20bd197cd2203093ef4b57cb6b8ce2eb15f
2017-05-24 02:53:08 +02:00
L. David Baron e50b00e813 Bug 1367190 patch 2 - Remove nsPresArena::AllocateBySize, nsIPresShell::AllocateMisc, and nsPresContext::AllocateFromShell. r=mats
MozReview-Commit-ID: l2UQC7qOQ0

--HG--
extra : transplant_source : L%29d%C1%7Cc%86%2B%A2%B3%FE%EC%9D%A5%D9%CEdQ%2CL
2017-05-24 09:36:11 -04:00
Mats Palmgren 5f995975b4 Bug 1359341 part 1 - Make PresShell::GetPlaceholderFrameFor return a nsPlaceholderFrame. r=jfkthame
MozReview-Commit-ID: AvfQcCtVMta
2017-05-23 19:09:26 +02:00
Emilio Cobos Álvarez 68f1504992 Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM

--HG--
extra : rebase_source : b02d516ea164fc567110338411bf6ba251d53dab
2017-05-07 16:36:47 +02:00
Matt Woodrow 82005900e6 Bug 1349418 - Put the unscrolled item in the right place when we're doing container scrolling. r=mstange 2017-04-28 12:45:36 +12:00
Emilio Cobos Álvarez d2f3dc13ec Bug 1357142: Kill PresShell::RecreateFramesFor. r=bz
It's not only inefficient, but also prone to buggyness. Since styles may not be
up-to-date when it happens.

Post a reconstruct instead, which ensures a style flush happens before running
frame construction.

MozReview-Commit-ID: DrakHsJv5fY
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 11900af908654336cc2391ab9480542c5474e38f
2017-04-17 18:01:37 +02:00
Astley Chen e4081a158f Bug 1355752 - Remove B2G code from PresShell files. r=jrmuizel
MozReview-Commit-ID: FIap9QM0vve

--HG--
extra : rebase_source : f80c009d67293b74b4c645f0e013842c6098d8ad
2017-04-20 13:16:42 +08:00
Emilio Cobos Álvarez fc80cf434d Bug 1351275: Move style flush observer logic to nsIPresShell, and align layout observing code. r=bholley
MozReview-Commit-ID: 2oUTNfTS4Ku
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : 97d055e6682cbe81eaf32c365004f194a0ae1935
2017-03-29 15:41:11 +02:00
Jan Henning 8a6b5c9c8a Bug 1328868 - Part 2 - Apply the system font scale as an additional text zoom factor to all pages that are not font inflated. r=tnikkel
We want to use a similar model as Chrome on Android does for scaling our display of web content, that is use font inflation for desktop pages and plain text zooming for everything else.

Since we don't want to simply clobber any text zoom that might have been set by the user/front-end code, we allow setting and storing the system font scale separately on the PresContext. We then calculate the effective text zoom value as the product of the system font scale and the current text zoom value.

Any function that is using the PresContext's TextZoom value for layouting/rendering is switched over to this new EffectiveTextZoom value, whereas functions that are interested in the text zoom as actually set by the user/front-end (e.g. the nsDocumentViewer, or the code responsible for copying text and full zoom settings into the new PresContext on page navigation) continue using the plain TextZoom value.

As long as font inflation is enabled in principle (e.g. font.size.inflation.minTwips != 0), every page starts out as eligible for font inflation until the relevant meta viewport tags marking the page as "mobile friendly" have been detected. Since the PresShell caches the font inflation state and only recalculates it when necessary, we make use of that and set the PresContext's system font scale as necessary whenever the font inflation state has been refreshed.

MozReview-Commit-ID: 2InyE04wKAW

--HG--
extra : rebase_source : 3f6d7128f37c1dc18f67a6655f86d9a3003fe90b
extra : source : 6100458b97289f9aea5ac8fda57ded045e6860b7
2017-02-25 13:22:52 +01:00
Emilio Cobos Álvarez 401a3ef429 Bug 1296516: Cleanup infallible or unchecked nsCSSFrameConstructor methods. r=heycam
MozReview-Commit-ID: IoMOQyAhadv
2017-03-20 22:28:16 +01:00
Stone Shih b3c77294ca Bug 1323158 - Part 3: Fire boundary events when dispatching gotpointercapture. r=smaug
--HG--
extra : rebase_source : e70ab21585d38a64c657c260b722ef1a09d87ae9
extra : histedit_source : 46a0483c2c7efb76a752ef472baa1bca28650241
2017-01-20 15:00:07 +08:00
Mats Palmgren 6ef6efaea3 Bug 1340771 part 2 - Introduce a WeakFrame class for heap allocated weak frame pointers, stored in a hashtable for fast lookup. r=tn
* * *
Bug 1340771 part 3 - Change existing heap allocated AutoWeakFrame instances to use WeakFrame instead.  r=tn

MozReview-Commit-ID: GSuUiy98jBa
2017-03-01 18:03:14 +01:00
Mats Palmgren d13aaf9ce0 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Wes Kocher a85d979e21 Merge m-c to inbound, a=merge
MozReview-Commit-ID: 18xg2cleATb
2017-02-17 13:51:01 -08:00
Boris Zbarsky 25937fe5a8 Bug 1339891 part 2. Make FlushPendingNotifications on a presshell quickly no-op if there is nothing to flush. r=heycam 2017-02-17 13:38:44 -05:00
Boris Zbarsky 92d6e995f7 Bug 1339891 part 1. Make the invariants around nsIPresShell::FlushPendingNotifications clearer. r=mats 2017-02-17 13:38:44 -05:00
Cameron McCormack 414df18eb5 Bug 1340090 - Make nsStyleSheetService notify PresShells directly instead of using the observer service. r=bz
MozReview-Commit-ID: 4xz422B6GSv

--HG--
extra : rebase_source : 5b6c132c5dcace04a6d1c3a6ba05a4b207f6bbba
2017-02-17 15:56:28 +08:00
Matt Woodrow ba6e966a12 Bug 1302071 - Part 1: Remove AddPresShellToInvalidateIfHidden since it doesn't appear to be necessary. r=tnikkel
We added this so that MozAfterPaint events would be delivered to hidden documents as part of bug 539356, but I don't remember what needed it.
It doesn't appear to be necessary for any tests any more, so let's just get rid of it

MozReview-Commit-ID: HcmIjstZyLQ

--HG--
extra : rebase_source : 3f58129b3b1588e5d39e00c157e4bdba1afeed0c
2017-02-17 11:49:29 +13:00
Cameron McCormack 71d4bbc431 Bug 1334735 - Part 2: Add separate flag to track need to flush throttled animations. r=bz,birtles
MozReview-Commit-ID: 6Vi3laKcbmG
2017-02-10 10:42:28 +08:00
Cameron McCormack b2ee81223c Bug 1334735 - Part 1: Move need style/flush flags from document to pres shell. r=bz
MozReview-Commit-ID: 2Amf9yGRiJA
2017-02-10 10:42:27 +08:00
Ehsan Akhgari b583e128e0 Bug 1335070 - Switch the PresShell::Paint profiler marker to use GetPrimaryContentDocument to annotate using the content document; r=tn 2017-02-02 18:22:53 -05:00
L. David Baron b0cf27878d Bug 1333951 - Unbreak dumping of style contexts. r=bzbarsky
Prior to this patch, dumping of style contexts in the layout
debugger would only dump the subtree associated with the root
frame, which just covers the viewport, canvas, and associated
scrollbars.

I think this has been broken since bug 236921 (2004) and
bug 378693 (2007) properly disconnected the root element from the
styles for the viewport and canvas.

This patch just manually dumps the root frame and the root
element's frame, since the style set no longer maintains a list
of all of the style context roots.

MozReview-Commit-ID: 5LEnbNtngN2

--HG--
extra : transplant_source : v%BB%09%C8M8%FE%25%A9%A6%3D%EA%BD%BE%DF7%08%9A%85m
2017-01-25 22:05:16 -08:00