Commit Graph

18453 Commits

Author SHA1 Message Date
Noemi Erli
2062223489 Backed out changeset 04fecea9eaf0 (bug 1443672) as per dholbert's request on a CLOSED TREE 2018-03-07 20:55:26 +02:00
Daniel Holbert
93e46d9a9b Bug 1443672: Adjust a few .cpp files in layout to #include their own header first. r=emilio
MozReview-Commit-ID: L4ZSDT5Akhi

--HG--
extra : rebase_source : 4795c4eaf84957639f446471788697956fe2bf17
2018-03-06 15:59:36 -08:00
Emilio Cobos Álvarez
c976615ed6 Bug 1024082: Remove PresShell::FrameManager(), use PresShell::FrameConstructor instead. r=dholbert
Unfortunately this means that we need to export a couple more headers, but that
should be ok.

In particular, we have to export some headers that are #included by
nsCSSFrameConstructor.h, because nsCSSFrameConstructor.h itself will now be
included in more places outside of layout/, by .cpp files that don't necessarily
have the ability to indirectly #include its other headers, unless we export
them.

MozReview-Commit-ID: 2n9KHW6Yjrd
2018-03-07 10:17:52 +01:00
Emilio Cobos Álvarez
043503a6d4 Bug 1024082: Remove most of the nsIPresShell::FrameManager calls. r=dholbert
Most of them just want GetRootFrame(), and there's no need to explicitly go
through the frame manager for that, we have a handy alias in the shell.

MozReview-Commit-ID: GriEqkasidY
2018-03-07 10:17:49 +01:00
Emilio Cobos Álvarez
72f6feaa97 Bug 1024082: Remove nsFrameManagerBase. r=dholbert
Instead move UndisplayedNode to its own file, which is what causes the include
hell due to requiring nsIContent / nsStyleContext.

MozReview-Commit-ID: 1opiajueZNb
2018-03-07 10:17:48 +01:00
Kartikaya Gupta
b18710abb6 Bug 1442627 - Move static helpers from APZCTreeManager to APZUtils. r=botond
This also includes unified build fixes that were needed as a result of
the shuffling around.

MozReview-Commit-ID: 1AGG3DHnN1m

--HG--
extra : rebase_source : 7399cea6dff2bd91ab305dee22d93b32382cc0be
2018-03-06 10:25:39 -05:00
Chris Peterson
73675ec9f2 Bug 1443402 - Fix some -Wmissing-prototypes warnings in layout. r=dholbert
-Wmissing-prototypes is a new optional warning available in clang ToT. It warns about global functions that have no previous function declaration (e.g. from an #included header file). These functions can probably be made static (allowing the compiler to better optimize them) or they may be unused.

Confusingly, clang's -Wmissing-prototypes is equivalent to gcc's -Wmissing-declarations, not gcc's -Wmissing-prototypes. A function prototype is a function declaration that specifies the function's argument types. C++ requires that all function declarations specify their argument types, but C does not. As such, gcc's -Wmissing-prototypes is a C-only warning about C functions that have no previous function *prototypes* (with argument types), even if a previous function *declaration* (without argument types) was seen.

MozReview-Commit-ID: FGKVLzeQ2oK

--HG--
extra : rebase_source : 81e62163bf41a5d5dd87abf5397e6e8c62ed4096
extra : source : 653a9fc279e2f6a6d066474a94a70d65ac703d6b
2018-02-22 21:03:45 -08:00
Hiroyuki Ikezoe
0476fc2aa7 Bug 1442861 - Clear mNeedStyleFlush flag after ProcessPendingRestyles(). r=emilio
mNeedStyleFlush is also set by animation restyle request.  So it's possible
that the flag is set again in PostRestyleForThrottledAnimations() or in
sequential tasks for updating animations after the flag is cleared at the top
DoFlushPendingNotifications().

MozReview-Commit-ID: KPSS6cJb4HX

--HG--
extra : rebase_source : 31d839f12b654d52b352cd50e19bc1953c46b7c2
2018-03-06 06:34:02 +09:00
Emilio Cobos Álvarez
4657059140 Bug 1437155: Expect an assertion on the old style system. r=me
The old style system can't find the appropriate style to inherit from when
::first-line and display: contents are involved...

MozReview-Commit-ID: 98t1ABgLulQ
2018-03-05 16:20:35 +01:00
Emilio Cobos Álvarez
dc83850d63 Bug 1437155: Avoid giving a first-letter frame to a display: contents element. r=mats
It doesn't make sense, since they have no frame themselves, and it breaks
invariants other code relies on. Use the parent frame instead.

The stack overflow happens because we give the first-letter frame to the
display: contents element, then we reframe it.

Removing a display: contents node calls ContentRemoved on all the children. One
of these children is this text-node inside the first-letter frame. Since it was
split by bidi resolution we go ahead and reframe the parent in:

  https://searchfox.org/mozilla-central/rev/d2b4b40901c15614fad2fa34718eea428774306e/layout/base/nsCSSFrameConstructor.cpp#9688

But the parent is the display: contents node, which results in infinite
recursion.

The usage of GetParent() is wrong anyway too, since it doesn't handle XBL or
Shadow DOM in any way.

MozReview-Commit-ID: JFD16at316V

--HG--
extra : rebase_source : e485b45bc146a70c26f8534f760899218da07500
2018-03-05 11:42:12 +01:00
Emilio Cobos Álvarez
549e302e25 Bug 1442506: Adjust assertion to allow empty appends. r=xidorn
Deletion at the end of a text-node ends up translated to an empty append. It's
harmless though.

Reviewers: xidorn

Bug #: 1442506

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

MozReview-Commit-ID: DqheOYVWx8o
2018-03-02 12:26:27 +01:00
Ciure Andrei
199c24a789 Merge inbound to mozilla-central. a=merge 2018-03-02 12:16:06 +02:00
Xidorn Quan
5b522decf1 Bug 1441729 - Remove aTextIsSignificant param from nsStyleUtil::IsSignificantChild and its friends. r=emilio
MozReview-Commit-ID: CEZmAwcnglg

--HG--
extra : rebase_source : 4b5526baaf6a5fdee658ae5bdecb46e719bb2d38
2018-02-28 12:54:01 +11:00
Tiberius Oros
be676ac217 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-03-01 19:34:54 +02:00
Tiberius Oros
61d400da1c Merge inbound to mozilla-central. a=merge 2018-03-01 19:29:00 +02:00
Masatoshi Kimura
b1b043af08 Bug 1442266 - Stop including unnecessary <iostream>. r=froydnj
MozReview-Commit-ID: B0JDqyBanFE

--HG--
extra : rebase_source : dec1e2678083e3fb2b9a6b89322d1fa747ed6d4a
2018-03-01 23:07:56 +09:00
Dorel Luca
6735016b56 Merge mozilla-cental to mozilla-inbound. r=merge
--HG--
extra : rebase_source : f7e0a6b0f2925bd159de4d665c02493dab9b6282
2018-03-02 00:21:23 +02:00
Emilio Cobos Álvarez
2988d4e66d Bug 1442207: Remove unneeded arguments to nsIMutationObserver. r=smaug
aDocument is always content->OwnerDoc().
aContainer is always content->GetParent().

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

MozReview-Commit-ID: 4xwPCOnhyIL
2018-03-01 22:45:17 +01:00
Nathan Froyd
3165bc6030 Bug 1440465 - initialize more things in AutoPointerEventTargetUpdater; r=dholbert 2018-02-28 15:00:04 -05:00
Florian Quèze
6df7549a3e Bug 1433175 - semi-automated indent fix, r=Mossop. 2018-02-28 18:51:34 +01:00
Florian Quèze
c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Sebastian Hengst
769222fadf merge mozilla-inbound to mozilla-central. a=merge
--HG--
rename : browser/base/content/tabbrowser.xml => browser/base/content/tabbrowser.js
2018-02-28 12:54:12 +02:00
Mats Palmgren
e06a462e0f Bug 1427608 - [css-grid] Fix span=1 'auto' min-sizing for intrinsic sizing. r=dholbert
When sizing the container under a min- or max-content constraint,
the item's min/max-content contribution needs to be clamped (when
Automatic Minimum Size / clamping applies) if its size is 'auto'.
That'll give the container the right intrinsic size. In Reflow,
we'll size the track initially to the clamped min-content
contribution again (in the Resolve Intrinsic Track Sizes step),
but since the container now has a definite size we'll grow
the track in the Maximize Tracks step up to its limit
(i.e. the clamp size).

For more details on the underlying issue, see:
https://github.com/w3c/csswg-drafts/issues/2303
2018-02-28 03:56:13 +01:00
Emilio Cobos Álvarez
ac779f9004 Bug 1439395: Avoid leaving an stale restyle root if there's no servo data on it. r=bholley
If a single element is inserted in the document, from the lazy frame
construction path we mark it as the restyle root.

It has no restyle data, and we weren't calling ClearServoData when its parent
was being removed from ClearServoDataFromSubtree, thus leaving the stale restyle
root.

MozReview-Commit-ID: GY812b8tDk0

--HG--
extra : rebase_source : e6d1035e7d3a72b931aa53ac8dcbf7db58982479
2018-02-26 18:50:19 +01:00
Emilio Cobos Álvarez
f3fc2e4852 Bug 1439395: Clear Servo data only when the DOM is in a consistent state. r=bholley
We used to do it this way effectively until I fixed it in bug 1400936.

Per the list of fuzz bugs that bug has in the "Depends on" field, some of those
without a super-clear fix, and others that aren't listed in there, and all the
complexity we had to deal with while receiving restyle requests mid-unbind, etc,
I think this is the right call.

This clears data on RestyleManager::ContentRemoved for non-anonymous nodes, and
on UnbindFromTree for subtrees rooted at anonymous nodes.

This will hopefully yield enforceable invariants.

MozReview-Commit-ID: IMwX5Uh1apv

--HG--
extra : rebase_source : 6cafc4499c9b80cbc96f1c4d1496e524f59e3c4d
2018-02-19 14:46:38 +01:00
Brian Grinstead
ae62dc9519 Bug 1431522 - Remove the 'thumb' binding;r=enndeakin+6102+6102
MozReview-Commit-ID: JioZr8WAuPw

--HG--
extra : rebase_source : ceb229c1c19713462a617127cd9a32924775b146
2018-01-19 08:08:49 -08:00
Emilio Cobos Álvarez
9f26540cc4 Bug 1441547: Make character data change notifications use a const reference for the info parameter. r=smaug
It's not intended to be mutated.

MozReview-Commit-ID: 5nkD1YkidlV

--HG--
extra : rebase_source : 810d429208fa3eaf30e220e77a7d27107cb77346
2018-02-27 15:30:27 +01:00
Emilio Cobos Álvarez
3d6d2d9586 Bug 1440682: Make the XUL tooltip stuff saner. r=enn
We never removed the event listeners (the code was there, lol, but the function
that was supposed to call into the tooltip listener returned
NS_ERROR_NOT_IMPLEMENTED instead).

Furthermore, we added an event listener each time we reframed an element, which
is insane. Basically, each time an element with tooltip / tooltiptext gets its
frame tree reconstructed, we add the even listener, again, and we never free it.

Xidorn pointed out that this is not such a huge deal because we deduplicate
event listeners per spec, but still...

Move the code from the RestyleManager and the frame constructor to AfterSetAttr
/ BindToTree / UnbindFromTree in nsXULElement to hopefully make this saner.

MozReview-Commit-ID: 6BQbIQJ87qt
2018-02-26 15:44:48 +01:00
Zhang Junzhi
3492fb331e Bug 1438794 - Makes single-line text controls in vertical-writing mode vertically scrollable if they overflow vertically; and makes them horizontally unscrollable no matter whether they overflow horizontally. r=kats
As for now, the scrollable direction with a mouse wheel for a single-line text
control is hard-coded; that is, only horizontal wheel scrolls are able to take
effect while vertical ones aren't. However, this isn't the desired case for
vertical writing mode, where the opposite case definitely suits better.

This commit refines the hard-coded scrollable direction for a single-line text
control to be writing-mode-adaptive.

MozReview-Commit-ID: 4Zkoe2ExPCZ

--HG--
extra : rebase_source : 113b2ea80b6bbbcd2d8379b438de97eedd616551
2018-02-23 02:40:44 +08:00
Xidorn Quan
d6a3786a64 Bug 1440221 - Track stale computed values and style structs held by undisplayed maps in memory report. r=emilio,njn
MozReview-Commit-ID: 8eXowQvUjyi

--HG--
extra : rebase_source : cb5ba6598e90d9600983aad7f1fff4ff361e8af7
2018-02-22 23:19:50 +11:00
Ting-Yu Lin
4415223066 Bug 1432017 - Remove AccessibleCaretEventHub::PostScrollState. r=mats
In the era of B2G, we wanted to hide the carets during scrolling, and
PostScrollState was designed to avoid carets flicking during momentum
scrolling.

These days, we no longer hide carets during scrolling, so PostScrollState
can be removed to make the code simpler and easier to maintain.

MozReview-Commit-ID: Bf6ZgYVlt1q

--HG--
extra : rebase_source : 272bf91b8acaae6d81a3291b6ad85703ff2696dc
2018-02-23 22:05:49 +08:00
Emilio Cobos Álvarez
19c880a480 Bug 1438467: Don't reconstruct the parent when tearing down display: contents nodes with pseudo-elements. r=mats,bz
We just need to use the existing StyleChildrenIterator which iterates over them.

We need to be a bit careful though, since ::before and ::after are owned by
their own frame, and thus could be unbound from the tree or even dead after
removing the frame.

Hopefully the only access to the node being removed is unnecessary (anon roots
don't have siblings anyway).

There's also the weird thing of the thing we're iterating changing under the
hood. It works fine for this case, but maybe it would be better to handle them
explicitly like:

  if (Element* before = nsLayoutUtils::GetBeforePseudo(aChild)) {
    bool didReconstruct = ContentRemoved(aChild, ...);
    if (didReconstruct) {
      return true;
    }
    MOZ_ASSERT(!nsLayoutUtils::GetBeforePseudo(aChild));
  }

  // Same for ::after.

  StyleChildrenIterator iter(aChild);
  for (..) {
    // Do the rest of the kids, which can't get unbound.
  }

That'd repeat a bunch of code, so not a fan neither... I pointed this out more
explicitly in a comment instead.

MozReview-Commit-ID: HBsjLH01Db3
2018-02-25 02:06:05 +01:00
Emilio Cobos Álvarez
098eb77437 Bug 1439036: Stop passing bogus next sibling values into restyling / frame construction. r=bz
I think this is a regression from https://hg.mozilla.org/mozilla-central/rev/4a8294c6b8e33ba08ef767bede8deeb28234b5b8.

Before that, the only caller with NAC used to pass -1 as an index, which means
we didn't get a node back.

MozReview-Commit-ID: 7HYPaa2V3OB

--HG--
extra : rebase_source : 3f836c0de95159a4a5ece85dee1a8a26dfb2ba1f
2018-02-17 01:25:05 +01:00
Emilio Cobos Álvarez
a133a50ada Bug 1427625: Optimize appends to avoid restyling unnecessarily. r=xidorn
This unfortunately doesn't fix my test-case (because we're replacing the text
content all the time and all that), but it's still worth it, since it fixes the
case we care about (the parser appending).

We could also optimize pure insertions (since in that case we can still figure
out what the old text was), but it's probably annoying and not worth the churn.

In any case, we cannot optimize anything that resembles any kind of removal,
because from there we don't know the old text in any way (and the text nodes
like to reuse string buffers and such).

We could do two other optimizations to replace / extend this one, in that order:

 * Pass the buffer and length to CharacterDataWillChange, and use that to get
   the exact old text and the new one in RestyleManager. That would make the
   optimization exact.

 * Pass some sort of Maybe<bool> mWasWhitespace down the CharacterDataChangeInfo
   which is computed like:

    HasFlag(NS_CACHED_TEXT_IS_ONLY_WHITESPACE)
      ? Some(NS_TEXT_IS_ONLY_WHITESPACE)
      : Nothing()

It's not clear to me it's going to be completely worth the churn, so I haven't
done those yet, if we see code in the wild which resembles my testcase, we can
think of doing it.

MozReview-Commit-ID: 2rTWaZti8rv

--HG--
extra : rebase_source : 7390b8740801eb7b91700bb2533c43c173ac5db9
2018-02-27 17:02:52 +01:00
Emilio Cobos Álvarez
bd1d30c860 Bug 1422653: Make FindSiblingInternal take the iterator by ref to please the static analysis on the next patch. r=mats
MozReview-Commit-ID: XCNVrTNihM
2018-02-28 23:15:31 +01:00
Emilio Cobos Álvarez
0ccb01c29e Bug 1440613: Flush pending media feature values changes before initializing the shell. r=dbaron
This is guaranteed not to run script because of:

  https://searchfox.org/mozilla-central/rev/47cb352984bac15c476dcd75f8360f902673cb98/layout/base/nsPresContext.cpp#2152

This doesn't have any effect on the top-level chrome window, but avoids a full
document restyle on XUL popups on startup.

With this patch, there are no more full document restyles due to media feature
changes on my machine on startup.

MozReview-Commit-ID: HLkhIsIIa2W
2018-02-23 11:51:18 +01:00
Matt Woodrow
4183152e2d Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas 2018-02-13 13:43:28 +13:00
Jonathan Kew
d9de89cb70 Bug 1439954 - Make gfxPlatform::ForceGlobalReflow when called in a content process trigger reflows only within that process; it should not try (and fail, with an assertion) to affect the parent or other content processes. r=jrmuizel 2018-02-22 20:55:36 +00:00
Dorel Luca
bd05e3853c Backed out 3 changesets (bug 1436904) for many crashes see bugs: 1440281, 1440302, 1440303, 1440313. a=backout
Backed out changeset 27f0762d4472 (bug 1436904)
Backed out changeset 27640f52e188 (bug 1436904)
Backed out changeset 2b4d117c27dc (bug 1436904)
2018-02-22 17:28:59 +02:00
Xidorn Quan
f66a5d4e41 Bug 1440141 part 1 - Move GeckoStyleContext::TakeRef to nsStyleContextInlines.h so that header doesn't depend on the Inlines.h. r=emilio
MozReview-Commit-ID: GdARP4HUAIY

--HG--
extra : rebase_source : 02ff6c6840f0989aa09c94022e42e0144fa4b5bc
2018-02-22 11:51:38 +11:00
Gurzau Raul
9a8d3f8191 Merge inbound to mozilla-central. a=merge 2018-02-21 18:46:07 +02: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
Emilio Cobos Álvarez
e6a341ed3b Bug 1439793: Remove unneeded nullcheck, and ifdef a debug-only loop. r=xidorn
We assert the same in nsCSSFrameConstructor::RecreateFramesForContent, which
asserts aContent.

MozReview-Commit-ID: 5r0ZjfTJ4zZ

--HG--
extra : rebase_source : dcf3ecaa2f7bd6fc8887f84d1f85018ebcae5cd3
2018-02-21 09:52:02 +01:00
Emilio Cobos Álvarez
e17b06c739 Bug 1439793: Handle correctly a reconstruct generated from additional style contexts. r=xidorn
Much like we do in nsIFrame::UpdateStyleOfOwnedChildFrame.

There's also the fact that ::-moz-math-anonymous shouldn't probably be
content-exposed... Oh well.

MozReview-Commit-ID: 8mthwW7Nivy

--HG--
extra : rebase_source : b772ca036ac3817d8e5f54b029892e9ece957d40
2018-02-21 09:32:53 +01:00
Emilio Cobos Álvarez
8b48a6c367 Bug 1439793: Simplify nsStyleChangeList::PopChangesForContent. r=xidorn
MozReview-Commit-ID: Hnd06USHP3N

--HG--
extra : rebase_source : 4cec54742007ccaa2fc4efb3ae0461321acc5899
2018-02-21 09:32:28 +01:00
Gurzau Raul
082f8e6d89 Merge inbound to mozilla-central. a=merge 2018-02-21 12:01:33 +02: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
Gurzau Raul
13030d55c1 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-02-21 12:06:01 +02:00
Matt Woodrow
e485bba27f Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas 2018-02-13 13:43:28 +13:00
Jonathan Kew
cb40096278 Bug 1439629 - When collecting used-fontFace information, skip textframes where IsVisible() is currently false. r=dholbert 2018-02-20 20:46:51 +00:00