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

16157 Коммитов

Автор SHA1 Сообщение Дата
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
Ting-Yu Lin 49cfcc232c Bug 1546223 Part 4 - Mechanically replace pointer with Maybe for ReflowInput's optional containing block size. r=dholbert
There's no behavior change in this patch.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 17:35:31 +00:00
Ting-Yu Lin ee7ae91e94 Bug 1546223 Part 3 - Use in-class member initializer for some of the member variables. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D28438

--HG--
extra : moz-landing-system : lando
2019-04-24 17:35:31 +00:00
Ting-Yu Lin 77038b9a3a Bug 1546223 Part 2 - Use in-class member initializer for those which were in constructor body. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D28428

--HG--
extra : moz-landing-system : lando
2019-04-24 00:20:05 +00:00
Ting-Yu Lin 328026b148 Bug 1546223 Part 1 - Use in-class member initializer for those which were in initializer list. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D28427

--HG--
extra : moz-landing-system : lando
2019-04-24 17:35:05 +00:00
Ting-Yu Lin a3bbe609b6 Bug 1546223 Part 0 - Remove unused NOISY_VERTICAL_ALIGN. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D28429

--HG--
extra : moz-landing-system : lando
2019-04-24 17:35:05 +00:00
Hiroyuki Ikezoe 47d31247b1 Bug 1546057 - Use the clamped destination position for overflow checks. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D28578

--HG--
extra : moz-landing-system : lando
2019-04-24 21:56:26 +00:00
Brindusan Cristian b3b1ca15aa Merge mozilla-central to autoland. a=merge CLOSED TREE
--HG--
rename : dom/ipc/TabChild.cpp => dom/ipc/BrowserChild.cpp
rename : dom/ipc/TabParent.cpp => dom/ipc/BrowserParent.cpp
rename : dom/ipc/TabParent.h => dom/ipc/BrowserParent.h
2019-04-25 01:43:17 +03:00
Brindusan Cristian f92b05e5f0 Merge inbound to mozilla-central. a=merge
--HG--
rename : dom/ipc/TabParent.cpp => dom/ipc/BrowserParent.cpp
2019-04-25 00:54:01 +03:00
Emilio Cobos Álvarez 761f6c8751 Bug 1546739 - Fix detection of intrinsic size dependence of images. r=dholbert
Fixed width and height is not a strong enough condition.

min/max-width with intrinsic size keywords makes the final size of the image
also depend on the intrinsic size. Don't optimize away reflows when the
intrinsic size changes if they're used.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 20:05:34 +00:00
Jeremy Chen e67424a97d Bug 1283222 - Do not record soft break opportunities for out-of-flow frames. r=emilio
We do want to record soft break opportunity after a frame whose content can't
be part of the existing in-flow text run, since this normally should be a text run
boundary. However, though an out-of-flow frame can't be part of the existing
in-flow text run, it also doesn't break it either. In fact, the texts after the
out-of-flow frames are able to continue the existing in-flow text run. So,
introducing a line-break-after opportunity in this case may cause an unexpected
line break for every out-of-flow frame.

In this patch, we add a condition to prevent us from recording soft break
opportunities for out-of-flow frames.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 14:04:23 +00:00
Cosmin Sabou 5d756e5a09 Backed out 2 changesets (bug 1283222) for build bustages on nsLineLayout. CLOSED TREE
Backed out changeset fb82d1aa97d0 (bug 1283222)
Backed out changeset 093bf5cadbcc (bug 1283222)
2019-04-24 15:50:59 +03:00
Jeremy Chen a547906720 Bug 1283222 - Do not record soft break opportunities for out-of-flow frames. r=emilio
We do want to record soft break opportunity after a frame whose content can't
be part of the existing in-flow text run, since this normally should be a text run
boundary. However, though an out-of-flow frame can't be part of the existing
in-flow text run, it also doesn't break it either. In fact, the texts after the
out-of-flow frames are able to continue the existing in-flow text run. So,
introducing a line-break-after opportunity in this case may cause an unexpected
line break for every out-of-flow frame.

In this patch, we add a condition to prevent us from recording soft break
opportunities for out-of-flow frames.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 12:25:25 +00:00
Daniel Holbert e6f89af496 Bug 1546210: Refactor nsHTMLCanvasFrame::ComputeSize to use existing helper functions and avoid redundant GetCanvasSize() call. r=TYLin
This patch should not affect behavior; the new implementation is
identical to the old one, but with better sharing of code.

Also: I'm removing the code-comment saying that the intrinsic ratio
is unused, because it's not really useful and it's unclear to me that
it's strictly true. There are several cases in the function we pass it
to, nsFrame::ComputeSizeWithIntrinsicDimensions, that use the ratio
and that look reachable as long as we have 'width:auto' in CSS.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 04:20:20 +00:00
sotaro 601b513435 Bug 1543621 - Move Y flip handling to AsyncImagePipelineManager::ApplyAsyncImageForPipeline() r=nical
With webrender, current gecko does not handle SurfaceTexture.getTransformMatrix() yet. SurfaceTexture is used for video decoding and WebGL. On both usages, when getTransformMatrix() is not handled, it actually worked as bottom left origin. Then gecko need to ignore y flip. AsyncImagePipelineManager::ApplyAsyncImageForPipeline() is a good place to handle the situations, since it handles canvas and video frame rendering. Long term solution is going to be handled by Bug 1507076.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 12:29:24 +00:00
Hiroyuki Ikezoe c29cf5f2aa Bug 1546038 - Include scroll-margin areas into snap area. r=botond
This patch also renames `targetRect` to `snapArea` to represent it more
accurately.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 03:58:57 +00:00
Hiroyuki Ikezoe 7356d7a696 Bug 1544198 - Use the proper frame to get scroll-snap-type value on the root element. r=botond
Now scroll-snap-type property on body element doesn't affect scroll position
so that scrollTo-scrollBy-snaps.html is needed to be modified to specify
scroll-snap-type on html.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 01:16:02 +00:00
Hiroyuki Ikezoe eb6519bbae Bug 1544198 - Split ScrolLFrameHelper::ComputeScrollSnapInto into two functions. r=botond
The one is for the scroll snap module v1 implementation, the other is for the
old scroll snap implementation.  Now both functions have the same pieces of
code to get scroll-snap-type values, but for v1 implemention in the next commit
we will use GetFrameForScrollSnap() to get the value instead.

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

--HG--
extra : moz-landing-system : lando
2019-04-23 01:12:38 +00:00
Hiroyuki Ikezoe 7b325b6485 Bug 1544198 - Factor out the function to get the frame for scroll-snap-type and scroll-padding. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D27985

--HG--
extra : moz-landing-system : lando
2019-04-23 01:12:24 +00:00
Hiroyuki Ikezoe dd202d6998 Bug 1544198 - Use the proper writing-mode for scroll-snap for viewport. r=jfkthame
In the CSS writing mode spec [1], the writing mode for the document should be
taken from body, GetFrameForDir() is the function to get the corresponding frame
for writing-mode.

A web platform test for this case will be added at the last of this commit
series.  Unfortunately as of this commit, we can't introduce proper test cases
since there is another issue on scroll-snap-type which will be fixed in
subsequent commits.

[1] https://drafts.csswg.org/css-writing-modes-4/#principal-flow

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

--HG--
extra : moz-landing-system : lando
2019-04-23 01:12:09 +00:00