Commit Graph

2740 Commits

Author SHA1 Message Date
shindli
03600438ed Merge inbound to mozilla-central. a=merge 2018-03-30 12:56:21 +03:00
Matt Woodrow
c6c8303663 Bug 1443027 - Fix the merging algorithm to pass the new tests correctly. r=mstange
MozReview-Commit-ID: JnglCbdhZzE
* * *
[mq]: update-test

MozReview-Commit-ID: JMIzrnVeSTo
2018-03-23 16:47:37 +13:00
Ciure Andrei
fe2267c2c5 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-03-30 01:11:06 +03:00
Daniel Holbert
2046f84547 Bug 1436881: Remove redundant special-case code for treating flex-basis enum values as 'auto' in vertical axis. r=mats
This patch should not affect behavior.

Logic-wise: the idea behind this patch is to behave as if the
'usingFlexBasisForHeight' variable were always false, which in turn lets us
remove an "if (!usingFlexBasisForHeight || ...)" check, because it trivially
passes when that bool is false.

Background on this special case & why we can remove it:
=======================================================
In the original flexbox implementation, we had some special-case code to be
sure we didn't end up swapping in e.g. "flex-basis:-moz-min-content" for
"height" in these ComputeSize functions, because that was a scenario that
previously would've been prevented at the parser level (height:-moz-min-content
is rejected for now), and hence may not have ended up being handled robustly.

However, nowadays it'll be handled just fine in these functions, and will
produce the same result as our special-case exception tries to achieve.

In particular, for a nsFrame that is a flex item in a flex container with a
vertical main axis (the scenario that these special cases are catching):

 - If the (vertical) main axis is this nsFrame's inline axis (i.e. if this
   nsFrame has a vertical writing-mode), then Stylo actually converts
   enumerated flex-basis values like "-moz-min-content" to "auto" when
   producing the computed values that layout sees.  So it's not actually
   possible for layout to see a computed "flex-basis" of -moz-min-content, in
   that scenario.

 - Otherwise, i.e. if the (vertical) main axis is this nsFrame's block axis,
   then these ComputeSize functions will now end up getting an enumerated
   "blockStyleCoord" (really pointing to flexBasis), but that'll still end up
   being treated like 'auto'. This happens by virtue of ComputeSize's calls to
   ComputeAutoSize (which initializes the tentative bsize value to
   NS_UNCONSTRAINEDSIZE) and to nsLayoutUtils::IsAutoBSize (which returns
   "true" for eStyleUnit_Enumerated values and then makes us leave the
   ComputeAutoSize result unperturbed).
2018-03-29 11:46:27 -07:00
Emilio Cobos Álvarez
3cf86a54cf Bug 1449010: Respect ::selection background styles for image overlays. r=mattwoodrow
I don't have a strong preference about blending with white vs. just doing alpha
0.5, so I kept doing what we were doing, since Blink and WebKit also apply the
blending to the text background, and I'm not sure that's particularly desirable.

MozReview-Commit-ID: AwYtAgdlcxj
2018-03-29 02:53:02 +02:00
Emilio Cobos Álvarez
941948acb7 Bug 1449010: Some minor cleanup in selection-related code. r=matwoodrow
MozReview-Commit-ID: AAhHZmOBc3Z
2018-03-29 02:53:01 +02:00
Gurzau Raul
ffbc52ee86 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-03-29 01:00:42 +03:00
Jonathan Kew
df1402e562 Bug 1449157 - Guard against mContent being null in nsFrame::HandlePress. r=dholbert 2018-03-28 14:42:20 +01:00
Cosmin Sabou
bc201526a4 Backed out 3 changesets (bug 1449321, bug 1449566, bug 1449565) as per developer request.
Backed out changeset c31de7e26809 (bug 1449565)
Backed out changeset 72f9188800af (bug 1449566)
Backed out changeset 763277b299e4 (bug 1449321)
2018-03-28 18:10:11 +03:00
Jonathan Watt
0d59536e73 Bug 1449321 - Remove the IsServo and IsGecko methods from the style system code. r=emilio 2018-03-23 16:01:34 +00:00
Jonathan Watt
44d37e68d5 Bug 1449321 - Remove the IsServo and IsGecko methods from the style system code. r=emilio 2018-03-23 16:01:34 +00:00
Xidorn Quan
99b3d4120a Bug 1448728 part 1 - Make popular headers not include nsWindowSizes.h. r=njn
MozReview-Commit-ID: EC5J9Im3gfu
2018-03-28 10:44:49 +11:00
Henri Sivonen
a21b99cbd0 Bug 1448590 - Avoid useless use of SIMD-accelerated Latin1 to UTF-16 conversion in layout. r=dbaron.
MozReview-Commit-ID: Inm13Jw2t31
2018-03-24 21:31:19 +02:00
Daniel Holbert
cc46d0d0be Bug 1449838 part 2: Morph 'usingFlexBasisForISize' variable in nsFrame::ComputeSize* methods, to better reflect reality. r=mats
This patch doesn't affect behavior; it just adjusts a variable for clarity.

Really, this variable tracks which axis (inline vs. block) is the main axis (if
we're a flex item). So, this patch morphs the variable to more directly track
that.

The variable's old name 'usingFlexBasisForISize' was confusing, because even
when it was set to 'true', we might not *really* be using the flex-basis in
place of the ISize property. In particular: when we have 'flex-basis:auto', we
don't use 'flex-basis' in place of the ISize/BSize property -- rather, that
indicates that 'flex-basis' is *deferring* to the main-axis size property.

Hopefully the new name/type makes it clearer what we're actually tracking.

MozReview-Commit-ID: ITkb4zuEwgQ
2018-03-29 14:49:40 -07:00
Daniel Holbert
bf58e2eec5 Bug 1449838 part 1: Add utility function nsFlexContainerFrame::IsItemInlineAxisMainAxis(). r=mats
This patch doesn't affect behavior - it's just refactoring / de-duplicating.

(The refactored function does include some new "legacy box" code, just for
completeness & to ensure that the included assertion passes.  But beyond the
assertion, that new code isn't exercised right now -- this function's only
callsites are skipped if the NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX state-bit is
set on the container. Hence, this patch still doesn't affect behavior, even
though it's adding some new logic in the refactored-out function.)

MozReview-Commit-ID: G5aCzwTwkTa
2018-03-29 14:49:28 -07:00
Jeff Muizelaar
e93159c4c0 Bug 1450134. Replace ToRelativeLayoutRect() with ToRoundedLayoutRect(). r=kats
This function doesn't use any StackingContextHelper state anymore.
We should make what it does clearer and move it to a better place.
2018-03-29 17:57:43 -04:00
Ryan VanderMeulen
83a96dc38a Merge m-c to autoland. a=merge 2018-03-26 09:19:29 -04:00
Ryan VanderMeulen
11e8f52ae7 Backed out changesets d9f154931d6d and 90e564873aa1 (bug 1443027) for causing Nightly topcrash bug 1448841. 2018-03-26 09:13:54 -04:00
Emilio Cobos Álvarez
fb9a0faf99 Bug 1448559: Cleanup CalcStyleDifference. r=xidorn
The aSamePointerStructs argument is unused now.

Also, aIgnoreVariables can be true everywhere now, since variable changes can't
generate change hints, and anonymous boxes and such don't care about whether
they really changed or not.

Only one caller cares about struct equality, and that already compares variables
manually as an optimization on the rust side.

We had this optimization inconsistently in some cases but not others.

MozReview-Commit-ID: F2EISKlxR3K
2018-03-26 09:47:33 +02:00
Matt Woodrow
a5c39f77af Bug 1443027 - Fix the merging algorithm to pass the new tests correctly. r=mstange
MozReview-Commit-ID: JnglCbdhZzE
* * *
[mq]: update-test

MozReview-Commit-ID: JMIzrnVeSTo
2018-03-23 16:47:37 +13:00
Jonathan Watt
a30a336781 Bug 1448337 - Remove RuleNodeCacheConditions.h. r=emilio 2018-03-25 20:43:47 +02:00
Narcis Beleuzu
2764b805dc Backed out 2 changesets (bug 1448294, bug 1448337) for wpt and reftest failures on /mathml
Backed out changeset 180051cfe357 (bug 1448294)
Backed out changeset c188176f3289 (bug 1448337)
2018-03-25 21:31:08 +03:00
Emilio Cobos Álvarez
0b3a18a950 Bug 1448413: Do a bit of misc cleanup. r=jwatt
Summary: Mostly removing unneeded AsServo() and such.

Reviewers: jwatt

Bug #: 1448413

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

MozReview-Commit-ID: 8muHF7uMA53
2018-03-25 18:14:36 +02:00
Jonathan Watt
0b904e9bb7 Bug 1448337 - Remove RuleNodeCacheConditions.h. r=emilio 2018-03-22 08:44:07 +00:00
Xidorn Quan
04dfe2b263 Bug 1448557 - Crash when GECKO_DISPLAY_REFLOW_RULES_FILE points to a file cannot be open. r=dbaron
MozReview-Commit-ID: CRLF2UwhKbq
2018-03-25 00:53:33 +11:00
Xidorn Quan
4c17d886cb Bug 1448551 - Fix reported intrinsic size in reflow log of some frames. r=dbaron
MozReview-Commit-ID: 4jcrurjqGgu
2018-03-25 00:17:33 +11:00
Noemi Erli
3472f3c066 Merge inbound to mozilla-central. a=merge 2018-03-23 00:53:07 +02:00
Emilio Cobos Álvarez
1d4859a89a Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez
97286b35c8 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez
1f5d8de5cc Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Julian Seward
0e927f4eb0 Bug 1447405 - Valgrind cries at nsFrame::ComputeSize in stylo-only builds. r=emilio.
In nsFrame::ComputeSize and nsFrame::ComputeSizeWithIntrinsicDimensions, the
following expressions

  isFlexItem && usingFlexBasisForISize
  isFlexItem && !usingFlexBasisForISize

are sometimes compiled by recent gcc/clang in the opposite order, viz
[!]usingFlexBasisForISize && isFlexItem.  In this case the transformation is
correct as can be seen by analysing code earlier in these functions.
Unfortunately this causes Valgrind/Memcheck to report a branch on undefined
data which, in this case, is a false positive.

A simple fix is simply to initialise usingFlexBasisForISize to false at its
declaration point.
2018-03-13 07:37:25 +01:00
Boris Zbarsky
152cd3ba6e Bug 1447098 part 1. Rename FromContent on various DOM classes to FromNode. r=mystor
MozReview-Commit-ID: 202nkbmkwfR
2018-03-21 17:39:04 -04:00
arthur.iakab
6e006c34b4 Merge inbound to mozilla-central. a=merge 2018-03-21 21:13:11 +02:00
Miko Mynttinen
86800aa3f1 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz
2018-03-13 14:51:33 +01:00
Emilio Cobos Álvarez
b1a35fbef7 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
Miko Mynttinen
0a03b7a6d2 Bug 1441796 - Part 3: Reuse the results in nsIFrame::BuildDisplayListForStackingContext() for ChildrenHavePerspective(), IsTransformed(), and Combines3DTransformWithAncestors() r=mattwoodrow
MozReview-Commit-ID: J2PtZDMbHh2
2018-03-27 14:18:27 +02:00
Miko Mynttinen
b12e685556 Bug 1441796 - Part 2: Undo changes from bug 1416991 r=mattwoodrow
MozReview-Commit-ID: HwnAdk8sG1w
2018-03-27 12:21:38 +02:00
Miko Mynttinen
ae8f90a8b6 Bug 1441796 - Part 1: Optimize the (pseudo)-stacking context conditions r=mattwoodrow
MozReview-Commit-ID: JOFv9yK2zLD
2018-03-26 20:06:29 +02:00
Jeff Muizelaar
3370a80065 Bug 1439006. Allow multiple kinds of WebRenderUserData on a DisplayItem. r=mstange
Currently we can only have one type of WebRenderUserData on an Item. We already
have a hash table of WebRenderUserData so it's not hard to include type in the
hash to support one per type.

MozReview-Commit-ID: geJ0BeWv8b
2018-03-16 19:15:27 -04:00
Miko Mynttinen
ca5975e857 Bug 1443518 - Fix incorrect CompositorHitTestInfo ordering for inline lines r=mattwoodrow
MozReview-Commit-ID: D7yLNHQN3z0
2018-03-09 11:48:07 +01:00
Sylvestre Ledru
648d523abd Bug 1444852 - nsIFrame::BuildDisplayListForChild Remove the init step as the result is unused r=miko
MozReview-Commit-ID: G07Fwu1aw0M
2018-03-12 12:28:00 +01:00
Emilio Cobos Álvarez
367a73df8a 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
0f7c4f5d20 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
Chris Peterson
20b28f1d54 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
2018-02-22 21:03:45 -08:00
Hiroyuki Ikezoe
18371a6ec0 Bug 1428693 - Use GetOverflowAreasRelativeToSelf() instead of GetOverflowAreas() for scrollable parent. r=mattwoodrow
Because the scrollable parent might be transformed by its ancestors.

MozReview-Commit-ID: FuCPLg54z7h
2018-03-05 07:55:32 +09:00
Nathan Froyd
805f230b74 Bug 1442245 - remove some obviously dead code from nsFrame.cpp; r=dholbert
This code has been there for over a decade, almost two.  We have moved on.
2018-03-01 12:03:01 -05:00
Matt Woodrow
aefb380ec7 Bug 1436510 - Don't attempt partial display list building within perspective as we need to build all children to get consistent indices. r=miko 2018-03-01 16:53:58 +13:00
Emilio Cobos Álvarez
7a79ccba52 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
2018-02-27 15:30:27 +01:00
Matt Woodrow
6f1864699b Bug 1436904 - Part 1: Add a static constructor function for display items. r=Bas 2018-02-13 13:43:28 +13:00
Dorel Luca
3276af0faa 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