Commit Graph

704 Commits

Author SHA1 Message Date
Sylvestre Ledru
1378c145af Bug 1519636 - Reformat recent changes to the Google coding style r=andi
Updated with Debian clang-format version 11.0.1-1

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D100934
2021-01-06 17:17:23 +00:00
Mats Palmgren
50ecb9b06e Bug 1683180 - Revert bug 1672527 to fix SVG perf regression. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D100713
2021-01-04 20:26:25 +00:00
Ting-Yu Lin
7ee02364f2 Bug 1675128 Part 4 - Remove ReflowInput::ComputedPhysicalOffsets() that returns a writable-reference. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D96128
2020-11-07 00:03:38 +00:00
Ting-Yu Lin
5cdd244099 Bug 1675128 Part 3 - Make ReflowInput::ComputeRelativeOffsets() return the offset in LogicalMargin. r=emilio
Also, convert its implementation to use more logical APIs.

Differential Revision: https://phabricator.services.mozilla.com/D96127
2020-11-06 22:20:00 +00:00
Ting-Yu Lin
aca4ad21ab Bug 1674931 Part 2 - Add WritingMode argument to SizeComputationInput::ComputedLogicalBorderPadding(), and adapt callers. r=jfkthame
This patch is similar to Part 1, but for ComputedLogicalBorderPadding().

Differential Revision: https://phabricator.services.mozilla.com/D95662
2020-11-03 19:57:40 +00:00
Ting-Yu Lin
69f9e744f8 Bug 1674450 Part 5 - Remove SizeComputationInput::ComputedPhysicalBorderPadding() that returns a writable-reference. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D95368
2020-10-31 14:30:11 +00:00
Ting-Yu Lin
6315b67f67 Bug 1674450 Part 4 - Remove SizeComputationInput::ComputedPhysicalPadding() that returns a writable-reference. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D95367
2020-10-31 14:29:50 +00:00
Ting-Yu Lin
75b7f48a53 Bug 1674450 Part 3 - Remove SizeComputationInput::ComputedPhysicalMargin() that returns a writable-reference. r=layout-reviewers,jfkthame
I favor two-argument SetComputedLogicalMargin() for clarity in this
patch series because it works for any pair of writing mode and logical
margin.

Spoiler alert: the one-argument SetComputedLogicalMargin() will be
removed in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D95366
2020-10-31 14:29:27 +00:00
Mats Palmgren
a9046a5110 Bug 1672527 - Don't update overflow on frames that haven't been reflowed yet. r=emilio
This adds NS_FRAME_FIRST_REFLOW to the frame state flags
we're NOT updating overflow for.  This is a minor performance
optimization.

Differential Revision: https://phabricator.services.mozilla.com/D94395
2020-10-22 19:15:56 +00:00
Emilio Cobos Álvarez
7776a113e4 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-13 11:33:13 +00:00
Noemi Erli
925a3eabd4 Backed out changeset 64eb902728bc (bug 1664156) for causing mochitest failures in test_meta_csp_self.html CLOSED TREE 2020-09-12 22:56:18 +03:00
Emilio Cobos Álvarez
c8930007e1 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-12 17:39:18 +00:00
Emilio Cobos Álvarez
fe8e2251a1 Bug 1664432 - Remove -moz-user-disabled. r=edgar
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2020-09-11 19:26:40 +00:00
Cameron McCormack
9812c2ccf0 Bug 1643246 - Don't use attribute selectors for determining if a select is a drop down or a list box. r=emilio
Instead add a pseudo-class that does the expected size="" attribute parsing.

Removing the Gtk-specific rule setting the text color since it doesn't
seem to have any effect currently.

Differential Revision: https://phabricator.services.mozilla.com/D83448
2020-07-17 09:56:53 +00:00
Cameron McCormack
97cb78739e Bug 1620467 - Part 3: Defer to -moz-default-appearance when appearance is auto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83429
2020-07-16 22:04:12 +00:00
longsonr
ba1943ecf8 Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.

Differential Revision: https://phabricator.services.mozilla.com/D83140
2020-07-11 02:20:20 +00:00
Kagami Sascha Rosylight
93741338a8 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Kagami Sascha Rosylight
8671cdeef1 Bug 1647525 - Use HasAnyStateBits() in RestyleManager r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81098
2020-06-25 14:24:45 +00:00
Cameron McCormack
cd9c32090f Bug 1641076 - Remove RestyleManager::ProcessPostTraversal unused argument. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D76946
2020-05-26 22:52:47 +00:00
Emilio Cobos Álvarez
6350eead9d Bug 1640917 - Remove XBL mentions in layout. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D76846
2020-05-26 16:16:32 +00:00
Emilio Cobos Álvarez
b1fc84a629 Bug 1640605 - Remove IsInAnonymousSubtree / IsRootOfAnonymousSubtree. r=edgar
In favor of the NativeAnonymous versions which they forward to.

Done automatically with:

  rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g'

And removing the function definitions afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D76681
2020-05-25 11:43:51 +00:00
Ting-Yu Lin
1bcc656a6a Bug 1638928 Part 2 - Rename nsIFrame's GetChildLists() to ChildLists(). r=mats
This patch is generated by using my editor's rename functionality.

In the next patch, `nsIFrame::` prefix is going to be removed manually
from all the ChildLists() calls.

Differential Revision: https://phabricator.services.mozilla.com/D75893
2020-05-19 12:37:37 +00:00
Ting-Yu Lin
59cb4b8a77 Bug 1635319 Part 2 - Use range-based for loops and array iterators instead of ChildListIterator in layout/generic/. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75653
2020-05-18 01:17:15 +00:00
Hiroyuki Ikezoe
303f847312 Bug 1332588 - Drop the code to set NS_FRAME_MAY_BE_TRANSFORMED introduced in bug 1524480. r=boris
The right place to set the bit was in
nsIFrame::SetMayHaveTransformAnimations() (i.e. when we call
KeyframeEffect::UpdateEffectSet) for cases where we add transform animations.
on an nsIFrame which has been already initialized.

Depends on D75050

Differential Revision: https://phabricator.services.mozilla.com/D75051
2020-05-13 21:52:16 +00:00
Hiroyuki Ikezoe
5d7efb19f4 Bug 1332588 - Drop nsChangeHint_UpdateTransformLayer on the frame that we don't support transform. r=boris
Depends on D75049

Differential Revision: https://phabricator.services.mozilla.com/D75050
2020-05-13 21:52:08 +00:00
Emilio Cobos Álvarez
d3cd190414 Bug 1632765 - Bypass a restyling assertion in a replicated fixed-pos subtree. r=TYLin
The pref flip in this bug causes an assertion to fail in
layout/generic/crashtests/1137723-1.html.

Our behavior in that crashtest is so messed up that I can't even begin
to describe it.

That test-case has three-pages, and a link inside a fixed-pos subtree,
which has a ::after pseudo-element.

Via the magic of nsCSSFrameConstructor::ReplicateFixedFrames, we end up
constructing multiple frames, one per page, for the fixed subtree.

We end up with a link with three different ::after pseudo-elements (one
on each page), of which the link only knows about the latest one.

This means that when restyling the link (which was already broken, it
just didn't happen before the prefs), we'd visit the pseudo-element in
some other place of the frame tree we can get a hand on.

Restyling these frames is generally not supported and will do ~nothing,
given the current setup. There's no way to get a hand from the DOM node
to all its replicated frames.

But that's not something I plan to fix for this bug, and this assertion
is blocking me.

Differential Revision: https://phabricator.services.mozilla.com/D72755
2020-04-28 09:24:25 +00:00
Botond Ballo
0c5e94c87e Bug 1629732 - Fix non-unified build errors in layout/base. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D70785
2020-04-14 03:05:26 +00:00
Bogdan Tara
fe748913ee Backed out changeset 39e8040f10f2 (bug 1625809) for reftest failures CLOSED TREE 2020-03-30 17:55:34 +03:00
Emilio Cobos Álvarez
4460958462 Bug 1625809 - Remove nsIFrame::ContentStatesChanged. r=smaug
The only user is nsFileControlFrame, which can just use the attribute change
callback instead to sync the disabled attribute value with the button.

Syncing tabindex in that attribute callback was wrong since bug 505355.

Differential Revision: https://phabricator.services.mozilla.com/D68740
2020-03-30 12:58:09 +00:00
Emilio Cobos Álvarez
1c827af718 Bug 1625571 - Invalidate canvas background in ImageLoader rather than nsDisplayBackgroundImage. r=tnikkel
This is less error prone and also less code.

Differential Revision: https://phabricator.services.mozilla.com/D68732
2020-03-30 08:35:34 +00:00
Ting-Yu Lin
73280728ea Bug 1624514 Part 2 - Generalize nsIFrame::ContentBSize() to be ContentSize(). r=AlaskanEmily
To get the logical content size of a frame, some callers use
GetContentRectRelativeToSelf().Size() and then convert it to
LogicalRect. We really should generalize ContentBSize(), and provide
ContentSize() for such purpose.

Differential Revision: https://phabricator.services.mozilla.com/D68065
2020-03-25 18:12:25 +00:00
Emilio Cobos Álvarez
0ac124d737 Bug 1620359 - Don't clear the "uses viewport units" bit when a font that doesn't cause a style change loads. r=jfkthame
This is probably an old-ish bug made more frequent by the font loading
optimizations.

PostRebuildAllStyleData is a bit of a misnomer, but was always calling
ClearCachedData() on the style set, even if we weren't guaranteed to restyle
every element.

This means both wasted work and correctness issues (as the "uses <rare-feature>"
bits are cleared during this call, on the assumption that we'll then visit all
elements and that'd recompute it properly).

For now, unify a bit the different code paths and only clear these bits if we're
guaranteed to restyle all elements.

I should rename this to something better in a follow-up, and ideally also
decouple the ClearCachedData() calls a bit...

Differential Revision: https://phabricator.services.mozilla.com/D65740
2020-03-06 20:11:51 +00:00
Emilio Cobos Álvarez
7724dfa5be Bug 1619664 - Rename and don't null-check nsPresContext::GetTheme as it can't return null. r=dholbert
There were some callers in nsRangeFrame that were already not-null-checking.

All platforms have a native theme and should we add new ones they could use
nsBasicNativeTheme.

Differential Revision: https://phabricator.services.mozilla.com/D65169
2020-03-04 01:58:30 +00:00
Thomas Dolezal
1d175a57fd Bug 1611733 - Bug 1611633 - convert ns style position defines to enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61958
2020-02-07 12:35:30 +00:00
Emilio Cobos Álvarez
57e7439068 Bug 1611462 - Optimize position changes better. r=dholbert
When our position changes from / to absolute / fixed, then we need to reframe
(most likely, at least). But in some easier cases we can just live with a reflow
plus (optionally) a containing-block update or a repaint, depending on the case.

We need to delete the normal position property when this happens and we switch
from static to relative/sticky, and also need to update the handling of
UpdateContainingBlock to avoid making decisions based on position not changing.

This will actually not cause more reframes, as one would expect, because that
optimization became somewhat obsolete by bug 1519371 (which made the
optimization exact).

Differential Revision: https://phabricator.services.mozilla.com/D61142
2020-02-04 21:20:34 +00:00
Thomas Dolezal
a69a366a92 Bug 1612148 - Replace transform style defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61388
2020-02-01 20:23:26 +00:00
Narcis Beleuzu
e8a9623819 Backed out 2 changesets (bug 1612148) for reftest failures. CLOSED TREE
Backed out changeset e1432ef26779 (bug 1612148)
Backed out changeset 0c1831f15450 (bug 1612148)
2020-02-01 19:23:06 +02:00
Thomas Dolezal
db60806cd3 Bug 1612148 - Replace transform style defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61388
2020-02-01 15:50:04 +00:00
Emilio Cobos Álvarez
02472ef6d7 Bug 1561900 - Fix scroll state restoration when not coming from the bfcache on the initial frame construction. r=bzbarsky
There is no way this ever properly worked, as we always passed null for
`aFrameState`.

So it'd only work if we reframed the document element or such...  Which is not
amazing.

For simpler test-cases, when we don't construct the scrollframe via
PresShell::Initialize, but via the regular frame constructor updates
(ContentAppended, etc...), those end up working because we go through lazy frame
construction, which ends up in RecreateFramesForContent, which passes
mTempFrameTreeState.

Differential Revision: https://phabricator.services.mozilla.com/D59569
2020-01-15 13:18:52 +00:00
Mats Palmgren
6ffa6abb9d Bug 1604772 - Remove the eSVGGeometry IsFrameOfType bit. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D57622
2019-12-18 16:06:29 +00:00
Emilio Cobos Álvarez
1fccbabe09 Bug 1602317 - Switch style system to associated constants-in-body. r=heycam
This is closer to the equivalent Rust code.

Differential Revision: https://phabricator.services.mozilla.com/D56306
2019-12-09 03:32:28 +00:00
jeffin143
fbb2ed37ee Bug 1600476 : convert NS_STYLE_TOP_LAYER_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D55377
2019-12-01 13:05:55 +00:00
Emilio Cobos Álvarez
f4c0e82e45 Bug 1559076 - Restyle all descendants when the exportparts attribute changes. r=heycam
This attribute is not expected to change often, so it seems fine to restyle the
whole subtree.

Bug 1598094 tracks further optimizations, should they be needed.

Differential Revision: https://phabricator.services.mozilla.com/D54034
2019-11-21 10:32:17 +00:00
Emilio Cobos Álvarez
f10e4ae84c Bug 1507674 - Flush the overflow changed tracker earlier. r=jwatt
So we do it while we're still handling re-entrant changes for SVG, since SVG can
post change hints from UpdateOverflow().

Differential Revision: https://phabricator.services.mozilla.com/D12102
2019-11-20 13:18:31 +00:00
Emilio Cobos Álvarez
3f9cab940b Bug 1597160 - Remove nsChangeHint_UpdateWidgetProperties. r=mstange
:ntim was about to add another widget-affecting property (pointer-events) to
menupopups to replace the mousethrough attribute, see bug 1597120.

But pointer-events is inherited, and thus changing pointer-events on any element
would cause a change list of length == the number of descendants of the element,
which is not amazing.

So I suggested using DidSetComputedStyle instead, as this is fairly
popup-specific, but we may as well be consistent and do the same everywhere.

This removes the code to handle the -moz-window-* properties on the root frame,
as I haven't seen any usage of them (we always set them in panel or menupopup).

Differential Revision: https://phabricator.services.mozilla.com/D53377
2019-11-20 02:37:06 +00:00
Emilio Cobos Álvarez
9a1bbf0ac0 Bug 1596391 - Remove nsIContent::IsActiveChildrenElement. r=smaug
Always returns false.

Depends on D52991

Differential Revision: https://phabricator.services.mozilla.com/D52992
2019-11-14 12:55:25 +00:00
Emilio Cobos Álvarez
e89f332c21 Bug 1506842 - Always restyle / repaint when a visited query finishes. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D50810
2019-11-04 16:55:33 +00:00
Emilio Cobos Álvarez
c944f97d50 Bug 1590203 - Handle overflow changes more gracefully when possible. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D49987
2019-10-21 23:47:31 +00:00
Emilio Cobos Álvarez
6292c6695f Bug 1585863 - Remove nsChangeHint_UpdateTextPath. r=longsonr
The only thing it does is asserting a bit and posting more async work to the
text frame. It seems we can just post all the async work early instead, and
remove the change hint.

This was only introduced to fix bug 779971, where a <textPath> element
references its parent SVG, which is obviously unsound if we allowed to render
it.

What we're doing right now is a bit silly... We're observing the <svg>, so when
we finish reflowing it and store its overflow, we invalidate its rendering
observers, but that invalidates a _descendant_, which makes no sense.

Fortunately we don't let the element affect its rendering, as it fails this
check:

 * https://searchfox.org/mozilla-central/rev/35cc00a25c4471993fdaa5761952bd3afd4f1731/layout/svg/SVGObserverUtils.cpp#1390

But we still request reflow of the outer <text>, which is not amazing. We
shouldn't invalidate anything if the textpath doesn't reference a valid element
and that didn't change. This is roughly what the code tried to do when checking
mValid, except we always initialize mValid to true and thus always trigger at
least one bogus reflow call.

Differential Revision: https://phabricator.services.mozilla.com/D48008
2019-10-08 21:52:47 +00:00
Emilio Cobos Álvarez
6cccc00c96 Bug 1585858 - Remove nsChangeHint_SyncFrameView. r=tnikkel
It's always used along with nsChangeHint_RepaintFrame, which does most of the
work.

It's only useful to skip calling SyncFrameViewProperties(). That call is really
cheap if nothing actually changed, furthermore since only a handful of frames
actually have views.

So it doesn't seem like it serves any useful purpose.

Differential Revision: https://phabricator.services.mozilla.com/D48003
2019-10-07 22:29:01 +00:00