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

3926 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert ea243fb10a Bug 1672640 part 3: Adjust GetNaturalBaselineBOffset implementations to bail (report no baseline) if the frame has 'contain:layout'. r=TYLin
Some of our GetNaturalBaselineBOffset implementations already have this; others
don't.  But they all should have it, or else a caller might improperly query
their baseline and use it for layout despite the frame having 'contain:layout'.

Without this patch, the rest of this patch-stack makes us fail WPT test
contain-layout-suppress-baseline-002.html because we improperly honor the
baseline for the 'contain:layout' buttons at the top of the test.

Differential Revision: https://phabricator.services.mozilla.com/D121938
2021-08-06 18:46:22 +00:00
Emilio Cobos Álvarez 77c4eb5db9 Bug 1723709 - Ignore line-height in the inside of the datetimebox when there's a fixed height specified. r=layout-reviewers,jfkthame
But use it when we're intrinsically sized. This matches other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D121616
2021-08-03 13:57:13 +00:00
Ting-Yu Lin 8b74ff00e0 Bug 1716212 Part 2 - Carry nsComboboxControlFrame's line-height to nsComboboxDisplayFrame when it has auto block-size. r=emilio
The issue is that combobox display may contain some non-Latin characters
that need extra block-size to display than the one line-height
calculate by using a Latin font spec in combobox control's style.

Before this patch, when a combobox control has unconstrained block-size,
we set combobox display's block-size to combobox control's one
line-height in Reflow(), which is intended to properly initialize
`BlockReflowInput::mMinLineHeight` since combobox display has
`line-height:-moz-block-height`. However, this simply prevents the
combobox display from choosing a larger block-size after the reflow. See
bug 1716212 comment 11 for an analysis.

This patch fixes the issue by carrying combox control's computed line
height to combobox display so that its computed block-size is still
unconstrained so that it can accommodate taller characters in the
display text.

After this patch, <select><option> containing non-Latin characters
should have the same block-size as <button>, and no characters should be
clipped. Modified test_unstyled_control_height.html to test this.

Differential Revision: https://phabricator.services.mozilla.com/D120877
2021-07-28 18:41:19 +00:00
Ting-Yu Lin 77a7201399 Bug 1722356 - Cleanup the logic computing button's rect in nsComboboxControlFrame. r=emilio
This shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D120868
2021-07-26 21:14:42 +00:00
Miko Mynttinen 76c9644105 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-19 11:28:20 +00:00
Alexandru Michis fbd939b860 Backed out 2 changesets (bug 1720804) for causing bustages.
CLOSED TREE

Backed out changeset 5278e88c6d34 (bug 1720804)
Backed out changeset 1acb4ed79b6b (bug 1720804)
2021-07-16 18:10:11 +03:00
Miko Mynttinen ffc501ddc9 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-16 14:36:34 +00:00
Masayuki Nakano 02417e6be6 Bug 1720405 - part 1: Get rid of the pref check of `dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content` from the tests r=smaug
Its default value is `true` and it will never be reverted in release builds
by default.  Therefore, we can get rid of it from the tests unless testing
non-default behavior.

Differential Revision: https://phabricator.services.mozilla.com/D119849
2021-07-14 10:59:03 +00:00
Masayuki Nakano 04b41051dd Bug 1665550 - part 4: Make `EventStateManager` update `mGestureDownFrameOwner` when anonymous nodes in `<input>` or `<textarea>` are replaced r=smaug
`EventStateManager` gives up to track gesture to start a drag if mouse down
content which is stored in `mGestureDownFrameOwner` gets lost its primary frame.

When user tries to start to drag selected text in `<input>` or `<textarea>`
element, mouse down content is an anonymous node in `TextControlElement`. So,
if a reflow occurs after `mousedown` event, the anonymous `<div>` element
is replaced with new one and `EventStateManager` gives up to track it.

Therefore, this patch makes `EventStateManager` do similar things as
`nsBaseDragService`.  When `nsTextControlFrame` notifies of remove/add
the anonymous nodes, `EventStateManager` tries to keep tracking gesture with
a new anonymous node.

Differential Revision: https://phabricator.services.mozilla.com/D119488
2021-07-14 01:20:20 +00:00
Masayuki Nakano a171e12db6 Bug 1665550 - part 3: Make `nsTextControlFrame` set the source node and selection of drag session to new ones when it's reframed r=smaug
When `nsTextControlFrame` is reframed, `TextEditor`, anonymous `<div>`, its
`Text` and the independent `Selection`s are deleted temporarily and recreated
them.

If users are dragging text in `<input>` or `<textarea>`, the drag session's
source node is set to the anonymous text node in the element and the selection
is set to the independent selection.  So, if the element is reframed during a
drag, the source node is disconnected from the document and `EndDragSession`
failed to dispatch `eDragEnd` event.

Therefore, this patch makes `nsTextControlFrame` replaces the source node and
selection when it's recreated and only when the drag session's original source
node was in the text control element.  For checking which text control had the
anonymous text node, this patch makes `nsTextControlFrame` replaces source
node with the `<input>` or `<textarea>` element when the frame is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D119487
2021-07-14 01:20:19 +00:00
Ting-Yu Lin 2b6016cc06 Bug 1719555 Part 4 - Remove unused code subtracting block and padding from block-size for nsComboboxDisplayFrame. r=emilio
This patch removed the unused code which introduced by Bug 1571764
because Bug 1560824 moves the `padding-block` style to <select>'s UA
rule, so now `nsComboboxDisplayFrame` doesn't have any padding in the
block axis.

Differential Revision: https://phabricator.services.mozilla.com/D119342
2021-07-08 17:58:43 +00:00
Ting-Yu Lin e38cf9beb4 Bug 1719555 Part 3 - Replace virtual & override specifier with final for combobox frames. r=hiro
This patch is similar to Emilio's cleanup in Bug 1590278.

Differential Revision: https://phabricator.services.mozilla.com/D119341
2021-07-08 17:58:42 +00:00
Ting-Yu Lin 6ce994ccf2 Bug 1719555 Part 1 - Removed an unused #define in nsComboboxControlFrame.cpp. r=hiro
The usage was removed in bug 300030 [1] in the removed chunk between
line 563 and 564.

[1] https://searchfox.org/mozilla-central/diff/31f1898810f733c40bfe3fd4b25295885feb2e39/layout/forms/nsComboboxControlFrame.cpp#563

Differential Revision: https://phabricator.services.mozilla.com/D119339
2021-07-08 17:58:41 +00:00
Ting-Yu Lin d5fa6014e8 Bug 1494330 Part 3 - Remove nsComboboxControlFrame::mListControlFrame. r=layout-reviewers,boris
mListControlFrame is the same as mDropdownFrame. See SetDropDown().

Differential Revision: https://phabricator.services.mozilla.com/D119207
2021-07-07 03:11:06 +00:00
Ting-Yu Lin 12def93a1c Bug 1494330 Part 2 - Change nsComboboxControlFrame::mDropdownFrame's type to nsListControlFrame*. r=layout-reviewers,boris
This eliminates a lot of down casting from nsIFrame* to nsListControlFrame*.

Make SetDropDown() accepts nsListControlFrame* because
nsCSSFrameConstructor already passes the derived type in.

We'll replace mListControlFrame with mDropdownFrame in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D119206
2021-07-07 03:11:06 +00:00
Ting-Yu Lin 805a41942c Bug 1494330 Part 1 - Make NS_NewListControlFrame() return nsListControlFrame*. r=layout-reviewers,boris
Also, add nsListControlFrame to the forward declaration list in
nsHTMLParts, and sort them alphabetically.

Differential Revision: https://phabricator.services.mozilla.com/D119205
2021-07-07 03:11:06 +00:00
Masayuki Nakano 63d372da2f Bug 1676702 - part 2: Make `TextControlState` initialize `TextEditor` with `PasswordMaskData` r=m_kato
During a `TextControlState` alive, `PasswordMaskData` should be alive too.
Otherwise, we cannot keep unmasked range at reframing.

Depends on D118756

Differential Revision: https://phabricator.services.mozilla.com/D118757
2021-06-28 04:37:54 +00:00
Mats Palmgren e0fbda09f4 Bug 1699964 - [css-content] Implement 'content: none' for elements. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D114130
2021-06-23 02:52:42 +00:00
Kagami Sascha Rosylight 1a8150e79d Bug 1677253 - Part 2: Detect direction change in SelectionChangeEventDispatcher r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101246
2021-06-21 00:58:36 +00:00
Glenn Watson 4f5a747e61 Bug 1716925 - Remove use of DefineClip in ClipManager r=gfx-reviewers,jrmuizel
This removes the last use of DefineClip from Gecko, which will
allow removing and simplifying a lot of the clip handing code
during scene building in WR.

Differential Revision: https://phabricator.services.mozilla.com/D118121
2021-06-20 22:26:53 +00:00
Kagami Sascha Rosylight 673eb02a8f Bug 1713334 - Part 4: Always select the text node r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117474
2021-06-18 00:36:55 +00:00
Kagami Sascha Rosylight 8bbe7f3f11 Bug 1713334 - Part 1: Keep a text node inside text controls even if empty r=masayuki,Jamie
Doing so prevents confusion when detecting selection change.

Differential Revision: https://phabricator.services.mozilla.com/D116303
2021-06-18 00:36:53 +00:00
Ryan VanderMeulen 050b863666 Backed out 3 changesets (bug 1677253) because it depends on bug 1713334 which was backed out.
Backed out changeset 3d30a54409a7 (bug 1677253)
Backed out changeset 1c385b21e0e5 (bug 1677253)
Backed out changeset eb6001404a57 (bug 1677253)
2021-06-17 11:38:53 -04:00
Ryan VanderMeulen a337a14382 Backed out 5 changesets (bug 1713334) for causing bug 1716714.
Backed out changeset bd1c37ce2c61 (bug 1713334)
Backed out changeset 876ed18c5126 (bug 1713334)
Backed out changeset 5a4f4514d99a (bug 1713334)
Backed out changeset 7d7feef654c7 (bug 1713334)
Backed out changeset 61e15374e617 (bug 1713334)
2021-06-17 10:57:32 -04:00
Kagami Sascha Rosylight bbba56f5a1 Bug 1677253 - Part 2: Detect direction change in SelectionChangeEventDispatcher r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101246
2021-06-16 11:13:15 +00:00
Kagami Sascha Rosylight 7916262845 Bug 1713334 - Part 4: Always select the text node r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117474
2021-06-14 19:56:23 +00:00
Kagami Sascha Rosylight 52d022e717 Bug 1713334 - Part 1: Keep a text node inside text controls even if empty r=masayuki,Jamie
Doing so prevents confusion when detecting selection change.

Differential Revision: https://phabricator.services.mozilla.com/D116303
2021-06-14 19:56:22 +00:00
Csoregi Natalia 85bb87115a Backed out 5 changesets (bug 1713334) for failures on test_texteditor_keyevent_handling.html. CLOSED TREE
Backed out changeset ab7b2061f5e8 (bug 1713334)
Backed out changeset f4032094748d (bug 1713334)
Backed out changeset 858410646bf7 (bug 1713334)
Backed out changeset 875b520387b8 (bug 1713334)
Backed out changeset 78b0cdebc890 (bug 1713334)
2021-06-14 20:58:37 +03:00
Kagami Sascha Rosylight ca55613fb3 Bug 1713334 - Part 4: Always select the text node r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117474
2021-06-14 13:08:33 +00:00
Kagami Sascha Rosylight b327288d9d Bug 1713334 - Part 1: Keep a text node inside text controls even if empty r=masayuki,Jamie
Doing so prevents confusion when detecting selection change.

Differential Revision: https://phabricator.services.mozilla.com/D116303
2021-06-14 13:08:32 +00:00
Emilio Cobos Álvarez 2b0eae6061 Bug 1715134 - Make form control type an enum class. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D117087
2021-06-08 09:43:59 +00:00
Kartikaya Gupta 9020180bb9 Bug 1714884 - Have the Rollup method take a strongly-typed int point. r=emilio
Depends on D116948

Differential Revision: https://phabricator.services.mozilla.com/D116949
2021-06-07 01:01:10 +00:00
Edgar Chen 1ebbd60592 Bug 1685421 - Part 2: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in nsINode; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113344
2021-06-02 13:43:39 +00:00
Kagami Sascha Rosylight c4af1367d8 Bug 1712834 - Adjust caret frame for a significant terminal newline r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D116155
2021-05-29 12:01:30 +00:00
Andi-Bogdan Postelnicu 1cf28e7475 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D115804
2021-05-24 15:08:47 +00:00
Matt Woodrow 195a7e86e5 Bug 1540737 - Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Differential Revision: https://phabricator.services.mozilla.com/D114676
2021-05-19 01:11:32 +00:00
Csoregi Natalia 1f3f5df2ce Backed out 8 changesets (bug 1540737) for causing graphics crashes in Bug 1711718. a=backout
Backed out changeset 37628894ffd5 (bug 1540737)
Backed out changeset 4b5f53d5127b (bug 1540737)
Backed out changeset a73e041f1f1d (bug 1540737)
Backed out changeset 81f1a9d1a5e1 (bug 1540737)
Backed out changeset b3d0cc460b24 (bug 1540737)
Backed out changeset f929de495b87 (bug 1540737)
Backed out changeset 2f5b8369d061 (bug 1540737)
Backed out changeset b4c93d182ef4 (bug 1540737)
2021-05-18 19:06:20 +03:00
Matt Woodrow 21836c0689 Bug 1540737 - Implement Paint() for all display items, and nsDisplayList so that we can paint without using FrameLayerBuilder. r=miko
This creates a new leaf nsDisplayWrapper item for consumers that just want an empty wrapper, with a Paint method that asserts. This lets us leaves Paint pure-virtual on nsDisplayWrapList, and lets the compiler force us to implement it for the other leaf types.

It also disables flattening of transform/opacity items. This is because they flatten the items even when used with FlattenedDisplayItemIterator, even though this doesn't add markers to replace them (only FLB does this). We could in theory fix this, but I don't think FLB performance matters much any more.

Differential Revision: https://phabricator.services.mozilla.com/D114676
2021-05-17 23:53:45 +00:00
Ting-Yu Lin 91b3a53395 Bug 1709491 Part 1 - Add SizeComputationInput::ComputedLogicalBorder(), and adapt callers. r=dholbert
The helper is going to be used in a later part.

I don't add the physical version ComputedPhysicalBorder() deliberately
because I don't want to promote the usage of physical coordinate.

Differential Revision: https://phabricator.services.mozilla.com/D114544
2021-05-12 06:32:40 +00:00
Glenn Watson b9eaec8657 Bug 1709983 - Pt 4 - Remove DefineClip use from nsFieldSetFrame r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D114568
2021-05-10 20:10:13 +00:00
Emilio Cobos Álvarez 8fb52356f4 Bug 1708303 - Fix scroll-margin implementation. r=hiro
So that margin is not included in the rect for visibility calculations,
and padding and margin are accounted properly on them.

Differential Revision: https://phabricator.services.mozilla.com/D113853
2021-05-06 00:54:14 +00:00
Emilio Cobos Álvarez 38251f50b8 Bug 1707070 - Tweak text/number/search control anonymous tree DOM / paint order. r=dholbert
So that we hit-test the spinners even if they overlap with the editor
root's padding.

Differential Revision: https://phabricator.services.mozilla.com/D113251
2021-04-26 16:55:32 +00:00
Emilio Cobos Álvarez 390c6943fe Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 12:22:14 +00:00
Narcis Beleuzu e9fb777466 Backed out changeset 597b9606c3ca (bug 1702676) for reftest failures on mq_prefers_reduced_motion_reduce.html CLOSED TREE 2021-04-02 09:34:53 +03:00
Emilio Cobos Álvarez f7f84a3c53 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 00:21:37 +00:00
Emilio Cobos Álvarez a3ed542a92 Bug 1698606 - Remove stray printf. DONTBUILD
MANUAL PUSH: Silly printf debugging removal in a CLOSED TREE
2021-03-31 21:53:09 +02:00
Emilio Cobos Álvarez 2714f19afd Bug 1698606 - Ensure baseline for text and date controls matches. r=jwatt
Ideally nsDateTimeControlFrame should / could inherit from
nsTextControlFrame, but this should do for now.

Test also covers the previous patch.

Differential Revision: https://phabricator.services.mozilla.com/D110076
2021-03-31 12:21:17 +00:00
Emilio Cobos Álvarez 76502ee6b0 Bug 1698477 - Prevent spin buttons from creating overflow. r=dholbert
This matches pre-existing behavior.

Differential Revision: https://phabricator.services.mozilla.com/D108608
2021-03-16 22:08:48 +00:00
Emilio Cobos Álvarez f5a4b965f6 Bug 1698821 - Remove dead GetNumberControlFrameForTextField. r=dholbert
There's no anonymous textfield since a long time ago.

Differential Revision: https://phabricator.services.mozilla.com/D108655
2021-03-16 21:53:20 +00:00
Emilio Cobos Álvarez 3df7550e39 Bug 1698821 - Fix GetNumberControlFrameForSpinButton. r=dholbert
It broke with bug 1698043 because we removed one wrapper.

Differential Revision: https://phabricator.services.mozilla.com/D108654
2021-03-16 21:53:20 +00:00