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

273 Коммитов

Автор SHA1 Сообщение Дата
Haik Aftandilian 0a19d8eeb2 Bug 1592416 - Right click opens context menu on wrong monitor or virtual desktop (mac OS Catalina) r=spohl
Add the NSWindowCollectionBehaviorMoveToActiveSpace behavior to nsCocoaWindow
popups so that they override the "Assign To" space setting and display on the
active space.

This also addresses bug 1589893 where, when "Assign To" space is used, popup
menus are not visible in full screen mode.

With mutiple displays, recreate the popup widget each time it is displayed
to workaround a problem where the re-shown popup appears on the "Assign To"
display instead of the current display.

Differential Revision: https://phabricator.services.mozilla.com/D75419
2020-05-28 04:00:02 +00:00
Razvan Maries c2dda9f2ae Backed out changeset 854feb05fff6 (bug 1592416) for assertion failures. CLOSED TREE 2020-05-28 03:42:16 +03:00
Haik Aftandilian 76c2f2d30d Bug 1592416 - Right click opens context menu on wrong monitor or virtual desktop (mac OS Catalina) r=spohl
Add the NSWindowCollectionBehaviorMoveToActiveSpace behavior to nsCocoaWindow
popups so that they override the "Assign To" space setting and display on the
active space.

This also addresses bug 1589893 where, when "Assign To" space is used, popup
menus are not visible in full screen mode.

With mutiple displays, recreate the popup widget each time it is displayed
to workaround a problem where the re-shown popup appears on the "Assign To"
display instead of the current display.

Differential Revision: https://phabricator.services.mozilla.com/D75419
2020-05-27 22:41:34 +00:00
Emilio Cobos Álvarez 54fd961a29 Bug 1641245 - Make string comparators not virtual. r=froydnj,necko-reviewers,geckoview-reviewers,jgilbert,agi,valentin
There's no use case for stateful comparators, so they can be just plain
function pointers.

This is used in some hot places like CSS selector matching.

Differential Revision: https://phabricator.services.mozilla.com/D77084
2020-05-27 18:11:12 +00:00
Butkovits Atila 8a87d1b582 Backed out changeset 09ccf334001b (bug 1592416) for causing bug 1640077 to fail. 2020-05-22 09:37:16 +03:00
Haik Aftandilian 624ed03701 Bug 1592416 - Right click opens context menu on wrong monitor or virtual desktop (mac OS Catalina) r=spohl
Add the NSWindowCollectionBehaviorMoveToActiveSpace behavior to nsCocoaWindow
popups so that they override the "Assign To" space setting and display on the
active space.

This also addresses bug 1589893 where, when "Assign To" space is used, popup
menus are not visible in full screen mode.

With mutiple displays, recreate the popup widget each time it is displayed
to workaround a problem where the re-shown popup appears on the "Assign To"
display instead of the current display.

Differential Revision: https://phabricator.services.mozilla.com/D75419
2020-05-21 00:09:32 +00:00
Kristen Wright 9a760db959 Bug 1626386 - Convert ui.menu.incremental_search.timeout to a static pref r=emilio
Converts `ui.menu.incremental_search.timeout` to a static pref and replaces macros related to the incremental search timeout with the actual pref, so that they are kept in sync without the need to manually update any macros. The two `.xml` files mentioned in the note were nowhere to be found, so this patch makes the assumption that those do not exist anymore and do not need to be kept in sync.

Differential Revision: https://phabricator.services.mozilla.com/D75182
2020-05-19 20:56:06 +00:00
Jan Horak 582ea4cda5 Bug 1637948 Don't resize popup on hidpi when not needed r=stransky
We have to compare new width and height multiplied by scale because mBounds is in
real pixels while gdk_window_move_to_rect returns the size without multiplying
by scale factor.

Also to fix overflow popups we need to use NativeMoveResize in nsWindow::ResizeInt
when size of the popup has changed.

Differential Revision: https://phabricator.services.mozilla.com/D75298
2020-05-19 15:34:18 +00:00
sotaro 230d8f88ed Bug 1635769 - Call WebRenderLayerManager::ClearCachedResources() during re-creating widget r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D74392
2020-05-09 05:44:37 +00:00
Sylvestre Ledru 34acbb653a Bug 1619165 - Reformat recent changes to the Google coding style r=andi
First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
2020-04-25 09:40:08 +00:00
Botond Ballo 5ecfef966e Bug 1629732 - Fix non-unified build errors in layout/xul. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D71847
2020-04-22 00:11:22 +00:00
Jan Horak 2cc879bea5 Bug 1623974 [wayland] Attach popups to anchor rects; r=stransky
If we want correct popup placement we need to use the right anchor rect
for gdk_window_move_to_rect under Wayland. Patch exports the anchor rect from the
nsMenuPopupFrame to be used in nsWindow.

This patch also fixes popup overflowing the screen by using the size returned from
gdk_window_move_to_rect for the nsMenuPopupFrame.

Differential Revision: https://phabricator.services.mozilla.com/D67810
2020-04-21 19:19:30 +00:00
Kagami Sascha Rosylight 502cb439da Bug 1630704 - Merge nsBox into nsIFrame r=emilio
We want to merge nsFrame into nsIFrame, so this patch merges nsBox first which is the superclass of nsFrame.

Differential Revision: https://phabricator.services.mozilla.com/D71161
2020-04-18 12:06:09 +00:00
Mihai Alexandru Michis 25a1d0163b Backed out changeset 86630db403c1 (bug 1623974) for causing failures in browser_toolbox_zoom_popup.js and in wpt.
CLOSED TREE
2020-04-20 18:07:23 +03:00
Jan Horak 5664a8f139 Bug 1623974 [wayland] Attach popups to anchor rects; r=stransky
If we want correct popup placement we need to use the right anchor rect
for gdk_window_move_to_rect under Wayland. Patch exports the anchor rect from the
nsMenuPopupFrame to be used in nsWindow.

This patch also fixes popup overflowing the screen by using the size returned from
gdk_window_move_to_rect for the nsMenuPopupFrame.

Differential Revision: https://phabricator.services.mozilla.com/D67810
2020-04-20 12:50:25 +00:00
Emilio Cobos Álvarez cd014b922b Bug 1629096 - Honor scroll-padding / margin in ns{ListControl,MenuPopup}Frame. r=hiro
Kinda drive-by, but I think this is sane and not risky... This is used for
<select size> / <select multiple>, and only scrolls the option into view (it
only scrolls a single scroll frame, the one inside the <select>).

If the author specifies scroll-padding / margin in there I don't see why we
shouldn't respect it when doing key selection / navigation / etc.

Same for menupopups (though those are even less risky because we control the CSS
there).

Differential Revision: https://phabricator.services.mozilla.com/D70543

--HG--
extra : moz-landing-system : lando
2020-04-10 21:34:22 +00:00
Bogdan Tara 09fa9dbc7c Backed out changeset 61cc7740daa3 (bug 1623974) for bustages related to nsWindow.cpp CLOSED TREE 2020-03-30 17:23:10 +03:00
Jan Horak 75273113e5 Bug 1623974 [wayland] Attach popups to anchor rects; r=stransky
If we want correct popup placement we need to use the right anchor rect
for gdk_window_move_to_rect under Wayland. Patch exports the anchor rect from the
nsMenuPopupFrame to be used in nsWindow.

This patch also fixes popup overflowing the screen by using the size returned from
gdk_window_move_to_rect for the nsMenuPopupFrame.

Differential Revision: https://phabricator.services.mozilla.com/D67810

--HG--
extra : moz-landing-system : lando
2020-03-30 13:29:47 +00:00
Ting-Yu Lin bb0d044a16 Bug 1613732 Part 2 - Remove unused ReflowChildFlags::NoVisibility. r=dholbert
This bit is set, but no function uses it.

Differential Revision: https://phabricator.services.mozilla.com/D61886

--HG--
extra : moz-landing-system : lando
2020-02-07 04:17:33 +00:00
Tetsuharu OHZEKI 77e9510fb3 Bug 1597486 - Fix uses of nsIDocShellTreeItem in nsMenuPopupFrame::Init(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61426

--HG--
extra : moz-landing-system : lando
2020-02-03 08:00:45 +00:00
jeffin143 4298d3f098 Bug 1601990 : convert NS_STYLE_POINTER_EVENTS_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D56203

--HG--
extra : moz-landing-system : lando
2019-12-12 10:24:16 +00:00
Gabriele Svelto 69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Boris Zbarsky 75124bdd98 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067

--HG--
extra : moz-landing-system : lando
2019-12-05 04:44:32 +00:00
jeffin143 7868d04683 Bug 1597893 : convert NS_STYLE_WINDOW_SHADOW_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53920

--HG--
extra : moz-landing-system : lando
2019-11-25 16:00:23 +00:00
Tim Nguyen 9b84d66049 Bug 1597120 - Support dynamic changes to CSS pointer-events on nsMenuPopupFrame. r=karlt,jmathies,mstange,emilio
Differential Revision: https://phabricator.services.mozilla.com/D53379

--HG--
extra : moz-landing-system : lando
2019-11-22 13:14:37 +00:00
Tim Nguyen 65fd34c86b Bug 1597120 - Make nsMenuPopupFrame read pointer-events: none; instead of mousethrough attribute. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53347

--HG--
extra : moz-landing-system : lando
2019-11-22 13:14:06 +00:00
Timothy Nikkel e536dac456 Bug 1598488. Fix nsMenuPopupFrame::GetWidget. r=emilio
It can return the root widget if the menu popup frame doesn't have a widget. None of the callers want this.

Differential Revision: https://phabricator.services.mozilla.com/D54258

--HG--
extra : moz-landing-system : lando
2019-11-22 10:38:20 +00:00
Razvan Maries 8520cc6954 Backed out changeset dce49f743139 (bug 1597893) for build bustages on nsCocoaWindow.mm. CLOSED TREE 2019-11-22 14:50:12 +02:00
jeffin143 6967337237 Bug 1597893 : convert NS_STYLE_WINDOW_SHADOW_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53920

--HG--
extra : moz-landing-system : lando
2019-11-21 16:52:06 +00:00
Bogdan Tara 6aae1c4aaa Backed out changeset 726c8aa10d1a (bug 1597893) for bustages complaining about nsCocoaWindow.h CLOSED TREE 2019-11-21 15:35:09 +02:00
jeffin143 9f50df6c78 Bug 1597893 : convert NS_STYLE_WINDOW_SHADOW_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D53920

--HG--
extra : moz-landing-system : lando
2019-11-21 12:09:03 +00:00
Emilio Cobos Álvarez 3088e153e5 Bug 1597160 - Remove nsChangeHint_UpdateWidgetProperties. r=mstange
:ntim was about to add another widget-affecting property (pointer-events) to
menupopups to replace the mousethrough attribute, see bug 1597120.

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D53377

--HG--
extra : moz-landing-system : lando
2019-11-20 02:37:06 +00:00
Brian Grinstead f19f38776b Bug 1593119 - unifdef MOZ_XBL r=bzbarsky
This was generated with:

```
rg -l -g '*.{cpp,h}' MOZ_XBL . | while read FILE ; do
   echo $FILE
   unifdef -m -UMOZ_XBL $FILE
done
```

After this, I manually removed the directive in nsContentUtils.cpp due to:

  unifdef: ./dom/base/nsContentUtils.cpp: 4630: Unterminated string literal
  unifdef: Output may be truncated

Differential Revision: https://phabricator.services.mozilla.com/D51337

--HG--
extra : moz-landing-system : lando
2019-11-07 00:35:13 +00:00
Jan Horak 3f10c3b905 Bug 1589601 - Return the fallback to primary monitor on Wayland to not break PIP; r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D51600

--HG--
extra : moz-landing-system : lando
2019-11-05 08:14:18 +00:00
Jan Horak 5c3ec14301 Bug 1589541 Don't consider headless display as wayland; r=stransky
This fixes the related test failures.

Differential Revision: https://phabricator.services.mozilla.com/D49744

--HG--
extra : moz-landing-system : lando
2019-10-18 13:56:44 +00:00
Jan Horak 4d0cec02a5 Bug 1565401 - return valid screen size on multimonitor setup under Wayland; r=stransky,NeilDeakin
By getting the right screen size we can shrink the popup menus which overflows
the screen size under Wayland. The ScreenManager does not help us, because we
can't get absolute window position, but we can use gdk_display_get_monitor_at_window
and gdk_monitor_get_workarea to get the correct screen rectangle.

Differential Revision: https://phabricator.services.mozilla.com/D49289

--HG--
extra : moz-landing-system : lando
2019-10-17 11:27:08 +00:00
Cosmin Sabou e1278bb139 Backed out changeset 23e9fe8a919b (bug 1565401) for causing build bustages on nsWindow.h. CLOSED TREE 2019-10-16 18:45:09 +03:00
Jan Horak e2b9bdb35e Bug 1565401 - return valid screen size on multimonitor setup under Wayland; r=stransky,NeilDeakin
By getting the right screen size we can shrink the popup menus which overflows
the screen size under Wayland. The ScreenManager does not help us, because we
can't get absolute window position, but we can use gdk_display_get_monitor_at_window
and gdk_monitor_get_workarea to get the correct screen rectangle.

Differential Revision: https://phabricator.services.mozilla.com/D49289

--HG--
extra : moz-landing-system : lando
2019-10-16 13:03:43 +00:00
Brendan Dahl c68cd30ef2 Bug 1510785 - Only build XBL related code when MOZ_XBL is defined. r=bzbarsky
When XBL is disabled, no code in dom/xbl will be built. Also, adds ifdefs
to remove any of the XBL related code elsewhere. There's definitely more
that can be done here, but I think it's better to wait to do the rest of
the cleanup when we actually remove the code.

Depends on D45612

Differential Revision: https://phabricator.services.mozilla.com/D45613

--HG--
extra : moz-landing-system : lando
2019-10-08 23:52:14 +00:00
Alexander Surkov e670b51391 Bug 1582590 - Clean up unused <textbox type='autocomplete'> platform code. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D46541

--HG--
extra : moz-landing-system : lando
2019-10-03 11:18:53 +00:00
L. David Baron 1488be9417 Bug 1571250 - Convert flags passed to ReflowChild, FinishReflowChild, SyncFrameViewAfterReflow and from GetXULLayoutFlags / GetLayoutFlags into an enum class. r=TYLin
It seems better to convert this before adding a new flag (in bug
1547759) and risking replacing the wrong 0 with a flag.

Differential Revision: https://phabricator.services.mozilla.com/D40562

--HG--
extra : moz-landing-system : lando
2019-08-08 19:48:19 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Andrew Swan c98f8ba33c Bug 1519577 Remove support for unused toolbarbutton anchor attribute r=NeilDeakin
This code contains an undesirable dependency between the layout code and
the implementation of toolbarbutton.  Since it isn't actually used anywhere
by the firefox UI, remove it here.

Differential Revision: https://phabricator.services.mozilla.com/D31939

--HG--
extra : rebase_source : 663776a71d658e782650e85c6c27716f0c8736d8
2019-05-14 13:08:53 -07:00
Martin Stransky 89dd37e531 Bug 1539471 - [wayland] Track active popup windows on Wayland and use dynamic popup hierarchy, r=ashie
In order to show all popups on Wayland we need to set popup parent runtime for popups which don't have
fixed parent. For instance popup menus (fired after right button mouse click) can be issued on top of another popup
and we need to follow that connection on Wayland.

We track all open (active) popups to:

- close all visible tooltip windows when we're going to open another tooltip
- close concurrent popup on the same level when a new one is about to open
- get latest active popup as a parent for a new tooltip windows
- get latest active popup as a parent for a new popup menu without fixed parent

Differential Revision: https://phabricator.services.mozilla.com/D29348

--HG--
extra : moz-landing-system : lando
2019-05-07 11:28:04 +00:00
Masayuki Nakano 780b285e68 Bug 1543315 - part 15: Mark PresShell::ScrollFrameRectIntoView() as MOZ_CAN_RUN_SCRIPT r=smaug
Unfortunately, `EventChainVisitor` does not grab the `nsPresContext` with
`RefPtr` by itself.  Therefore, there is no guarantee of the lifetime without
checking the origin when its subclasses are instantiated.  This patch changes
it and subclasses to `MOZ_STACK_CLASS` since only `EventDispatcher::Dispatch()`
creates them in the stack with given `nsPresContext`.  Additionally, it's
already been marked as MOZ_CAN_RUN_SCRIPT_BOUNDARY`.  Therefore, the
`nsPresContext` instance has already been guaranteed its lifetime by the
caller.  For making this fact stronger, this patch marks their constructors
as `MOZ_CAN_RUN_SCRIPT`.  Therefore, nobody can create those instances without
guaranteeing the lifetime of `nsPresContext` and `dom::Event`.  Note that
it may look like that `mPresContext` of `EventChainPostVisitor` is not
guaranteed.  However, `EventChainPreVisitor` which gives `nsPresContext` to it
is also a stack only class.  So, it won't be deleted before
`EventChainPostVisitor` instance.

Differential Revision: https://phabricator.services.mozilla.com/D30010

--HG--
extra : moz-landing-system : lando
2019-05-06 13:57:46 +00:00
Masayuki Nakano 663f37d827 Bug 1547618 - Make dom use mozilla::PresShell rather than via nsIPresShell r=smaug
Additionally, this patch makes `nsContentUtils::DispatchXULCommand()` because
it guarantees the lifetime of **only** `PresShell` in it.  So, we need to check
the lifetime of each argument at each caller here.

Differential Revision: https://phabricator.services.mozilla.com/D29199

--HG--
extra : moz-landing-system : lando
2019-04-30 01:35:30 +00:00
Masayuki Nakano bad5d5bfe9 Bug 1547416 - Move nsIPresShell::ScrollAxis to PresShellForwards.h r=smaug
`nsIPresShell::ScrollAxis` can be used anywhere and it's used by some
utils actually. So, it should be in `mozilla` namespace and perhaps,
 `PresShellForwards.h` is a good place to move it rather than creating
new header file.

Differential Revision: https://phabricator.services.mozilla.com/D29110

--HG--
extra : moz-landing-system : lando
2019-04-30 00:07:49 +00:00
Sylvestre Ledru 96da5036ad Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D28948

--HG--
extra : moz-landing-system : lando
2019-04-28 09:30:05 +00:00
Jan Horak 9b1a629d95 Bug 1546374 - Do not adjust position of popup windows on Wayland; r=stransky
Because adjusting position in the Wayland does not work
(because of unknown absolute position of the window), do not try
to adjust popup position under Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D28480

--HG--
extra : moz-landing-system : lando
2019-04-26 17:57:36 +00:00
Emilio Cobos Álvarez 11ea945833 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681

--HG--
extra : moz-landing-system : lando
2019-04-25 23:03:04 +00:00