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

4142 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 5730ee0ca5 Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Emilio Cobos Álvarez 2efe17814f Bug 1860666 - Add pref-gated ::slider-* pseudo-elements, and some tests. r=layout-reviewers,jfkthame
We fail some because we right now we have a track pseudo for meter/progress.

I plan to fix this, but a lot of these frame classes are basically copy-pasta,
so I wanted to get rid of them first.

Differential Revision: https://phabricator.services.mozilla.com/D192097
2023-10-30 15:15:24 +00:00
Emilio Cobos Álvarez 07b0055ecc Bug 1861027 - Handle editor readonly mask update based on element state instead of attributes. r=masayuki
An element can be disabled even if it doesn't have the disabled
attribute.

Differential Revision: https://phabricator.services.mozilla.com/D191947
2023-10-27 08:31:29 +00:00
Emilio Cobos Álvarez 4dcca913a5 Bug 1861027 - Make nsTextControlFrame -> TextControlElement casts less verbose. r=masayuki
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D191946
2023-10-27 08:31:29 +00:00
Tom Marble 0cb91fe33e Bug 1855300 - convert .ini manifests to .toml: batch 11 remaining **/mochitest.ini r=jmaher,geckoview-reviewers,extension-reviewers,valentin,credential-management-reviewers,cookie-reviewers,sgalich,m_kato,robwu
Differential Revision: https://phabricator.services.mozilla.com/D190515
2023-10-13 02:32:24 +00:00
Jan Varga c458754592 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Markus Stange 1797b920c8 Bug 1853712 - Allow blob image recording for nsDisplayButtonBorder. r=nical
These only paint inner box shadows and borders, both of which we support with
WR display items, so we probably never hit fallback rendering for this and don't
call this method. But in case we do, it should be fine to use blob rendering
for it these days.

Depends on D188490

Differential Revision: https://phabricator.services.mozilla.com/D188491
2023-09-25 23:36:27 +00:00
Ting-Yu Lin 0319ff2c6b Bug 1854424 - Add a LogicalMargin method returning an offset to start-sides. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D188847
2023-09-22 15:39:25 +00:00
Ting-Yu Lin 2b2646bd48 Bug 1853090 - Add ContentISize() and ContentBSize() convenience methods to nsIFrame. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D188157
2023-09-14 18:13:17 +00:00
Emilio Cobos Álvarez d12231ae7a Bug 1852457 - Simplify nsITheme::ThemeWantsButtonInnerFocusRing(). r=jfkthame,layout-reviewers
In practice, this is only ever true on the native windows theme. All
other themes return true for ThemeDrawsFocusForWidget for Button and
Menulist, which are the relevant appearance values here. So make this
more explicit.

Differential Revision: https://phabricator.services.mozilla.com/D187856
2023-09-14 09:46:42 +00:00
Tom Marble 9e40a719f2 Bug 1850545 - convert .ini manifests to .toml: batch 3 chrome.ini (bis) r=jmaher,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,places-reviewers,profiler-reviewers,m_kato,mak,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D187597
2023-09-13 18:28:32 +00:00
Emilio Cobos Álvarez aefd1ddb30 Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +00:00
Emilio Cobos Álvarez 52d097c513 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
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
2023-09-07 11:46:30 +00:00
Narcis Beleuzu 77ba6cde90 Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez 59766eeba4 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
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
2023-09-06 22:34:35 +00:00
Olli Pettay dd6135f330 Bug 1850712 - Remove unused nsCheckboxRadioFrame::GetCurrentCheckState, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187104
2023-08-30 14:07:32 +00:00
Markus Stange 3d20b7df6c Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the nsContentUtils::Dispatch methods. r=smaug
This saves a few queryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186976
2023-08-28 23:38:42 +00:00
Sean Feng 4379a8876c Bug 1848409 - Tweak the UpdateDefaultPreventedOnContent call to only special case the HTMLEditorEventListener case r=masayuki,dom-core
Calling `UpdateDefaultPreventedOnContent` separately from
`PreventDefault()` is error-prone. This patch should make it
safer.

Differential Revision: https://phabricator.services.mozilla.com/D186052
2023-08-15 13:46:42 +00:00
David Shin cc513776a4 Bug 1846982: Baseline calculation for textarea. r=emilio
Tests are added as tentative, because the behaviour when there's no content,
or when there's placeholder text, seem very differnt for each browser.

Differential Revision: https://phabricator.services.mozilla.com/D185958
2023-08-15 13:30:17 +00:00
Iulian Moraru e88ec18198 Backed out changeset 928b78db7b30 (bug 1846982) for causing reftest failures on display-block-baselines-3.html. CLOSED TREE 2023-08-11 23:26:38 +03:00
David Shin 2b3acf83b0 Bug 1846982: Baseline calculation for textarea. r=emilio
Tests are added as tentative, because the behaviour when there's no content,
or when there's placeholder text, seem very differnt for each browser.

Differential Revision: https://phabricator.services.mozilla.com/D185958
2023-08-11 19:24:32 +00:00
Sean Feng 117b1123ce Bug 1847363 - Add the missing UpdateDefaultPreventedOnContent call for nsFileControlFrame r=masayuki
Without setting mDefaultPreventedOnContent, the dragSession could
be considered as Chrome only.

Differential Revision: https://phabricator.services.mozilla.com/D185844
2023-08-10 14:21:06 +00:00
Masayuki Nakano 0f39d7eda7 Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-07 01:03:58 +00:00
Cristian Tuns f5572b469f Backed out 2 changesets (bug 1266437, bug 1232918) for causing mochitest failures in test_autoplay_policy_key_blacklist.html CLOSED TREE
Backed out changeset 33e3c6593d4b (bug 1232918)
Backed out changeset 1b56e99dd221 (bug 1266437)
2023-08-03 23:29:52 -04:00
Masayuki Nakano 0664d98bce Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-04 00:10:11 +00:00
Jan-Niklas Jaeschke c84288a36d Bug 1838262, part 2: Implemented `getComputedStyle()` for custom highlight api. r=emilio
This patch introduces functional pseudo parameters, i.e. `::highlight(foo)`,
for `getComputedStyle()`. This required adapting the parse algorithm (`nsCSSPseudoElements::ParsePseudoElement()`) and forwarding the functional pseudo parameter into the style engine.

Differential Revision: https://phabricator.services.mozilla.com/D183773
2023-07-31 13:47:54 +00:00
Mathew Hodson 21cd613492 Bug 1564391 - Rename internal uses of `mozInputSource`. r=emilio,pip-reviewers,tabbrowser-reviewers,dao,kpatenio
This allows us to deprecate `mozInputSource` for the Web while
avoiding console warnings for internal uses, which now use the
ChromeOnly `inputSource` attribute.

Differential Revision: https://phabricator.services.mozilla.com/D183643
2023-07-26 09:27:45 +00:00
Emilio Cobos Álvarez 945ed5ad06 Bug 1842027 - Remove nsTextControlFrame::TextEquals. r=masayuki
It is always called from TextControlState, and always ends up in
TextControlState::ValueEquals, so we can avoid some indirection and just
use that.

Depends on D183282

Differential Revision: https://phabricator.services.mozilla.com/D183283
2023-07-12 08:58:09 +00:00
Emilio Cobos Álvarez 035b0a67ec Bug 1842027 - Remove always-true aIgnoreWrap parameter from TextControlElement::GetTextEditorValue. r=masayuki
Depends on D183281

Differential Revision: https://phabricator.services.mozilla.com/D183282
2023-07-12 08:57:12 +00:00
Emilio Cobos Álvarez b543055b6e Bug 1842027 - Remove dead nsTextControlFrame::GetText. r=masayuki
Depends on D183254

Differential Revision: https://phabricator.services.mozilla.com/D183281
2023-07-12 08:56:25 +00:00
Jonathan Kew 7d604d33db Bug 1802687 - Account for direction:rtl in vertical writing-mode <input type=range> controls. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171375
2023-07-08 13:19:45 +00:00
Iulian Moraru 2ab699d457 Backed out changeset 2a8a95dd8ab8 (bug 1802687) for causing wpt failures on range-snap-to-tick-marks-03.html. 2023-07-08 07:12:57 +03:00
Jonathan Kew d43d8f20e1 Bug 1802687 - Account for direction:rtl in vertical writing-mode <input type=range> controls. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171375
2023-07-07 17:36:36 +00:00
Noemi Erli e6aff2fa18 Backed out changeset 811d8bd2f7f9 (bug 1802687) for causing failures in range-vlr.html CLOSED TREE 2023-07-07 19:32:17 +03:00
Jonathan Kew b6a6adf468 Bug 1802687 - Account for direction:rtl in vertical writing-mode <input type=range> controls. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171375
2023-07-07 15:22:12 +00:00
Kershaw Chang 705e17a537 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-28 13:21:00 +00:00
Norisz Fay 07a91b8c6a Backed out 2 changesets (bug 1838829) for causing perma mochitest failure with dom/websocket/tests being skipped CLOSED TREE
Backed out changeset 19a5d4f1850a (bug 1838829)
Backed out changeset 97cd8a256954 (bug 1838829)
2023-06-27 02:52:52 +03:00
Kershaw Chang 75c68b6864 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-26 14:22:14 +00:00
Emilio Cobos Álvarez 4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Norisz Fay e86f1fa0e9 Backed out 5 changesets (bug 1838829) for causing mochitest failures CLOSED TREE
Backed out changeset 693d34c8447d (bug 1838829)
Backed out changeset 903d9ff4afaa (bug 1838829)
Backed out changeset 5e51feff7467 (bug 1838829)
Backed out changeset e125be49d2a6 (bug 1838829)
Backed out changeset 1a8cf3c83dc4 (bug 1838829)
2023-06-22 03:37:07 +03:00
Kershaw Chang 2cdb6b3a96 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-21 19:43:33 +00:00
Emilio Cobos Álvarez 9ac32645f7 Bug 1837382 - Remove nsIContent::IsDoneAddingChildren. r=smaug
It's only called once for a place where it knows it's a select element.

Differential Revision: https://phabricator.services.mozilla.com/D180312
2023-06-08 14:59:31 +00:00
David Shin 267a479339 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-17 12:56:54 +00:00
Sandor Molnar 71c2b3db49 Backed out 3 changesets (bug 1809568) for causing build bustages in layout/generic/nsLineLayout.cpp CLOSED TREE
Backed out changeset 6c5bbcbafce9 (bug 1809568)
Backed out changeset b518133a5c34 (bug 1809568)
Backed out changeset 2407088e9b49 (bug 1809568)
2023-05-17 01:34:42 +03:00
David Shin 1eefa9a516 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 20:48:18 +00:00
Sandor Molnar a50a2052fe Backed out 3 changesets (bug 1809568) for causing node devtools failures in devtools/client/debugger/src/components/test/QuickOpenModal.spec.js CLOSED TREE
Backed out changeset 56ce741da8f5 (bug 1809568)
Backed out changeset 5a91ce4870e4 (bug 1809568)
Backed out changeset cc00422f050a (bug 1809568)
2023-05-16 22:22:31 +03:00
David Shin 30a10fdbc6 Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-16 19:02:11 +00:00
Cristian Tuns 4d57ea669d Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp CLOSED TREE
Backed out changeset e862b1560caa (bug 1809568)
Backed out changeset 0a20b91de67b (bug 1809568)
Backed out changeset 6060fc7d49d4 (bug 1809568)
2023-05-15 13:03:03 -04:00
David Shin c4f2c2237b Bug 1809568 - Part 2: Provide `GetNaturalBaselineBOffset` with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-15 14:34:26 +00:00
Jonathan Kew 80bd914f0b Bug 1782385 - Improve sizing heuristics in nsTextControlFrame::CalcIntrinsicSize. r=emilio
This is somewhat arbitrary, as the behavior of the 'size' attribute is not clearly specified
for non-fixed-width fonts where "character width" is a vague concept. So there's no absolute
"right" or "wrong" result, but there are cases where our current behavior feels quite wrong
to authors.

There are two adjustments here that aim to make the behavior more consistent and predictable.
First, rather than using the font's "average" char width (which is itself not a clearly-
defined or reliably-set metric) as the basic multiplier for the 'size' attribute, prefer
to use the width of the zero glyph (0), if present. This makes size-attribute-based input
fields behave more consistently with fields sized using the CSS 'ch' unit, rather than
having apparently-random inconsistencies between the two.

Second, the existing code adds a "padding" factor based on the font's maxAdvance, but this
can be quite excessive with modern fonts, where there may be outliers such as logo glyphs
or long ligatures that are much wider than typical characters. E.g. the macOS system font
has a triple-em-dash ligature; or the Ubuntu font, which declares an advanceWidthMax of
3511 units, although the widest glyph I can find is the "ffl" ligature with a width of 1053
units.

To limit the effect that such outliers (or incorrect metadata) can have, I'm proposing to
clamp the "max" width that we use here to twice the "char width" derived from the zero glyph
or the font's declared average. So we're still doing the "IE-like" addition of some extra
width when using non-fixed-space fonts, but it won't become as huge as it currently does
in some cases (depending on font details).

Differential Revision: https://phabricator.services.mozilla.com/D176922
2023-05-09 14:49:08 +00:00