MakeAndAddRef ensures that the freshly-allocated object immediately gets a
refcount of 1 (before it's even passed to AddScriptRunner). This avoids
several potential footguns that otherwise exist with a zero-refcount
freshly-allocated object.
It also makes the ownership-transfer semantics more clear
(via the already_AddRefed type that it produces) - AddScriptRunner is taking
ownership of the object, rather than using it temporarily while the caller
maintains ownership.
Differential Revision: https://phabricator.services.mozilla.com/D299039
Three callers:
* fixed attribute is only used as fixed=true for treecolumns, so no
behavior change.
* noautofocus is already only used as =true or removed, so no behavior
change.
* incontentshell is only used with ="false", rename to
escapecontentshell and flip the meaning.
Remove the API and similar GetXUL* stuff that did the same.
Differential Revision: https://phabricator.services.mozilla.com/D286520
* xul:splitter remains non-focusable by default to avoid blowing up the scope of this patch
* opt-in the splitview splitter to be focusable
* Wire up aria attributes on splitview splitter to cue AT on the resizing behavior
* New string for the aria-label on the splitview splitter
* Make the isSplitViewActive setter a setSplitViewActive method as there's no getter
* Add test coverage for the keyboard events on the splitter widget, and the splitview splitter
Differential Revision: https://phabricator.services.mozilla.com/D281109
`MutationEvent_Bindings::MODIFICATION`,
`MutationEvent_Bindings::ADDITION` and `MutationEvent_Bindings::REMOVAL`
will be removed. Therefore, we need alternative `enum class` for that.
This patch makes `nsIFrame` and subclasses use the new one.
Differential Revision: https://phabricator.services.mozilla.com/D263053
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.
This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.
It's also a bit nicer to add things there if we need to in the future.
Differential Revision: https://phabricator.services.mozilla.com/D187578
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.
This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.
It's also a bit nicer to add things there if we need to in the future.
Differential Revision: https://phabricator.services.mozilla.com/D187578
We still have some remnants of XUL layout due to nsBox / nsLeafBoxFrame
which XUL trees / nsTextBoxFrame still use.
However all this code can go away before we get rid of those.
nsSplitterFrame was the last thing inheriting from nsBoxFrame.
Differential Revision: https://phabricator.services.mozilla.com/D173601
Make it a SimpleXULLeafFrame, and carry on. Ideally we'd instead move
this code out of layout altogether into a XULSplitterElement, but given
splitters can have no children, well.
At this point there's only nsTreeBodyFrame an nsTextBoxFrame left to be
able to remove all of XUL layout.
Differential Revision: https://phabricator.services.mozilla.com/D173600
Done mostly automatically via find/replace following the conversions
specified here:
https://groups.google.com/a/mozilla.org/g/firefox-dev/c/9sGpF1TNbLk/m/QpU3oTUuAgAJ
For the most part I think the "flex: N N" usage could be simplified to
just "flex: N", but I wanted to preserve behavior (-moz-box-flex sets
both flex-grow and flex-shrink).
I changed legacy layout to also look at the order property rather than
-moz-box-ordinal-group because it made splitters and treecols easier (we
don't need to deal with both orders).
Differential Revision: https://phabricator.services.mozilla.com/D171715
Done mostly automatically via find/replace following the conversions
specified here:
https://groups.google.com/a/mozilla.org/g/firefox-dev/c/9sGpF1TNbLk/m/QpU3oTUuAgAJ
For the most part I think the "flex: N N" usage could be simplified to
just "flex: N", but I wanted to preserve behavior (-moz-box-flex sets
both flex-grow and flex-shrink).
I changed legacy layout to also look at the order property rather than
-moz-box-ordinal-group because it made splitters and treecols easier (we
don't need to deal with both orders).
Differential Revision: https://phabricator.services.mozilla.com/D171715
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.
This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D161863
After moving FrameChildListID into mozilla namespace, `kPrincipalList` etc. are
also exposed in the mozilla namespace. In the next part, I'll convert
FrameChildListID enum into an enum class, so the naming pollution shouldn't be
an issue.
This patch has a nice side effect that it is now easier to remove all the
aliases of FrameChildListID (`kPrincipalList` etc.) defined in multiple places
since it is confusion to have the same thing written in different ways, e.g.
`nsIFrame::kPrincipalList`, `mozilla::layout::kPrincipalList`,
`FrameChildListID::kPrincipalList`, `kPrincipalList`.
This patch doesn't change behavior.
Differential Revision: https://phabricator.services.mozilla.com/D161863
This is not easy to test precisely. What the width attribute / property
set is the preferred size, but the boxes can flex expanding that, which
may cause jumps when dragging. This is easy to see with the previous
patches on the urlbar / searchbar split.
While at it make the flex and xul code-paths more similar.
Differential Revision: https://phabricator.services.mozilla.com/D159081
This trivially enhances splitters so that resizing a single element,
which is a common thing to do in our front-end code, is easier.
Differential Revision: https://phabricator.services.mozilla.com/D159069
Add some basic min/max size support in splitters, and make the width
part of the element we're splitting rather than the <browser> child.
I don't _think_ the nsSplitterFrame changes are needed for this in
particular, since we're only distributing across two items (min and max
are useful only if we can distribute the space that one item can't fill
with another), but it doesn't hurt.
Differential Revision: https://phabricator.services.mozilla.com/D158074
This patch doesn't change behavior; it just formalizes the refcounting that
we're already doing for this variable by using the RefPtr type.
Differential Revision: https://phabricator.services.mozilla.com/D157683