Commit graph

3543 commits

Author SHA1 Message Date
Ting-Yu Lin
15dcf36084 Bug 1799732 Part 1 - Replace GetChildList(kPrincipalList) with PrincipalChildList(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161862
2022-11-11 23:44:16 +00:00
Emily McDonough
d146c1f89b Bug 1740365 Part 1 - Use CSS page name when constructing nsPageContentFrames and computed page content style r=dholbert,emilio
This works with margin and page-size, though we can't properly test mixed
page-size yet due to limitations in both print preview testing (which does not
handle multiple pages) and paged reftests (which ignore page-size).

It may be appropriate to remove the @page { margin } propagation from Servo
after this change.

Differential Revision: https://phabricator.services.mozilla.com/D158227
2022-11-10 23:43:48 +00:00
Cosmin Sabou
9909a4a8bb Backed out 2 changesets (bug 1740365) for causing bp-hybrid bustages on PresShell.h. CLOSED TREE
Backed out changeset b52bc7d5cf65 (bug 1740365)
Backed out changeset 5ba5fdd07fe0 (bug 1740365)
2022-11-10 18:06:51 +02:00
Emily McDonough
3a6ac592fe Bug 1740365 Part 1 - Use CSS page name when constructing nsPageContentFrames and computed page content style r=dholbert,emilio
This works with margin and page-size, though we can't properly test mixed
page-size yet due to limitations in both print preview testing (which does not
handle multiple pages) and paged reftests (which ignore page-size).

It may be appropriate to remove the @page { margin } propagation from Servo
after this change.

Differential Revision: https://phabricator.services.mozilla.com/D158227
2022-11-10 15:30:39 +00:00
Emilio Cobos Álvarez
48564eab5a Bug 1800072 - Remove special-case for XUL type="menu-button". r=jfkthame
It broke in bug 1799343, and the TB folks are using type="menu", so
let's remove this.

Differential Revision: https://phabricator.services.mozilla.com/D161795
2022-11-10 14:38:07 +00:00
Emilio Cobos Álvarez
f58e73e709 Bug 1799580 - Remove display: -moz-popup. r=TYLin
We already rely on it applying only to XULPopupElement's. Make it
explicit and remove the CSS value.

Differential Revision: https://phabricator.services.mozilla.com/D161552
2022-11-09 20:38:04 +00:00
Emilio Cobos Álvarez
ccf616b673 Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-09 20:38:04 +00:00
Csoregi Natalia
9d2ea21e26 Backed out 3 changesets (bug 1799343, bug 1799580) for causing failures on /browser_history_after_appMenu.js. CLOSED TREE
Backed out changeset 63c270ba91ad (bug 1799343)
Backed out changeset 713e6f0fbd20 (bug 1799580)
Backed out changeset 42d1b8742662 (bug 1799343)
2022-11-09 21:26:06 +02:00
Emilio Cobos Álvarez
58a308d108 Bug 1799580 - Remove display: -moz-popup. r=TYLin
We already rely on it applying only to XULPopupElement's. Make it
explicit and remove the CSS value.

Differential Revision: https://phabricator.services.mozilla.com/D161552
2022-11-09 14:19:22 +00:00
Emilio Cobos Álvarez
5c5c337a98 Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-09 14:19:22 +00:00
Cristian Tuns
01dcbc81d3 Backed out 2 changesets (bug 1799580, bug 1799343) for causing mochitest failures on win7 CLOSED TREE
Backed out changeset fb0df93a4719 (bug 1799580)
Backed out changeset 493c9ca00c91 (bug 1799343)
2022-11-09 07:15:51 -05:00
Emilio Cobos Álvarez
636d705f3b Bug 1799580 - Remove display: -moz-popup. r=TYLin
We already rely on it applying only to XULPopupElement's. Make it
explicit and remove the CSS value.

Differential Revision: https://phabricator.services.mozilla.com/D161552
2022-11-09 09:17:22 +00:00
Emilio Cobos Álvarez
b513d45bea Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-09 09:17:21 +00:00
Sandor Molnar
8e6fe2de11 Backed out 4 changesets (bug 1799343) for causing multiple crashes. CLOSED TREE
Backed out changeset 3150074bccfd (bug 1799343)
Backed out changeset 7f6358a0b692 (bug 1799343)
Backed out changeset 34f040f379b1 (bug 1799343)
Backed out changeset a609c8c27ca8 (bug 1799343)
2022-11-08 05:54:37 +02:00
Emilio Cobos Álvarez
7c743cf916 Bug 1799343 - Simplify XUL popup handling. r=TYLin
* Make non-menulist popups just absolute positioned top-layer items.
 * Simplify menulist popups to just be static-positioned items under
   nsMenuFrame.

We need to keep kPopupList only for nsMenuFrame. In the future it can be
removed, see TODO in xul.css

Differential Revision: https://phabricator.services.mozilla.com/D161404
2022-11-08 00:18:00 +00:00
Timothy Nikkel
81dc489b3c Bug 1798571. Remove unused nsCSSFrameConstructor::mIsDestroyingFrameTree. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160967
2022-11-01 22:41:13 +00:00
Ting-Yu Lin
da28d9e26e Bug 1798373 Part 8 - Convert more frame list manipulation methods to take rvalue references of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160844
2022-11-01 21:15:55 +00:00
Ting-Yu Lin
040feb02dd Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Ting-Yu Lin
c99b45fa14 Bug 1798373 Part 6 - Change nsContainerFrame::AppendFrames() to take rvalue reference of nsFrameList. r=emilio
Change nsBlockFrame::AppendFrames() helper, too.

Differential Revision: https://phabricator.services.mozilla.com/D160842
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
4787078c5c Bug 1798373 Part 5 - Change nsContainerFrame::SetInitialChildList() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160841
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
fc3719b5aa Bug 1798373 Part 4 - Remove nsFrameList::SetFrames() that takes nsFrameList. r=emilio
SetFrame() is equivalent to `operator=`, so external callers can use `operator=`
instead. For the two callers wanting to set `nsFrameList` to `AbsoluteFrameList`
in `nsCSSFrameConstructor`, removing SetFrame() disallows it. However, we can
easily change the declaration from `nsFrameList` to a `AbsoluteFrameList` to
resolve the problem.

Differential Revision: https://phabricator.services.mozilla.com/D160840
2022-11-01 21:15:53 +00:00
Ting-Yu Lin
adf4fab73c Bug 1798373 Part 2 - Change nsFrameList::AppendFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160838
2022-11-01 21:15:52 +00:00
Ting-Yu Lin
569c5f244b Bug 1798373 Part 1 - Change nsFrameList::InsertFrames to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160837
2022-11-01 21:15:52 +00:00
Emilio Cobos Álvarez
73ff5f1ac4 Bug 1797308 - Make <xul:spacer> use non-XUL layout. r=jwatt
Nothing overrides its display value so it would get -moz-box display by
default, like all other XUL elements.

Differential Revision: https://phabricator.services.mozilla.com/D160222
2022-10-29 21:51:29 +00:00
Emilio Cobos Álvarez
953f64d63b Bug 1797703 - Fix frame constructor save state restoration. r=emilio
Restore the old logic [1] prior to introducing Bug 1797011 Part 2.

[1] https://searchfox.org/mozilla-central/rev/85cbcecd24554c1fa88360412452ad0f7ed48630/layout/base/nsCSSFrameConstructor.cpp#1309-1335
[2] https://hg.mozilla.org/mozilla-central/rev/3f443cbb5bdd

The wpt test is written by Emilio Cobos Álvarez <emilio@crisal.io> in
https://phabricator.services.mozilla.com/D160523.

Differential Revision: https://phabricator.services.mozilla.com/D160600
2022-10-28 07:56:50 +00:00
Noemi Erli
9ad9fc4449 Backed out changeset 4dfea46f3cd0 (bug 1797703) for causing reftest failures 2022-10-28 01:40:58 +03:00
Emilio Cobos Álvarez
bc6fbbde9c Bug 1797703 - Fix frame constructor save state restoration. r=TYLin,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D160523
2022-10-27 21:20:02 +00:00
Ting-Yu Lin
c0245a1523 Bug 1797011 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D160104
2022-10-26 04:22:25 +00:00
Ting-Yu Lin
babc81bc9c Bug 1797011 Part 3 - Delete nsFrameList's copy assigment operator. r=emilio
This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D160015
2022-10-26 04:22:25 +00:00
Ting-Yu Lin
b91a315ae3 Bug 1797011 Part 2 - Make AbsoluteFrameList a move-only class; improve nsFrameConstructorSaveState and PushAbsoluteContainingBlock(). r=emilio
This patch doesn't change behavior.

AbsoluteFrameList is a derived class of nsFrameList, so we change it a move-only
class in order to nsFrameList move-only in Part 3.

Some detail of this patch:

- Define move constructor and move assignment operator for AbsoluteFrameList.
  This effectively disables the auto generated copy constructor and copy
  assignement operator.

- Initialize nsFrameConstructorSaveState's member variables in class definition,
  and remove its constructor.

- Remove `mSavedFixedList` since we can rewire the logic in
  `~nsFrameConstructorSaveState` and `PushAbsoluteContainingBlock()` to make it
  redundant.

- Make self-assignment correct in nsFrameList's move assignment operator.

Differential Revision: https://phabricator.services.mozilla.com/D160014
2022-10-26 04:22:24 +00:00
Butkovits Atila
b704dcf231 Backed out 4 changesets (bug 1797011) for causing high frequency ThreadSanitizer failures. CLOSED TREE
Backed out changeset e55bef9aa488 (bug 1797011)
Backed out changeset 515757be2f7e (bug 1797011)
Backed out changeset 360739dfb6d1 (bug 1797011)
Backed out changeset 9a3f104b78c5 (bug 1797011)
2022-10-25 01:03:29 +03:00
Ting-Yu Lin
4cd1e6f862 Bug 1797011 Part 4 - Rename AbsoluteFrameList::containingBlock to mContainingBlock to match coding style. r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D160104
2022-10-24 19:14:33 +00:00
Ting-Yu Lin
aae6173a16 Bug 1797011 Part 3 - Delete nsFrameList's copy assigment operator. r=emilio
This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D160015
2022-10-24 19:14:33 +00:00
Ting-Yu Lin
5f9b5759c1 Bug 1797011 Part 2 - Make AbsoluteFrameList a move-only class; improve nsFrameConstructorSaveState and PushAbsoluteContainingBlock(). r=emilio
This patch doesn't change behavior.

AbsoluteFrameList is a derived class of nsFrameList, so we change it a move-only
class in order to nsFrameList move-only in Part 3.

Some detail of this patch:

- Define move constructor and move assignment operator for AbsoluteFrameList.
  This effectively disables the auto generated copy constructor and copy
  assignement operator.

- Initialize nsFrameConstructorSaveState's member variables in class definition,
  and remove its constructor.

- Remove `mSavedFixedList` since we can rewire the logic in
  `~nsFrameConstructorSaveState` and `PushAbsoluteContainingBlock()` to make it
  redundant.

- Make self-assignment correct in nsFrameList's move assignment operator.

Differential Revision: https://phabricator.services.mozilla.com/D160014
2022-10-24 19:14:32 +00:00
Ting-Yu Lin
ce9040c985 Bug 1794035 Part 4 - Use range-based for loops to iterate nsFrameList. r=emilio
After this patch, we still need nsFrameList::Enumerator to iterate
nsFrameList::Slice. We might enhance nsFrameList::Iterator to support Slice, but
I'll leave this for another day.

Differential Revision: https://phabricator.services.mozilla.com/D158809
2022-10-07 01:41:41 +00:00
Ting-Yu Lin
171f18c10d Bug 1794035 Part 1 - Rename nsFrameList::ExtractHead to TakeFramesBefore. r=emilio
I feel it's hard to understand the purpose of ExtractHead(), especially where
aFrame is going after the call. Therefore, I rename it to TakeFramesBefore(),
and have it complement the existing RemoveFramesAfter(), which will be rename
later. No behavioral change intended.

Also, slightly reword the method's documentation to reflect the its new
name. (Remove the "sibling" wording from the comment since it's an
implementation details that frames are actually a doubly linked list.)

Differential Revision: https://phabricator.services.mozilla.com/D158806
2022-10-07 01:41:40 +00:00
Ting-Yu Lin
296fa869bc Bug 1793826 Part 2 - Remove nsFrameList::FrameLinkEnumerator. r=emilio
Change the last caller of FrameLinkEnumerator to use Iterator instead, and we
are ready to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D158701
2022-10-06 06:47:25 +00:00
Ting-Yu Lin
ff8e435a59 Bug 1793826 Part 1 - Change nsFrameList::ExtractHead and ExtractTail to take nsIFrame* argument. r=emilio
This is a preparation to remove nsFrameList::FrameLinkEnumerator in the next
part.

Differential Revision: https://phabricator.services.mozilla.com/D158700
2022-10-06 06:47:25 +00:00
Csoregi Natalia
eb363bd64e Backed out 2 changesets (bug 1793826) for causing build bustages. CLOSED TREE
Backed out changeset 9e398426c46f (bug 1793826)
Backed out changeset 01820845ab62 (bug 1793826)
2022-10-06 03:41:00 +03:00
Ting-Yu Lin
1d1bc48ebc Bug 1793826 Part 2 - Remove nsFrameList::FrameLinkEnumerator. r=emilio
Change the last caller of FrameLinkEnumerator to use Iterator instead, and we
are ready to remove it.

Differential Revision: https://phabricator.services.mozilla.com/D158701
2022-10-06 00:19:42 +00:00
Ting-Yu Lin
307de24fc3 Bug 1793826 Part 1 - Change nsFrameList::ExtractHead and ExtractTail to take nsIFrame* argument. r=emilio
This is a preparation to remove nsFrameList::FrameLinkEnumerator in the next
part.

FrameLinkEnumerator::Find() can be replaced with std::find/std::find_if.

Differential Revision: https://phabricator.services.mozilla.com/D158700
2022-10-06 00:19:41 +00:00
Emily McDonough
1f2d745a94 Bug 1782597 Part 2 - Use null to indicate page value equal to the auto value for CSS named pages r=dholbert
This applies both to the individual mStartPageValue and mEndPageValue fields
of the nsIFrame::PageValues struct, and for the nsIFrame::PageValuesProperty
being null to indicate both mStartPageValue and mEndPageValue are auto.

Fetching this is handled by nsIFrame::GetStartPageValue and
nsIFrame::GetEndPageValue, which also ensure the use of first-in-flow frames.

Differential Revision: https://phabricator.services.mozilla.com/D157873
2022-10-05 22:07:47 +00:00
Emily McDonough
be4dd4a026 Bug 1782597 Part 1 - Store auto page value on each frame when in a paginated context. r=dholbert,emilio
Differential Revision: https://phabricator.services.mozilla.com/D157872
2022-10-05 22:07:46 +00:00
Emilio Cobos Álvarez
048e9bb783 Bug 1792741 - Remove nsDocElementBoxFrame. r=TYLin
After bug 1665476, it's pretty much a regular XUL box with a couple
special-cases that we can use IsRootElementStyle for. Do that, and allow
using nsFlexContainerFrame when using flexbox emulation.

Differential Revision: https://phabricator.services.mozilla.com/D158288
2022-10-01 02:35:31 +00:00
Csoregi Natalia
462f51927a Backed out changeset 63fbc22d2223 (bug 1792741) for causing assertion failures on nsCSSFrameConstructor.cpp. CLOSED TREE 2022-10-01 04:22:22 +03:00
Emilio Cobos Álvarez
39da87ded4 Bug 1792741 - Remove nsDocElementBoxFrame. r=TYLin
After bug 1665476, it's pretty much a regular XUL box with a couple
special-cases that we can use IsRootElementStyle for. Do that, and allow
using nsFlexContainerFrame when using flexbox emulation.

Differential Revision: https://phabricator.services.mozilla.com/D158288
2022-10-01 00:28:13 +00:00
Butkovits Atila
c01a6393db Backed out changeset 511ee0f8727c (bug 1792741) for causing failures at browser_aboutDialog_distribution. 2022-09-30 03:56:41 +03:00
Emilio Cobos Álvarez
04c73bdd6a Bug 1792741 - Remove nsDocElementBoxFrame. r=TYLin
After bug 1665476, it's pretty much a regular XUL box with a couple
special-cases that we can use IsRootElementStyle for. Do that, and allow
using nsFlexContainerFrame when using flexbox emulation.

Differential Revision: https://phabricator.services.mozilla.com/D158288
2022-09-29 23:34:41 +00:00
Emilio Cobos Álvarez
235b091ad3 Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2022-09-28 02:56:41 +00:00
Butkovits Atila
7b7cfe8e1b Backed out changeset 503c84054f68 (bug 1665476) for causing mochitest mass failures. CLOSED TREE 2022-09-27 13:04:54 +03:00
Emilio Cobos Álvarez
8ed6f78bb0 Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2022-09-27 08:18:58 +00:00
Emilio Cobos Álvarez
4e978b56b5 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-27 04:18:16 +00:00
Marian-Vasile Laza
f54a464c90 Backed out changeset 2f74f8f2ed19 (bug 1689816) for causing reftest failures on skip-ink-multiline-position.html. 2022-09-26 23:24:03 +03:00
Emilio Cobos Álvarez
f875681246 Bug 1689816 - Implement <tabpanels> and <deck> without XUL layout. r=Gijs,Jamie,morgan,preferences-reviewers,mconley,TYLin
Gijs for front-end bits, layout for the new CSS properties and the
removal of nsDeckFrame / nsStackLayout, Jamie and Morgan for the a11y
changes.

As discussed in the bug, the main tricky part here is handling a11y
correctly. For <deck>, that's trivial (just use `visibility: hidden` to
hide the panels visually, while removing the unselected panels from the
a11y tree).

For <tabpanels> however we need to do something special. We do want to
hide stuff visually, but we want to preserve the contents in the a11y
tree.

For that, the easiest fix is introducing a new privileged CSS property
(-moz-subtree-hidden-only-visually), which takes care of not painting
the frame, but marks stuff offscreen in the accessibility tree. This is
not intended to be a property used widely.

Other than that, the changes are relatively straight-forward, though
some of the accessible/mac changes I could get a sanity-check on.

Differential Revision: https://phabricator.services.mozilla.com/D157875
2022-09-26 17:40:30 +00:00
Emily McDonough
673e9552a0 Bug 1764437 - Check for prev/next sibling when propagating start/end page values for frames r=dholbert
This also properly handles placeholder frames, and ensures that when checking
next/prev sibling we ignore placeholder frames.

To properly test this for multiple levels of page value propagation, we also
need to use FirstInFlow to get page values when checking for breaks in block
frames.

Differential Revision: https://phabricator.services.mozilla.com/D157175
2022-09-20 21:42:34 +00:00
Emilio Cobos Álvarez
121b2bb157 Bug 1790920 - Remove nsButtonBoxFrame. r=smaug
Create XULButtonElement instead to do the event handling. Pretty much a
straight port, this allows these elements to respect CSS display
properly (and use modern flexbox rather than old XUL layout).

Differential Revision: https://phabricator.services.mozilla.com/D157509
2022-09-19 17:02:37 +00:00
Emilio Cobos Álvarez
3fddb3b833 Bug 1308080 - Make <details> use a shadow tree as per spec. r=TYLin,smaug
The behavior changes match WebKit and Blink. I can look into upstreaming
some of these to WPT.

Differential Revision: https://phabricator.services.mozilla.com/D34754
2022-09-16 14:54:12 +00:00
Sandor Molnar
259f357a67 Backed out changeset 27c0485f1740 (bug 1308080) for causing assertion failure in dom/ShadowRoot.h & wr failures in /css/css-multicol/multicol-span-all-dynamic CLOSED TREE 2022-09-14 05:47:49 +03:00
Emilio Cobos Álvarez
97f29b0b89 Bug 1308080 - Make <details> use a shadow tree as per spec. r=TYLin,smaug
The behavior changes match WebKit and Blink. I can look into upstreaming
some of these to WPT.

Differential Revision: https://phabricator.services.mozilla.com/D34754
2022-09-13 21:52:50 +00:00
Emily McDonough
211e48aee3 Bug 1786399 - Check for block layout when applying and propagating page-name properties r=dholbert
The page-name property only applies to boxes which can create class A
breakpoints. One of the qualifiers for this is a block-level item, which is
the child of a block frame. Additionally, page-name propagation only occurs
through frames for which the page-name property applies, because where it does
not apply the auto page-name is propagated instead.

This means we only need to worry about block frames, and only use specified
page-name for BlockOutside frames.

Differential Revision: https://phabricator.services.mozilla.com/D155285
2022-09-13 21:29:38 +00:00
Emily McDonough
aea863f3d5 Bug 1779645 Part 1 - Switch CSS named page fragmentation to happen at reflow instead of frame construction r=dholbert
This also adds a small post-processing step for frame-construction to ensure
that replaced frames (or more generally frames with content but no children)
have the auto page-name set on them.

When page-name value tracking is switched to be lazy, this post-processing step
will likely be redundant and can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D152701
2022-09-13 21:29:37 +00:00
criss
a4d6291cea Backed out 3 changesets (bug 1786399, bug 1779645) for causing reftest failures on page-name-zero-height-001.html. CLOSED TREE
Backed out changeset 81c8d6a2d6f9 (bug 1786399)
Backed out changeset 3ee5fb016aa0 (bug 1779645)
Backed out changeset b626e11a262d (bug 1779645)
2022-09-13 04:19:42 +03:00
Emily McDonough
b924dafc06 Bug 1786399 - Check for block layout when applying and propagating page-name properties r=dholbert
The page-name property only applies to boxes which can create class A
breakpoints. One of the qualifiers for this is a block-level item, which is
the child of a block frame. Additionally, page-name propagation only occurs
through frames for which the page-name property applies, because where it does
not apply the auto page-name is propagated instead.

This means we only need to worry about block frames, and only use specified
page-name for BlockOutside frames.

Differential Revision: https://phabricator.services.mozilla.com/D155285
2022-09-12 22:44:49 +00:00
Emily McDonough
dbbd632586 Bug 1779645 Part 1 - Switch CSS named page fragmentation to happen at reflow instead of frame construction r=dholbert
This also adds a small post-processing step for frame-construction to ensure
that replaced frames (or more generally frames with content but no children)
have the auto page-name set on them.

When page-name value tracking is switched to be lazy, this post-processing step
will likely be redundant and can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D152701
2022-09-12 22:44:48 +00:00
Emilio Cobos Álvarez
b5c2fd645c Bug 1789123 - Make anonymous box wrapping inside XUL boxes be similar to modern flex boxes. r=dholbert
I haven't spotted any UI regression from this, and this should generally
make the XUL -> modern flex transition easier, and simplify some
of the relevant code.

This does fix a few layout issues with emulated flexbox.

For the most part, this shouldn't change behavior without that. This
changes behavior if you have mixed inline/non-inline content in the same
XUL box (before they'd get a single item, now you'd get the flexbox /
grid behavior of one item per inline run), and multiple inline-elements
(which would become their own flex items). But I pushed a patch with
some asserts and they didn't fire on our browser mochitests, so I think
we're good.

The UA rule refactoring (removing the inherit from xul anon blocks)
shouldn't matter in practice, since we only have one item (so
box-ordinal is irrelevant) and they have overflow: visible (so
text-overflow and overflow-clip-box shouldn't have an effect).

Differential Revision: https://phabricator.services.mozilla.com/D156375
2022-09-08 11:51:15 +00:00
Emilio Cobos Álvarez
34c59f52a7 Bug 1789123 - Unify anonymous flex/grid items. r=dholbert
This has no behavior change, just unifies the pseudo-element used for
these.

Differential Revision: https://phabricator.services.mozilla.com/D156736
2022-09-08 11:45:31 +00:00
Frederic Wang
39dd537031 Bug 1588733 - Make maction/semantics elements behave as an mrow with the first child. r=emilio
See https://groups.google.com/forum/#!topic/mozilla.dev.platform/BWUvjERSXUM

Differential Revision: https://phabricator.services.mozilla.com/D49285
2022-09-06 04:32:15 +00:00
Emilio Cobos Álvarez
67120339b0 Bug 1788785 - Skip placeholders for first-letter-finding code. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D156294
2022-09-02 15:07:15 +00:00
Emilio Cobos Álvarez
97b7562b6b Bug 1787072 - Avoid useless reframes setting the src attribute of a broken image that already has an image frame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D155533
2022-09-02 09:39:38 +00:00
Andreas Farre
4b493b6a30 Bug 1595491 - Part 1: Make <embed> and <object> behave more like <iframe>. r=smaug,emilio
By making image loading in <embed> and <object> behave more like when
an <iframe> loads an image, we can make sure that the synthetic
document generated is process switched if the image is cross
origin. This is done by making image loading in nsObjectLoadingContent
follow the document loading path.

We also make sure that we pass the image size back to the embedder
element to not get stuck with the intrinsic size.

To avoid named targeting being able to target these synthetic
documents, as well as showing up in `Window.frames` and being counted
in `Window.length`, we keep a filtered list of non-synthetic browsing
contexts for that use-case.

This feature is controlled by two prefs:

* browser.opaqueResponseBlocking.syntheticBrowsingContext

  This triggers the creation of synthetic documents for images loaded
  in <object> or embed.

* browser.opaqueResponseBlocking.syntheticBrowsingContext.filter

  This turns on the filtering of synthetic browsing contexts in named
  targeting, `Window.length` and `Window.frames`.

Differential Revision: https://phabricator.services.mozilla.com/D148117
2022-08-16 16:42:58 +00:00
Emilio Cobos Álvarez
e23e2a0212 Bug 1783934 - Add a chrome-only -moz-box-layout: legacy | flex, and use that to implement flexbox emulation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D154153
2022-08-10 19:46:37 +00:00
Marian-Vasile Laza
8274331cda Backed out changeset 449fe2d946ea (bug 1783934) for causing mochitest failures on test_animation-type-longhand.html. CLOSED TREE 2022-08-10 19:48:38 +03:00
Emilio Cobos Álvarez
f4206bdde5 Bug 1783934 - Add a chrome-only -moz-box-layout: legacy | flex, and use that to implement flexbox emulation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D154153
2022-08-10 15:47:41 +00:00
Emily McDonough
15dfc05d00 Bug 1783783 - Add null-check for aParentFrame when computing used page values in nsCSSFrameConstructor r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D154135
2022-08-09 22:23:17 +00:00
Emily McDonough
2ab827df0d Bug 1766685 - Do not perform page-breaks in the destructor of the page name tracker RAII struct r=dholbert
Instead, do this just before we addd the frame construction items, where CSS
break-after/break-before is handled.

This also fixes the expectations of three tests where our expectations have
changed. The test page-name-img-001 now succeeds with correct results because
of this change, though the other img and the canvas tests fail due issues with
fragmentation named pages and replaced frames.

The issues with replaced frames are currently caused because our page-break
logic occurs in nsCSSFrameConstructor::AddFrameConstructionItemsInternal, but
this is performed for the parent frame. As the replaced frames have no
children, we never process their children in
nsCSSFrameConstructor::AddFrameConstructionItemsInternal.

The issue with replaced frames will be fixed by
https://bugzilla.mozilla.org/1779645

Differential Revision: https://phabricator.services.mozilla.com/D151331
2022-08-01 20:17:34 +00:00
Emily McDonough
cecd0ac37f Bug 1781957 - Remove argument to nsCSSFrameConstructor::AddFCItemsForAnonymousContent which is not useful r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D152952
2022-07-28 20:21:49 +00:00
Emily McDonough
e9d545fba3 Bug 1780671 - Make EnsureAutoPageName walk back up the frame tree only when necessary r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D152471
2022-07-22 05:01:40 +00:00
Emilio Cobos Álvarez
f912244bff Bug 1778965 - Clean-up a bit alt text code. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D151482
2022-07-11 17:29:31 +00:00
Martin Robinson
f85b73bf84 Bug 1463600 - Implement CSS 'contain: style' r=emilio
Add an implementation of CSS `contain: style`. This introduces two new
data structures, the ContainStyleScope and ContainStyleScopeManager.

ContainStyleScope manages one `contain: style` "world" which has its own
counter and quote lists. The contents of these lists depend on their
parent scopes, but are not affected by their children.
ContainStyleScopeManager manages a tree of scopes starting at a root
scope which is outside of any `contain: style` element.

Scopes are stored in a hash table that is keyed off of the nsIContent
which establishes the `contain: style` scope. When modifying quote or
content lists, the ContainStyleScopeManager is responsible for finding
the appropriate `contain: style` scope to modify.

Perhaps the most complex part of this is that counters and quotes have
read access to the state of counters and quotes that are in ancestor
`contain: style` scopes. In the case of counters, USE nodes that are at
the beginning of counter lists might have a counter scope that starts in
an ancestor `contain: style` scope. When nsCounterNode::SetScope() is
called, the code may look upward in the `contain: style` scope tree to
find the start of the counter scope. In the case of quotes, the first
node in the quote list must look for the state of quotes in ancestor
`contain: style` scopes.

Differential Revision: https://phabricator.services.mozilla.com/D149508
2022-06-22 16:16:59 +00:00
Bogdan Szekely
b56ae513c7 Backed out changeset 86e9449aba35 (bug 1463600) for causing xpcshell failures on test_css-properties-db.js 2022-06-22 15:35:33 +03:00
Martin Robinson
83640bbee6 Bug 1463600 - Implement CSS 'contain: style' r=emilio
Add an implementation of CSS `contain: style`. This introduces two new
data structures, the ContainStyleScope and ContainStyleScopeManager.

ContainStyleScope manages one `contain: style` "world" which has its own
counter and quote lists. The contents of these lists depend on their
parent scopes, but are not affected by their children.
ContainStyleScopeManager manages a tree of scopes starting at a root
scope which is outside of any `contain: style` element.

Scopes are stored in a hash table that is keyed off of the nsIContent
which establishes the `contain: style` scope. When modifying quote or
content lists, the ContainStyleScopeManager is responsible for finding
the appropriate `contain: style` scope to modify.

Perhaps the most complex part of this is that counters and quotes have
read access to the state of counters and quotes that are in ancestor
`contain: style` scopes. In the case of counters, USE nodes that are at
the beginning of counter lists might have a counter scope that starts in
an ancestor `contain: style` scope. When nsCounterNode::SetScope() is
called, the code may look upward in the `contain: style` scope tree to
find the start of the counter scope. In the case of quotes, the first
node in the quote list must look for the state of quotes in ancestor
`contain: style` scopes.

Differential Revision: https://phabricator.services.mozilla.com/D149508
2022-06-22 10:42:34 +00:00
Emilio Cobos Álvarez
4ee33aab52 Bug 1730763 - Fix containment and body-to-root propagation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D149226
2022-06-17 10:42:52 +00:00
Marian-Vasile Laza
1d24f09b38 Backed out changeset d70914c7f1f3 (bug 1730763) for causing web-platform reftest failures on direction-propagation-body-contain-root.html. CLOSED TREE 2022-06-16 15:53:24 +03:00
Emilio Cobos Álvarez
34e23753e7 Bug 1730763 - Fix containment and body-to-root propagation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D149226
2022-06-16 08:08:08 +00:00
Iulian Moraru
9aa4db0c6d Backed out 2 changesets (bug 1730763) for causing multiple reftest failures. CLOSED TREE
Backed out changeset 350982d1a44d (bug 1730763)
Backed out changeset 392445118046 (bug 1730763)
2022-06-15 15:31:43 +03:00
Emilio Cobos Álvarez
f66447dead Bug 1730763 - Fix typo that causes some reftests to fail.
Adjust some tests that are not expected to pass until we implement style
containment.

MANUAL PUSH: Trivial typo fix CLOSED TREE
2022-06-15 13:29:43 +02:00
Emilio Cobos Álvarez
662e5dc678 Bug 1730763 - Fix containment and body-to-root propagation. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D149226
2022-06-15 09:56:34 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Mats Palmgren
f13e1725b3 Bug 1694056 - Remove (XUL) nsTitleBarFrame since it's no longer used. r=emilio
Depends on D105927

Differential Revision: https://phabricator.services.mozilla.com/D105928
2022-06-07 09:30:03 +00:00
Mats Palmgren
6b2f046373 Bug 1590376 part 1 - Add a XULResizerElement and move all nsResizerFrame's event handling code there. r=ntim,smaug
I'm mostly moving the code verbatim, but I excluded a few bits
that handled resizers inside menu popup frames, e.g.
https://searchfox.org/mozilla-central/rev/7bb1cc6abf6634b2a20f71935e1e519e73402b63/layout/xul/nsResizerFrame.cpp#165-170
I don't think we need that functionallity anymore and it
simplifies the code to exclude it.

Differential Revision: https://phabricator.services.mozilla.com/D105926
2022-06-07 09:30:01 +00:00
Butkovits Atila
e3b4113a08 Backed out 4 changesets (bug 1694056, bug 1590376) for causing failures at test_resizer_ctrl_click.xhtml. CLOSED TREE
Backed out changeset 656906f99173 (bug 1590376)
Backed out changeset 15e9b4e9070c (bug 1694056)
Backed out changeset f137d6e73641 (bug 1590376)
Backed out changeset 00ed65f43cb2 (bug 1590376)
2022-06-07 02:12:40 +03:00
Mats Palmgren
cd6ad5af43 Bug 1694056 - Remove (XUL) nsTitleBarFrame since it's no longer used. r=emilio
Depends on D105927

Differential Revision: https://phabricator.services.mozilla.com/D105928
2022-06-06 20:00:46 +00:00
Mats Palmgren
17801441dd Bug 1590376 part 1 - Add a XULResizerElement and move all nsResizerFrame's event handling code there. r=ntim,smaug
I'm mostly moving the code verbatim, but I excluded a few bits
that handled resizers inside menu popup frames, e.g.
https://searchfox.org/mozilla-central/rev/7bb1cc6abf6634b2a20f71935e1e519e73402b63/layout/xul/nsResizerFrame.cpp#165-170
I don't think we need that functionallity anymore and it
simplifies the code to exclude it.

Differential Revision: https://phabricator.services.mozilla.com/D105926
2022-06-06 20:00:45 +00:00
Emilio Cobos Álvarez
d4a37bb799 Bug 1768155 - Allow nsComboboxControlFrame to be laid out without a <button>. r=jwatt
Don't generate the button if the combobox doesn't need it anyways (if the
appearance is not menulist).

While at it improve the code that reframes on appearance: textfield changes so
that it only applies to number inputs as it should.

This shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D145712
2022-05-06 14:45:49 +00:00
Emily McDonough
f7af34aa62 Bug 1740366 - Implement paginated fragmentation on page-name boundaries r=dholbert
This has a TODO about empty page names on previous sibling frames, to match
Chrome's behavior of page break coalescing we should be looking to the frame
before that sibling and check for page breaks there instead.

Differential Revision: https://phabricator.services.mozilla.com/D140423
2022-04-28 00:03:19 +00:00
Emilio Cobos Álvarez
72d2420c2b Bug 1766395 - Remove dom.forms.datetime-local prefs. r=edgar
We shipped this a while ago.

Differential Revision: https://phabricator.services.mozilla.com/D144800
2022-04-27 14:10:27 +00:00
David Shin
3de9753ec9 Bug 1758723 - Suppress column-span:all for descendants of a containing block element for fixed-position descendants r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D142355
2022-03-29 20:56:57 +00:00
Emilio Cobos Álvarez
6489b27741 Bug 1758564 - Allow rendering children of <img>'s shadow root. r=dholbert
This doesn't change behavior just yet, but seems worth doing separately.

With this patch, we can render content overlaid on top of an image
frame, by attaching a shadow root to it. The idea is to use this for
text recognition (OCR) of text inside images.

I chose to implement this using the DynamicLeaf stuff that I removed in
bug 1746310 (because nsMenuPopupFrame was its only user).

That seems simpler than either a new frame class, or more special cases
in the frame constructor, etc. But let me know if you disagree.

There are further changes that we want to do. For example, trying to
select the overlaid text with the mouse right now will start dragging
the image. For that, we might need to tweak our selection / mouse
dragging code. But those seem all changes that can go on top of this.

Differential Revision: https://phabricator.services.mozilla.com/D140638
2022-03-10 05:11:38 +00:00
Emily McDonough
e66f17daf3 Bug 1755808 - constify some of nsCSSFrameConstructor::AddFrameConstructionItemsInternal r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D138960
2022-02-16 23:15:27 +00:00
smolnar
d8c0c3db3c Merge autoland to mozilla-central. a=merge 2022-02-05 11:13:25 +02:00