Commit Graph

16176 Commits

Author SHA1 Message Date
Ting-Yu Lin
44b91cdf58 Bug 1548118 Part 4 - Always mark inner ColumnSetWrapper's children dirty before reflowing it if the outer ColumnSetWrapper is balancing. r=dbaron
ColumnSetFrame always tries to reflow column content regardless of it's
dirtiness. Making ColumnSetWrapperFrame's children dirty can have the
same effect.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 03:12:18 +00:00
Ting-Yu Lin
c52b56e4f0 Bug 1548118 Part 2 - Extract computing column balancing depth logic to a function. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D29434

--HG--
extra : moz-landing-system : lando
2019-05-08 03:12:05 +00:00
Ting-Yu Lin
1582e78c5d Bug 1548118 Part 1 - Advance the column count at the end of the while loop. r=dbaron
We use `columnCount == aConfig.mBalanceColCount - 1` in other places to
determine if we are at the last column. Advancing the column count at
the end of the loop make the condition consistent.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 03:09:19 +00:00
Alexis Beingessner
0feadff33f Bug 1545768 - Re-enable good text bounds for webrender. r=kats
This just reverts commit 580a7e38c60491123f3e7bba82904008ab0262d1.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 11:20:34 +00:00
Jonathan Kew
6ca164fa73 Bug 1507744 - Respect word-break value set on an inline element. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D30174

--HG--
extra : moz-landing-system : lando
2019-05-07 09:47:52 +00:00
Botond Ballo
5101ae966a Bug 1516722 - Don't let ScrollToVisual clobber further layout scrolling in the same transaction. r=kats
Test coverage for this is provided in the web platform test
html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 03:03:56 +00:00
arthur.iakab
e044816b6c Backed out 3 changesets (bug 1548118) for causing reftest failures on column-balancing-nested-001.html CLOSED TREE
Backed out changeset 516cc2c504f5 (bug 1548118)
Backed out changeset 40a074be8bf0 (bug 1548118)
Backed out changeset f3821529e276 (bug 1548118)
2019-05-07 05:41:24 +03:00
Ting-Yu Lin
0c3d6cd3a5 Bug 1548118 Part 3 - Always mark inner ColumnSetWrapper's children dirty before reflowing it if the outer ColumnSetWrapper is balancing. r=dbaron
ColumnSetFrame always tries to reflow column content regardless of it's
dirtiness. Making ColumnSetWrapperFrame's children dirty can have the
same effect.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 23:09:35 +00:00
Ting-Yu Lin
7c9e81378c Bug 1548118 Part 2 - Extract computing column balancing depth logic to a function. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D29434

--HG--
extra : moz-landing-system : lando
2019-05-03 19:25:57 +00:00
Ting-Yu Lin
1719001748 Bug 1548118 Part 1 - Advance the column count at the end of the while loop. r=dbaron
We use `columnCount == aConfig.mBalanceColCount - 1` in other places to
determine if we are at the last column. Advancing the column count at
the end of the loop make the condition consistent.

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

--HG--
extra : moz-landing-system : lando
2019-05-03 19:24:03 +00:00
Matt Woodrow
e78cff4176 Bug 1548483 - Don't assert that we have an invalidated frame when we encouter a new displayport, since it can have changed on an earlier paint if we didn't have display items. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D29975

--HG--
extra : moz-landing-system : lando
2019-05-06 09:13:00 +00:00
Kartikaya Gupta
c739ca6793 Bug 1062609 - Make scroll-behaviour test work with APZ enabled. r=botond
The test itself is reasonable, except that it reads scroll positions
from the main thread. With APZ enabled we need to flush any pending APZ
repaints before reading these scroll positions. So changing the
waitForAllPaints to the APZ-flushing variant makes that happen, and the
test passes.

Depends on D29921

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

--HG--
extra : moz-landing-system : lando
2019-05-06 17:50:14 +00:00
Miko Mynttinen
4818bf20d6 Bug 1546955 - Part 2: Make all display item constructors take nsDisplayListBuilder and frame as the first two parameters r=mattwoodrow
Depends on D28844

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

--HG--
extra : moz-landing-system : lando
2019-05-05 21:45:31 +00:00
Masayuki Nakano
780b285e68 Bug 1543315 - part 15: Mark PresShell::ScrollFrameRectIntoView() as MOZ_CAN_RUN_SCRIPT r=smaug
Unfortunately, `EventChainVisitor` does not grab the `nsPresContext` with
`RefPtr` by itself.  Therefore, there is no guarantee of the lifetime without
checking the origin when its subclasses are instantiated.  This patch changes
it and subclasses to `MOZ_STACK_CLASS` since only `EventDispatcher::Dispatch()`
creates them in the stack with given `nsPresContext`.  Additionally, it's
already been marked as MOZ_CAN_RUN_SCRIPT_BOUNDARY`.  Therefore, the
`nsPresContext` instance has already been guaranteed its lifetime by the
caller.  For making this fact stronger, this patch marks their constructors
as `MOZ_CAN_RUN_SCRIPT`.  Therefore, nobody can create those instances without
guaranteeing the lifetime of `nsPresContext` and `dom::Event`.  Note that
it may look like that `mPresContext` of `EventChainPostVisitor` is not
guaranteed.  However, `EventChainPreVisitor` which gives `nsPresContext` to it
is also a stack only class.  So, it won't be deleted before
`EventChainPostVisitor` instance.

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

--HG--
extra : moz-landing-system : lando
2019-05-06 13:57:46 +00:00
Ting-Yu Lin
7a98dbcd3e Bug 1548673 Part 3 - Rename nsBlockFrame's mPrefWidth to mCachedPrefISize. r=jfkthame
Like Part 2, I choose mCachedPrefISize because grid and flex container
are using it.

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

--HG--
extra : moz-landing-system : lando
2019-05-03 17:34:55 +00:00
Ting-Yu Lin
050bf09694 Bug 1548673 Part 2 - Rename nsBlockFrame's mMinWidth to mCachedMinISize. r=jfkthame
Instead of renaming it to mMinISize, I choose mCachedMinISize because
both grid and flex container frames use mCachedMinISize for similar
purpose.

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

--HG--
extra : moz-landing-system : lando
2019-05-03 17:34:46 +00:00
Ting-Yu Lin
63457d2b61 Bug 1548673 Part 1 - Rename NS_INTRINSIC_WIDTH_UNKNOWN to NS_INTRINSIC_ISIZE_UNKNOWN. r=jfkthame
This patch is generated by running the following script under layout/,
and then manually delete the FIXME comment in LayoutConstants.h

  #!/bin/bash
  function rename() {
      find .\
           -type f\
           ! -path "./obj*"\
           ! -path "./.git"\
           ! -path "./.hg"\
           \( -name "*.cpp" -or\
              -name "*.h" \)\
              -exec sed -i -e "s/$1/$2/g" "{}" \;
  }
  rename NS_INTRINSIC_WIDTH_UNKNOWN NS_INTRINSIC_ISIZE_UNKNOWN

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

--HG--
extra : moz-landing-system : lando
2019-05-03 17:34:36 +00:00
Emilio Cobos Álvarez
eced12d735 Bug 1548809 - Don't paint outlines for empty fragments of IB-splits. r=mats
Added a test to test the empty block (didn't submit to WPT because it's not
clear to me if the outlines of the two spans should form a single rect or not).

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

--HG--
extra : moz-landing-system : lando
2019-05-03 13:31:34 +00:00
Emilio Cobos Álvarez
b3863ed908 Bug 1547792 - AspectRatio should be a single ratio, not a size. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29244

--HG--
extra : moz-landing-system : lando
2019-05-02 23:28:21 +00:00
Masayuki Nakano
c842b7b133 Bug 253889 - part 4: Finally, get rid of nsIPresShell r=emilio
And also this cleans up some legacy comments of PresShell users.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 02:28:59 +00:00
Masayuki Nakano
1c74a4dc50 Bug 253889 - part 2: Move all methods and public structs of nsIPresShell into mozilla::PresShell r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29311

--HG--
extra : moz-landing-system : lando
2019-05-01 02:27:53 +00:00
Noemi Erli
f1ef21cbc7 Backed out changeset 8c89fd37b79d (bug 1544242) for failures in browser_rules_shadowdom_slot_rules.js CLOSED TREE 2019-05-01 22:03:06 +03:00
Emilio Cobos Álvarez
fb5b637f4f Bug 1544242 - Fix selector-matching for nested pseudo-elements. r=heycam,mats
We always include the combinator for pseudo-elements now (not including it was
just an optimization) in order to not match when nested pseudo-elements are
involved.

We could add a more generic check in `matches_simple_selector` like:

```
if element.is_pseudo_element() {
    match *selector {
        Component::PseudoElement(..) |
        Component::NonTSPseudoClass(..) => {},
        _ => return false,
    }
}
```

But even that wouldn't be enough to make selectors like `:hover::marker` not
match on the `::before::marker` pseudo-element, plus that code is really hot.

So for now do the check on the `next_element_for_combinator` function. It's a
bit hacky but it's the best I could came up with...

While at it, simplify some checks to use is_pseudo_element() instead of
implemented_pseudo_element() directly.

Only the Rust patch as-is would make markers for ::before and ::after on list
items not show up, so we also need to switch ::marker to use ProbeMarkerStyle()
rather than ProbePseudoElementStyle(), since the marker should exist even if it
matches no rules.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 17:19:08 +00:00
Andreea Pavel
4fea4aeb28 Merge mozilla-central to autoland. on a CLOSED TREE 2019-05-01 19:05:19 +03:00
Andreea Pavel
accc389b66 Merge mozilla-inbound to mozilla-central. a=merge 2019-05-01 18:56:07 +03:00
Sylvestre Ledru
e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Matt Woodrow
3fc4716479 Bug 1535945 - Don't skip invalidating frames when creating displayports for async scrollable ancestors. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D23816

--HG--
extra : moz-landing-system : lando
2019-05-01 04:23:07 +00:00
Emilio Cobos Álvarez
edde08a7cb Bug 1547985 - Use rust types for vertical-align. r=mats
The previous commit removed the dependence on the discriminant value, so we
don't need to keep discriminants different from text-align anymore.

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

--HG--
extra : moz-landing-system : lando
2019-05-01 13:08:34 +00:00
Masayuki Nakano
c2709a0087 Bug 1547535 - Move all a11y code in nsIPresShell to mozilla::PresShell r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D29196

--HG--
extra : moz-landing-system : lando
2019-04-30 07:53:20 +00:00
Masayuki Nakano
36e5df54ec Bug 1547621 - Move all inline methods of nsIPresShell into mozilla::PresShell r=smaug
And also this patch moves some related methods which use the inline methods
and member variables used only by them.

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

--HG--
rename : layout/base/nsIPresShellInlines.h => layout/base/PresShellInlines.h
extra : moz-landing-system : lando
2019-04-30 01:52:53 +00:00
Masayuki Nakano
2f69dfdd5d Bug 1547536 - Make PresShell QI-able for aware of do_QueryReferent() r=smaug
There is the following usage of nsIPresShell:
```
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShellWeak);
```

So, for changing this to:
```
RefPtr<PresShell> presShell = do_QueryReferent(mPresShellWeak);
```

PresShell should have its own IID.

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

--HG--
extra : moz-landing-system : lando
2019-04-30 00:56:14 +00:00
Masayuki Nakano
f3bcf4c6d1 Bug 1547418 - Make CapturingContentInfo a private struct of PresShell and move APIs for it from nsIPresShell to PresShell r=smaug
`CapturingContentInfo` struct is used only in `PresShell.cpp` so that we can
make it a private struct of `PresShell` if we move all users of them,
i.e., API to access them, from `nsIPresShell` to `PresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-30 00:26:57 +00:00
Masayuki Nakano
bad5d5bfe9 Bug 1547416 - Move nsIPresShell::ScrollAxis to PresShellForwards.h r=smaug
`nsIPresShell::ScrollAxis` can be used anywhere and it's used by some
utils actually. So, it should be in `mozilla` namespace and perhaps,
 `PresShellForwards.h` is a good place to move it rather than creating
new header file.

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

--HG--
extra : moz-landing-system : lando
2019-04-30 00:07:49 +00:00
Daniel Holbert
0a3e6713c9 Bug 1546499: Downgrade nsVideoFrame's unexpected-child assertion. r=xidorn
Also, make the assertion shorter & more to the point. In particular,
I'm removing the note about stray whitespace, which is based on one
previous scenario that caused extra child frames; but I don't have
much confidence that potential future causes of this assertion-failure
will have that specific problem as their root cause.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 20:28:52 +00:00
Sylvestre Ledru
96da5036ad Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-28 09:30:05 +00:00
Ting-Yu Lin
c6cc9b8157 Bug 1547261 - Fix a typo in GetIntrinsicImageSize(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29077

--HG--
extra : moz-landing-system : lando
2019-04-27 09:07:44 +00:00
Daniel Holbert
842b893fe3 Bug 1544121: Make size-contained replaced elements behave as if they had 0x0 intrinsic size and ratio. r=TYLin
Spec quote from https://drafts.csswg.org/css-contain/#containment-size :
"Replaced elements must be treated as having an intrinsic width and height of 0"

To achieve that, we just need to:
 (a) make all of these frame classes' GetPrefISize and GetMinISize methods return 0 if they're styled with contain:size.
 (b) make all of these frame classes' GetIntrinsicSize() and GetIntrinsicRatio() methods return 0,0.

In some cases, these methods are implemented in terms of common helper methods
(and sometimes member variables). For those cases, this patch adjusts the
helper methods (and variables) rather than the getters themselves.

Also: in one case (nsHTMLCanvasFrame), I needed to update its ComputeSize
method to remove a dependency on the "real" intrinsic size & ratio. I believe
the other classes' ComputeSize implementations do the right thing automatically
by sharing code & data with their intrinsic-size codepaths.

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

--HG--
rename : testing/web-platform/tests/media/white.webm => testing/web-platform/tests/css/css-contain/support/white.webm
extra : moz-landing-system : lando
2019-04-26 00:18:32 +00:00
Jonathan Kew
cf7e9d4dd1 Bug 1546985 - Use JoinStyle::ROUND when stroking glyph outlines, to avoid artifacts at sharp corners. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D28855

--HG--
extra : moz-landing-system : lando
2019-04-26 15:21:19 +00:00
Emilio Cobos Álvarez
fcded20df5 Bug 1547138 - followup: Let the compiler generate more IntrinsicSize functions as suggested by TYLin. 2019-04-26 02:18:42 +02:00
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
Emilio Cobos Álvarez
6159d9a874 Bug 1546697 - Make BaselineSharingGroup an enum class. r=dholbert
It looked a bit weird when mixed up with the other enum classes I'm about to
rename.

Depends on D28679

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

--HG--
extra : moz-landing-system : lando
2019-04-25 22:42:13 +00:00
Emilio Cobos Álvarez
3e1e7ce302 Bug 1547138 - IntrinsicSize shouldn't use nsStyleCoord. r=dholbert
We have a better type to represent "a coord or nothing", and that's Maybe.

This code is shorter, and I think reads generally better / is less easy to
misuse.

I wrote this on top of bug 1547126 so there shouldn't be conflicts.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 23:48:14 +00:00
Daniel Holbert
26a606eda1 Bug 1547126: Give nsIFrame::IntrinsicSize a convenience constructor that takes nscoord-valued width and height. r=TYLin
This patch shouldn't affect behavior; it's just simplifying existing code with
a new convenience constructor.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 23:44:53 +00:00
Hiroyuki Ikezoe
db7bfb0117 Bug 1546835 - Adjust start position of the target element as scroll offset in the scroll element. r=jfkthame
Depends on D28755

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

--HG--
extra : moz-landing-system : lando
2019-04-25 12:54:11 +00:00
Dorel Luca
00afc0acfa Backed out changeset bd68b6dfd83e (bug 1546985) for Reftest failures. CLOSED TREE 2019-04-26 01:13:56 +03:00
Jonathan Kew
d877c4bb12 Bug 1546985 - Use JoinStyle::ROUND when stroking glyph outlines, to avoid artifacts at sharp corners. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D28855

--HG--
extra : moz-landing-system : lando
2019-04-25 17:34:52 +00:00
Masayuki Nakano
2933c032e7 Bug 1545342 - part 3: Move remaining public enum of nsIPresShell to mozilla namespace in mozilla/PresShellForwards.h and make them enum class r=smaug
This patch moves remaining public `enum` of `nsIPresShell` to `mozilla`
namespace in `mozilla/PresShellForwards.h` and make them `enum class`es.

Additionally, some methods which use the moving `enum`s from `nsIPresShell`
to `PresShell`.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 05:04:23 +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
Ting-Yu Lin
ee1f1f5d22 Bug 1546223 Part 5 - Change ReflowInput::InitConstraints() to use Maybe for containing block size. r=dholbert
There are some minor behavior changes come with this.

1) Change the default containing block size to (NS_UNCONSTRAINEDSIZE,
   NS_UNCONSTRAINEDSIZE). I think this is more reasonable than (-1, -1).

2) mContainingBlockSize is used to cache only the block size passing
   though constructor, Init(), or the invalid (-1, -1). This patch makes
   it cache the value computed by ComputeContainingBlockRectangle().

   Note that mContainingBlockSize is used only in
   nsTableWrapperFrame::InitChildReflowInput() to set the inner table
   frame's containing block to be the same as the outer table frame's.
   We don't change this behavior by caching more. Because even if the
   inner frame use the invalid cached (-1, -1) containing block size
   from the outer reflow input, it still computes the block size again
   in InitConstraints(). (Inner table's cb is the same as the outer
   table's per InitCBReflowInput().)

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

--HG--
extra : moz-landing-system : lando
2019-04-24 22:23:59 +00:00