Commit graph

241 commits

Author SHA1 Message Date
Boris Chiou
b9038da640 Bug 1681958 - Use eReplacedSizing to assert replaced elements for aspect-ratio. r=TYLin
It seems `eReplacedSizing` is much closer to the definition of replaced
elements (defined in [1]), and we override ComputeSize() for those
frames which are set eReplacedSizing or inline/table frames.

Perhaps we have to update the comments for the frame type bits later.

[1] https://html.spec.whatwg.org/multipage/rendering.html#replaced-elements

Differential Revision: https://phabricator.services.mozilla.com/D117372
2021-06-12 00:32:40 +00:00
Kagami Sascha Rosylight
55dbc99e55 Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 23:54:06 +00:00
Butkovits Atila
ed3da455ae Backed out 7 changesets (bug 1542807) for causing failures at inert-retargeting-iframe.tentative.html. CLOSED TREE
Backed out changeset e9ef32fa2f2e (bug 1542807)
Backed out changeset 8fa0cb199975 (bug 1542807)
Backed out changeset 38daf64afe59 (bug 1542807)
Backed out changeset e3aee052c495 (bug 1542807)
Backed out changeset a71056d4c7cc (bug 1542807)
Backed out changeset cf91e7d0a37f (bug 1542807)
Backed out changeset eee949e5fd67 (bug 1542807)
2021-06-12 01:38:25 +03:00
Butkovits Atila
53cb932555 Backed out changeset aa6c7477c4d2 (bug 1713491) for causing build bustages on nsIFrame.cpp. CLOSED TREE 2021-06-12 00:12:06 +03:00
Kagami Sascha Rosylight
9d0b659349 Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 18:53:28 +00:00
Mats Palmgren
1a3fc95ee3 Bug 1542807 part 2 - Remove (now unused) nsBulletFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D111692
2021-06-11 18:10:38 +00:00
Dorel Luca
e1f4d9bb38 Backed out changeset 17e7b969b830 (bug 1713491) for Linux build bustage in gecko/dom/events/ContentEventHandler.cpp. CLOSED TREE 2021-06-11 17:52:10 +03:00
Kagami Sascha Rosylight
74760a9a0e Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 11:37:11 +00:00
Marian-Vasile Laza
1710dd4296 Backed out changeset a722491ae6b3 (bug 1713491) on devs request
CLOSED TREE
2021-06-11 14:31:46 +03:00
Kagami Sascha Rosylight
2d398fce26 Bug 1713491 - Remove return type of nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117485
2021-06-11 10:59:12 +00:00
Boris Chiou
c0f286b1f5 Bug 1312588 - Part 5: Implement the intrinsic size contribution for fit-content(). r=TYLin,emilio
We simplified to just rely on the behavior of the plain argument. That is,
width: fit-content(50%) behaves the same as width: 50%; in all circumstances,
just clamped by min/max-content.

Note: for block axis, we treat fit-content() as initial value its minimal
and maximal value are identical and equal to the initial value in block axis.

From: https://github.com/w3c/csswg-drafts/issues/3731#issuecomment-661408877

Note: this patch doesn't include any update on flex and grid layout. We
may have to come back to check it.

Differential Revision: https://phabricator.services.mozilla.com/D113199
2021-06-08 05:05:51 +00:00
Boris Chiou
5c493e9341 Bug 1312588 - Part 3: Implement the layout part of fit-content() without the intrinsic contribution. r=emilio
This implements fit-content() for basic layout support. For intrinsic
contribution, we will do that in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D111506
2021-06-08 05:05:50 +00:00
Boris Chiou
b65c4b45ec Bug 1312588 - Part 2: Support fit-content() in style. r=emilio
Support fit-content for preferred size, min size, and max size. This
patch only implement the style system. For layout part, we will do that
in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D107161
2021-06-08 05:05:50 +00:00
Hiroyuki Ikezoe
9e52f5ce78 Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-26 00:17:39 +00:00
Butkovits Atila
202250ee59 Backed out 2 changesets (bug 1699890) for causing failures on background-color-animation-with-table2.html. CLOSED TREE
Backed out changeset 38bfba07a1ac (bug 1699890)
Backed out changeset 69826920340d (bug 1699890)
2021-05-25 15:30:01 +03:00
Hiroyuki Ikezoe
6b494767d9 Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-25 01:58:19 +00:00
Iulian Moraru
8887e460a5 Backed out changeset c5ce83934eac (bug 1699890) for causing dt assertion failures on nsDisplayList.h. CLOSED TREE 2021-05-21 14:25:37 +03:00
Hiroyuki Ikezoe
c8c37c4c3c Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-21 06:09:38 +00:00
Noemi Erli
15e72db6a4 Backed out changeset 1c7f2486a0e9 (bug 1699890) for causing multiple failures CLOSED TREE 2021-05-21 06:43:14 +03:00
Hiroyuki Ikezoe
7cceb18c82 Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-20 23:46:10 +00:00
Jonathan Kew
5e9a828adc Bug 1711064 - patch 1 - Add a pref to control whether linkifying Save-as-PDF output is enabled. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D115514
2021-05-20 08:25:44 +00:00
Jonathan Kew
d4614f8d3f Bug 454059 - Generate hyperlinks in PDF output for HTML link elements. r=mstange,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D114208
2021-05-11 17:00:30 +00:00
Miko Mynttinen
a1d3ef4a17 Bug 1709452 - Do not store display list building rect in frames with continuations r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D114290
2021-05-10 14:37:49 +00:00
Emilio Cobos Álvarez
c8aa59aaae Bug 1707170 - Will-change should only create stacking contexts / containing blocks / etc if the property it'd change would apply. r=miko
As per https://drafts.csswg.org/css-will-change/#will-change.

> If any non-initial value of a property would cause the element to
> generate a containing block for absolutely positioned elements,
> specifying that property in will-change must cause the element to
> generate a containing block for absolutely positioned elements.

But in this case the transform property wouldn't apply to the element so
there's no reason to create a stacking-context.

Differential Revision: https://phabricator.services.mozilla.com/D114121
2021-05-10 13:09:42 +00:00
Kagami Sascha Rosylight
84d84038b4 Bug 1623717 - Make sure selection offset remains within inline editing host r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107120
2021-04-13 23:02:41 +00:00
Boris Chiou
98ea39687f Bug 1690423 - Part 2: Unified auto block-size behavior with UseAutoBSize flag in nsIFrame::ComputeSize(). r=mats
For grid layout, we set UseAutoBSize flag during measuring reflow to
resolve the grid track sizing. We still have to respect aspect ratio
for the calculation of the content contribution.

Differential Revision: https://phabricator.services.mozilla.com/D104936
2021-04-12 21:06:55 +00:00
Boris Chiou
20211d237b Bug 1690423 - Part 1: Fix stretched grid items with aspect-ratio. r=mats
Based on https://drafts.csswg.org/css-grid/#grid-item-sizing, the grid
items should ignore aspect-ratio if it's stretched in that axis.
1. If the alignment value is stretch: don't apply aspect ratio.
2. If the alignment value is normal: apply aspect ratio if we have one.
3. Other values: apply aspect ratio if we have one.

Note:
We also clamp margin block min size in nsBlockFrame::ComputeFinalSize(), so
grid-aspect-ratio-021.html is still passed without this patch. However, we
add this test case just in case and let other browsers catch this.

Differential Revision: https://phabricator.services.mozilla.com/D105082
2021-04-12 21:06:55 +00:00
Cosmin Sabou
99c461b614 Backed out changeset d5b874ccd877 (bug 1526970) as requested by miko.
CLOSED TREE
2021-04-09 19:12:38 +03:00
Boris Chiou
9a8efaa32e Bug 1699468 - Pass StyleSizeOverrides into ComputeISizeValue(). r=TYLin
The inconsistent usage of block size and aspect ratio in ComputeSize() and
ComputeISizeValue() cause this assertion.

We use StyleSizeOverrides when measuring the content block sizes of flex
items, and the expected computed value of block size is auto.

And so in ComputeISizeValue(), we should use any field in StyleSizeOverrides
that having an override rather than fetching it from the style system.

Differential Revision: https://phabricator.services.mozilla.com/D111031
2021-04-07 23:55:38 +00:00
Boris Chiou
d1b5874cdb Bug 1702835 - Min/Max size transfers should work only when inline size is not specified. r=TYLin,emilio
We have to apply min/max transferred size if inline size is auto or intrinsic
size keywords.

The basic principle is that sizing constraints transfer through the
aspect-ratio to the other side to preserve the aspect ratio to the extent
that they can without violating any sizes specified explicitly on that
affected axis.

Note: block-aspect-ratio-021.html tests the similar case with the non-zero
content size. However we don't have the similar tests for intrinsic size
keywords, so I add them in this patch as well.

Differential Revision: https://phabricator.services.mozilla.com/D110725
2021-04-05 21:34:49 +00:00
Timothy Nikkel
6420ad52a1 Bug 1700535. Make textareas inline block by default. r=emilio
This matches Chrome and Safari, as well as what we do for all other <input>s.

<input>s were changed to inline block in 1539469 with a couple of font inflation reftests marked as failing to follow up on. https://hg.mozilla.org/mozilla-central/rev/a1201db1b8cc is the follow up which made inputs not be font inflation containers. The same change for textarea fixes similar reftest failures for textarea. I read through the commit message for the change and doing the same for textareas seems to make sense but I don't understand it in detail.

Differential Revision: https://phabricator.services.mozilla.com/D109603
2021-04-02 23:34:47 +00:00
Emilio Cobos Álvarez
e7d8e6bfae Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-02 12:21:25 +00:00
Bogdan Tara
be061ee475 Backed out changeset 96866f6d4543 (bug 1702216) for css-ui/outline-*, 375508-1.html, z-index-1.html failures CLOSED TREE 2021-04-02 04:43:22 +03:00
Emilio Cobos Álvarez
70c869cd11 Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-02 00:18:29 +00:00
Simon Giesecke
613e20d136 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Simon Giesecke
628cc55f22 Bug 708901 - Migrate to nsTHashSet in layout. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108597
2021-03-24 17:56:46 +00:00
Csoregi Natalia
f54ee076ae Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke
c73f87b72b Bug 708901 - Migrate to nsTHashSet in layout. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108597
2021-03-24 16:58:58 +00:00
Emilio Cobos Álvarez
5a6212f1ce Bug 1700478 - Make IsTransformed cheaper for non-transformed frames. r=longsonr
Remove a bit of the aStyleDisplay gunk that shouldn't be needed because
of two reasons:

 * Stylo is faster / has the style display one pointer-chase away, as
   opposed to the old style system.

 * We now check the MAY_BE_TRANSFORMED bit first now, and we deal with
   SVG-transformed frames, so for non-transformed frames IsTransformed
   should just be a bit-check now.

Differential Revision: https://phabricator.services.mozilla.com/D109511
2021-03-23 22:01:25 +00:00
Masayuki Nakano
2ad57f8fae Bug 1528289 - part 1: Move selection at middle button down rather than middle button up r=edgar
Chrome and Safari move selection at middle button down and does not modify the
range at middle button up.  However, they handle middle button down with
`Shift` key is "continue selection".  So, we should handle selection in
nsIFrame when `mousedown` event for middle mouse button is fired, but ignore
multiple selection, drag and drop and maintaining selection for aligning the
behavior to the other browsers.

This patch splits `nsIFrame::HandlePress()` and calls new method which
moves selection from `nsIFrame::HandleEvent()` when middle button is pressed.
(Note that this patch does not check whether middle click paste is enabled
because Chrome moves selection even on Windows which Chrome always disable
middle click paste on.)

With this change, "paste" event target is changed.  Previously, we used target
of the preceding `mouseup` event, but we start to use the target of the
preceding `mousedown` event.

Note that even with this patch, we still behave differently from Chrome even
in the following cases:
- middle mouse button down in selected range, we collapse it, but Chrome keeps
  the selection.
- middle mouse button click in selected range, we dispatch "paste" event, but
  Chrome collapse selection and not dispatch "paste" event.
- middle mouse button down in selected range and up in different element,
  Chrome does not modify the range nor dispatch "paste" event.
- Shift + middle mouse button in editable `<table>` works as non-editable
  in Chrome, but our editor handles it with special path.  Therefore, we
  don't modify the range but dispatch "paste" event in the selected range.

Changing them requires bigger change and probably requires some other features'
behavior changes.  Therefore, we shouldn't touch these issues until they are
actually reported as web-compat issues.

Differential Revision: https://phabricator.services.mozilla.com/D103997
2021-03-23 19:22:48 +00:00
Ting-Yu Lin
8c90a87873 Bug 1699327 - Add nsIFrame::GetMarginRect(), and comparison operators for LogicalMargin. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D107935
2021-03-18 01:06:03 +00:00
Daniel Holbert
3a2795a286 Bug 1699302 part 2: Use "InProcess" version of GetCrossDocParentFrame(), in a few other callsites in nsIFrame.cpp. r=hiro
This patch doesn't change behavior; it's just switching us between two
functions that do the same thing. (One is literally a trivial wrapper for the
other.)

We're using the new "InProcess" version of this API as a way of annotating
callsites that have been vetted as behaving properly in out-of-process iframes.

This patch fixes two callsites:
- The first callsite is an assertion whose condition becomes slightly stricter
  but should still be valid, in a scenario where we are at an oop-iframe
  boundary.

- The second is in IsFrameScrolledOutOfView(), which is part of an API that we
  use to optimize away animations if we can tell they're in an invisible
  subtree (see calls to IsScrolledOutOfView() in KeyframeEffect.cpp).  If we
  run up against an out-of-process iframe boundary when calling
  GetCrossDocParentFrame() here, we'll still be OK -- we should still be able
  to figure out whether the animation is invisible, via our call to
  nsLayoutUtils::FrameIsScrolledOutOfViewInCrossProcess() a few lines further
  down.  (Also: worst-case, we'll just run the animation even though it's not
  visible; so there's no loss of correctness.)

Differential Revision: https://phabricator.services.mozilla.com/D108878
2021-03-18 00:55:52 +00:00
Daniel Holbert
ad62a2c0e8 Bug 1699302 part 1: Use "InProcess" version of GetCrossDocParentFrame(), when propagating invalidation up the ancestor chain, in nsIFrame.cpp. r=hiro
This patch doesn't change behavior; it's just switching us between two
functions that do the same thing. (One is literally a trivial wrapper for the
other.)

We're using the new "InProcess" version of this API as a way of annotating
callsites that have been vetted as behaving properly in out-of-process iframes.

This patch is focusing on some callsites where we've got a frame that needs a
repaint, and we're propagate that information up its ancestor chain. It's OK
for these notifications to stop when we hit the edge of of an out-of-process
iframe, because painting/compositing at that granularity is handled separately.

Differential Revision: https://phabricator.services.mozilla.com/D108877
2021-03-18 00:55:51 +00:00
Emilio Cobos Álvarez
e315df01ba Bug 1698705 - Fix bogus block-frame check in GetRangeForFrame. r=saschanaz
What the rest of the selection code uses is IsBlockOutside, which is the
right thing to do here.

Differential Revision: https://phabricator.services.mozilla.com/D108619
2021-03-16 16:03:13 +00:00
Matt Woodrow
11304ea59b Bug 1685888 - Use the correct offset to reference frame for items wrapping a transform item. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D107941
2021-03-15 03:44:57 +00:00
Alexandru Michis
317bdfe06a Backed out changeset b63a8619b481 (bug 1685888) for causing crashtest assertion failures in 1507961-1.html
CLOSED TREE
2021-03-12 13:49:36 +02:00
Matt Woodrow
1d7840d8f7 Bug 1685888 - Use the correct offset to reference frame for items wrapping a transform item. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D107941
2021-03-12 00:27:30 +00:00
Jonathan Kew
989931f032 Bug 1696176 - Fix nsIFrame::PeekBackwardAndForward so that selectAtPoint correctly selects a single character or cluster rather than two adjacent characters. r=dholbert,emilio
This also prevents incorrectly selecting two words when double-clicking at
the end of the first word (before the inter-word space).

We also update the selectAtPoint testcase to target more widely-spread glyphs,
to check that it is behaving accurately across a larger distance.

Differential Revision: https://phabricator.services.mozilla.com/D107309
2021-03-11 16:34:23 +00:00
Brindusan Cristian
17a66efa77 Backed out changeset d7e50a94db5b (bug 1696176) for bc failures in browser_edit.js. CLOSED TREE 2021-03-11 04:30:00 +02:00
Boris Chiou
f448377232 Bug 1682032 - aspect-ratio should be applied for auto block-size by default. r=emilio
Based on the discussion in
https://github.com/w3c/csswg-drafts/issues/5721#issuecomment-781702159,
the default ratio-dependent axis is block axis (though the spec issue is
for replaced elements, but I think the behavior should be consistent).
So we should apply aspect-ratio not matter what the inline size is (e.g.
nscoord_MAX, auto or other values).

In the test case, the min-block-size is 1073741823, and its transferred
min-inline-size is also 1073741823, so we get a 1073741823 (i.e. nscoord_MAX)
preferred inline size (i.e. result.ISize(aWM) == NS_UNCONSTRAINEDSIZE).
However, we still have to apply aspect-ratio because the style of block-size is
auto, and so mFlags.mBSizeIsSetByAspectRatio should be set unconditionally here.

I still keep this assertion because it helps me catch this potential
issue. (Just reword it anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D107764
2021-03-10 23:20:49 +00:00