Commit Graph

500 Commits

Author SHA1 Message Date
Mihai Alexandru Michis
b51ee7e327 Backed out 2 changesets (bug 981248) for causing multiple failures.
CLOSED TREE

Backed out changeset 7a96708cc8b7 (bug 981248)
Backed out changeset 1eace7bd28d9 (bug 981248)
2020-01-14 19:28:17 +02:00
Emilio Cobos Álvarez
c442c1b9ab Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

Differential Revision: https://phabricator.services.mozilla.com/D57193
2020-01-14 15:05:22 +00:00
Edgar Chen
d297478add Bug 1607223 - Part 4: Avoid performing check of next tabbable content on the first element of shadow dom duplicatedly; r=smaug
See https://bugzilla.mozilla.org/show_bug.cgi?id=1607223#c1 for the details.

Differential Revision: https://phabricator.services.mozilla.com/D58876
2020-01-07 18:36:25 +00:00
Edgar Chen
4ba9e5dd06 Bug 1607223 - Part 3: Simplify the logic of handling *topLevelScopeOwner; r=smaug
This patch contains three changes, but we just simpliy the logic, the result is the same,

1). s/oldTopLevelScopeOwner/currentTopLevelScopeOwner/
We can use either `oldTopLevelScopeOwner` or `currentTopLevelScopeOwner` in if-check, they point to the same element at that point.
Using `currentTopLevelScopeOwner` is clearer given that it is updated in the if-block.

2). remove else-block
We run into this else-block when `aForward && oldTopLevelScopeOwner == currentContent`,
so  `oldTopLevelScopeOwner`, `currentTopLevelScopeOwner` and `currentContent` all point to the same element.
It is not necessary to set `currentTopLevelScopeOwner` to `currentContent` again.

3). s/IsHostOrSlot(currentTopLevelScopeOwner)/currentTopLevelScopeOwner/
After above two changes, `currentTopLevelScopeOwner` is always set to result of `GetTopLevelScopeOwner(currentContent)`,
so we don't need `IsHostOrSlot()` checks. And there is an asserion in `HostOrSlotTabIndexValue()` to ensure it is either a host or slot.

Differential Revision: https://phabricator.services.mozilla.com/D58810
2020-01-07 15:31:08 +00:00
Edgar Chen
3bd8c1382e Bug 1607223 - Part 2: Fix GetTopLevelScopeOwner; r=smaug
Currently if we call `GetTopLevelScopeOwner` with a <slot> which is in top-level-scope, e.g. `<body><slot></slot></body>`.
It returns <slot> itself, but it should returns `nullptr` per design.

Differential Revision: https://phabricator.services.mozilla.com/D58805
2020-01-07 12:42:58 +00:00
Edgar Chen
a3d9db5357 Bug 1607223 - Part 1: Update the comment of FindOwner and rename function name to FindScopeOwner; r=smaug
After bug 1544826, `FindOwner` returns only shadow host or slot, update the
comment and rename it to `FindScopeOwner` to reflect the current behavior.

Differential Revision: https://phabricator.services.mozilla.com/D58578
2020-01-07 11:37:26 +00:00
Emilio Cobos Álvarez
1278d10333 Bug 1595435 - Allow content to steal focus from a cross-origin iframe. r=masayuki
This matches other browsers.

Keep the restriction just to chrome nodes, and in that case, avoid getting into
the broken state, which is what causes the issue. I'm not sure if this even
matters anymore given e10s but...

Differential Revision: https://phabricator.services.mozilla.com/D57475
2019-12-25 06:50:25 +00:00
Hiroyuki Ikezoe
e16b1cf1f5 Bug 1596317 - Use CallState for nsContentUtils::CallOnAllRemoteChildren. r=smaug
`true` -> `CallState::Stop`
`false` -> `CallState::Continue`

Differential Revision: https://phabricator.services.mozilla.com/D57436
2019-12-19 07:58:27 +00:00
Hiroyuki Ikezoe
5d1059e664 Bug 1596317 - Change the function pointer argument of nsContentUtils::CallOnAllRemoteChildren to std::function. r=smaug
We are going to introduce a new function in Document in this commit series,
which enumerates all child documents regardless of whether it's in the same
process, in content processes or in out-of-process iframes. The function takes
std::functions, but I don't have any good ideas to convert lambda functions with
capturing variables to function pointer.

Differential Revision: https://phabricator.services.mozilla.com/D57434
2019-12-19 07:57:57 +00:00
Bogdan Tara
e59c8c65fb Backed out 7 changesets (bug 1596317) for causing build bustages CLOSED TREE
Backed out changeset 0d3208fcb948 (bug 1596317)
Backed out changeset fe5554dc4115 (bug 1596317)
Backed out changeset 019de59cbc93 (bug 1596317)
Backed out changeset f4851472b087 (bug 1596317)
Backed out changeset a984cf515db8 (bug 1596317)
Backed out changeset d0da5bf9b4d4 (bug 1596317)
Backed out changeset abe5f2030dd9 (bug 1596317)
2019-12-19 06:49:39 +02:00
Hiroyuki Ikezoe
412bdf8188 Bug 1596317 - Use CallState for nsContentUtils::CallOnAllRemoteChildren. r=smaug
`true` -> `CallState::Stop`
`false` -> `CallState::Continue`

Differential Revision: https://phabricator.services.mozilla.com/D57436
2019-12-19 03:36:35 +00:00
Hiroyuki Ikezoe
65d3d20f75 Bug 1596317 - Change the function pointer argument of nsContentUtils::CallOnAllRemoteChildren to std::function. r=smaug
We are going to introduce a new function in Document in this commit series,
which enumerates all child documents regardless of whether it's in the same
process, in content processes or in out-of-process iframes. The function takes
std::functions, but I don't have any good ideas to convert lambda functions with
capturing variables to function pointer.

Differential Revision: https://phabricator.services.mozilla.com/D57434
2019-12-19 03:35:59 +00:00
Oana Pop Rus
2fa2ebf69d Backed out 7 changesets (bug 1432856) for build bustages failures in nsWindow.h on a CLOSED TREE
Backed out changeset 3d08c3cce533 (bug 1432856)
Backed out changeset 49d03dd89b17 (bug 1432856)
Backed out changeset 62fc84c8ce99 (bug 1432856)
Backed out changeset a8a4fa63f5b2 (bug 1432856)
Backed out changeset c81f3d5b9bf3 (bug 1432856)
Backed out changeset 8351a8b1d96a (bug 1432856)
Backed out changeset a303b775a51b (bug 1432856)
2019-12-16 23:53:35 +02:00
pbz
9b95ca979c Bug 1432856 - Added console logging for DOM fullscreen leave on window open or raise. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55813
2019-12-16 21:07:37 +00:00
pbz
fda1d6a250 Bug 1432856 - Added prefs for DOM fullscreen leave on window open or raise. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55812
2019-12-16 21:07:33 +00:00
pbz
29a2e0c4e4 Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55811
2019-12-16 21:06:11 +00:00
pbz
ac21824244 Bug 1432856 - Leave DOM fullscreen on window raise. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55810
2019-12-16 21:03:18 +00:00
Gabriele Svelto
eb403b8785 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442
2019-12-06 09:24:56 +00:00
Dorel Luca
67889e1013 Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto
dc6fa2e86c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442
2019-12-04 15:01:19 +00:00
Brian Grinstead
5c162e767e 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
2019-11-07 00:35:13 +00:00
Brendan Dahl
ef30c33394 Bug 1470510 - Rename nsXULWindow and nsIXULWindow to AppWindow and nsIAppWindow. r=smaug
nsXULWindow is no longer XUL specific and is somewhat confusing name.

Differential Revision: https://phabricator.services.mozilla.com/D51486
2019-11-05 17:56:28 +00:00
Mihai Alexandru Michis
5803a050c4 Backed out 2 changesets (bug 1470510) for causing bustages in widget/cocoa/nsChildView.mm CLOSED TREE
Backed out changeset a343f30c34a3 (bug 1470510)
Backed out changeset 4da64790094d (bug 1470510)
2019-11-05 09:24:26 +02:00
Brendan Dahl
b484de8fe7 Bug 1470510 - Rename nsXULWindow and nsIXULWindow to AppWindow and nsIAppWindow. r=smaug
nsXULWindow is no longer XUL specific and is somewhat confusing name.

Differential Revision: https://phabricator.services.mozilla.com/D51486
2019-11-04 23:37:31 +00:00
Dorel Luca
bcbec745b9 Backed out 2 changesets (bug 1470510) for build bustage on /build/src/widget/cocoa/nsChildView.mm. CLOSED TREE
Backed out changeset 5967bf633574 (bug 1470510)
Backed out changeset 067a556bb614 (bug 1470510)
2019-11-04 19:18:56 +02:00
Brendan Dahl
4f87b88cc6 Bug 1470510 - Rename nsXULWindow and nsIXULWindow to AppWindow and nsIAppWindow. r=smaug
nsXULWindow is no longer XUL specific and is somewhat confusing name.

Differential Revision: https://phabricator.services.mozilla.com/D51486
2019-11-04 16:52:35 +00:00
Nicholas Nethercote
99a55e2d1c Bug 1587162 - Fix UBSAN complaints about pref callbacks. r=erahm
Lots of these callbacks have a non-`void*` final parameter, which UBSAN
complains about. This commit changes them to have a `void*` parameter.

This requires undoing the machinery added in the first two commits of bug
1473631: `TypePrefChangeFunc` and `PREF_CHANGE_METHOD`. The resulting code is
simpler (which is good) and more boilerplate-y (which is bad) but avoids the
undefined behaviour (which is good).

Differential Revision: https://phabricator.services.mozilla.com/D50901
2019-11-01 02:57:20 +00:00
Tim Nguyen
da27ed5d34 Bug 1513325 - Remove textbox binding. r=emilio,dao
Differential Revision: https://phabricator.services.mozilla.com/D38955
2019-10-09 09:27:28 +00:00
Brendan Dahl
bf272a3bca 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
2019-10-08 23:52:14 +00:00
Kannan Vijayan
c110dbe443 Bug 1569262 - Rename nsIDocShellTreeItem::GetRootTreeItem to GetInProcessRootTreeItem for Fission marking. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D41064
2019-08-07 19:24:00 +00:00
Kannan Vijayan
c690c1925f Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D39378
2019-07-26 16:48:31 +00:00
Mirko Brodesser
090d7efc5e Bug 1565584: move nsIContentUtils::ContentIsDescendantOf to nsINode::IsInclusiveDescendantOf. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37880
2019-07-15 10:02:21 +02:00
Makoto Kato
c1fbcc9cc8 Bug 1556103 - Part 1. Add long press action when setting focus. r=masayuki
Actually, long tap can set focus.  But since it uses `nsIFocusManager::FLAG_BYMOUSE` flag, we cannot recognize whether setting focus is by long tap or not.

So I would like to add new flag `FLAG_BYLONGPRESS` and `CAUSE_LONGPRESS` that are by long tap.

Differential Revision: https://phabricator.services.mozilla.com/D35991
2019-06-28 00:39:45 +00:00
Cosmin Sabou
706aa85372 Merge mozilla-inbound to mozilla-central. a=merge 2019-07-03 19:20:05 +03:00
Mirko Brodesser
e8543e1b1b Bug 1562876: rename Selection::AddRange to Selection::AddRangeAndSelectFramesAndNotifyListeners. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D36602
2019-07-03 13:26:13 +02:00
Emilio Cobos Álvarez
4f169bebdf Bug 1561288 - Don't override currentContent when focusing something on a shadow root. r=smaug
It is wrong, what we're trying to focus is frame->GetContent() still.

This is not reproducible outside of Thunderbird because for it to happen the
focus manager needs to wrap around the start content.

Here's what's going on:

 * We start with a <tree> focused, which is a shadow host.
 * There's nothing else to focus inside the <tree>, or after the <tree> in document order.
 * So we restart the search with a different tabindex (1), but find nothing before the tree (since all focusable elements before the tree also have tabindex 0), and we return wrongly in [1], instead of searching with tabindex 0 again afterwards. (Since the child frame is not focusable, we wrongly end up at [1], and returning early, since currentContent != frame->GetContent(), instead of keeping looking for the right thing to focus.)

As I said this cannot reproduce on content, as far as I can tell, so I'm not
sure how to go about testing this, but all the shadow dom tab navigation tests
keep passing with this change.

[1]: https://searchfox.org/mozilla-central/rev/06bd14ced96f25ff1dbd5352cb985fc0fa12a64e/dom/base/nsFocusManager.cpp#3560

Differential Revision: https://phabricator.services.mozilla.com/D36196
2019-07-01 20:04:07 +00:00
Henri Sivonen
f050fd91a1 Bug 1562796 - Pop BrowserParents of the previous window when raising/creating a window. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D36581
2019-07-03 06:06:26 +00:00
Emilio Cobos Álvarez
3244910d0e Bug 1561738 - Remove nsStyleCoord. r=boris
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).

Differential Revision: https://phabricator.services.mozilla.com/D36120
2019-06-28 12:44:44 +02:00
Cosmin Sabou
a5a1cf97a8 Backed out 3 changesets (bug 1561738) for causing build bustages on nsGridContainerFrame.cpp CLOSED TREE
Backed out changeset 98f100abc2ba (bug 1561738)
Backed out changeset 9ed20d0fb9ba (bug 1561738)
Backed out changeset 483b1e134ace (bug 1561738)
2019-06-28 13:27:09 +03:00
Emilio Cobos Álvarez
a622c42ad4 Bug 1561738 - Remove nsStyleCoord. r=boris
And move the useful bits of it somewhere else (ServoStyleConstInlines.h for the
inline function definitions, and nsFrame.cpp for the static assertions).

Differential Revision: https://phabricator.services.mozilla.com/D36120
2019-06-28 09:46:26 +00:00
Emilio Cobos Álvarez
6885568834 Bug 1558393 - Don't keep top level scope owner when going backwards. r=smaug
When going backwards the host is the last thing of the scope we see, not the
first, so we need to make sure to properly switch to the document scope.

To be clear, the order this is happening when bogusly going backwards from
`second` to `first` is:

 * We're doing frame traversal so start off the <div>.
 * The text is the first frame in preorder we find, we figure out that the
   current top-level owner is the host. But it's not focusable so we carry on.
 * Now we go to the next frame and find the <span>. `oldTopLevelScopeOwner` is
   still the span itself, and we don't change it (that's what my patch fixes),
   so we go into the "We're within non-document scope, continue", and thus skip
   trying to focus the host.

With this fix we actually realize that the current top level scope owner has
changed and thus don't skip it and try to focus the slot properly.

Differential Revision: https://phabricator.services.mozilla.com/D35585
2019-06-25 10:35:39 +00:00
Henri Sivonen
571a83a5e9 Bug 1549930 - Avoid popping BrowserParent in response to window lowering. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D30873
2019-06-14 07:02:18 +00:00
Ehsan Akhgari
200d6ea9cc Bug 836176 - Part 3: Remove nsIHTMLDocument; r=farre
Differential Revision: https://phabricator.services.mozilla.com/D32925
2019-06-04 17:27:43 +00:00
Emilio Cobos Álvarez
b56d5ba7d7 Bug 1553769 - Have a single way of requesting window focus and switching to a tab. r=NeilDeakin,snorp
Right now there's some duplicated code with the focus manager and the
DOMWindowFocus event.

Android didn't handle the new framefocusrequested event, so the test-cases in
bug 416771 still didn't work there.

I think using the focus manager codepath everywhere is preferable. I confirmed
manually that the stuff that sent DOMWindowFocus events still works as expected
with this patch (i.e., switching to the right tab when you click on a
notification, etc.).

This fixes it so that it works in Fennec, and it sends the focus events right in
GeckoView Example (i.e., we get here[1] properly).

The snippet that Snorp provided on IRC to implement the "bring activity to
front" stuff (`startActivity(getIntent())`) didn't actually work for me, but I
confirmed that the right message is sent when the focus is requested, and that
we get there.

[1]: https://searchfox.org/mozilla-central/rev/952521e6164ddffa3f34bc8cfa5a81afc5b859c4/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#503

Depends on D32353

Differential Revision: https://phabricator.services.mozilla.com/D32354
2019-06-03 19:42:28 +00:00
Emilio Cobos Álvarez
c269510c54 Bug 1553769 - Make nsIWidget::SetFocus infallible, and make it take an enum class. r=NeilDeakin
Only gtk returns failure ever, and nobody checks the result anyway.

Use an enum class so that it's clear from the caller what it means.

Differential Revision: https://phabricator.services.mozilla.com/D32353
2019-05-31 22:13:56 +00:00
Ehsan Akhgari
9c98e2b335 Bug 1415270 - Part 1: Move nsHTMLDocument editing APIs to Document; r=farre,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D32911
2019-05-31 01:37:26 +00:00
Brindusan Cristian
e304b188c2 Backed out changeset c0895e6c7343 (bug 1553769) for causing build bustages at PluginWidgetProxy.cpp. CLOSED TREE 2019-05-30 01:00:20 +03:00
Emilio Cobos Álvarez
e7638ca182 Bug 1553769 - Make nsIWidget::SetFocus infallible, and make it take an enum class. r=NeilDeakin
Only gtk returns failure ever, and nobody checks the result anyway.

Use an enum class so that it's clear from the caller what it means.

Differential Revision: https://phabricator.services.mozilla.com/D32353
2019-05-29 14:37:26 +00:00
shindli
a5086b2190 Backed out changeset 79436da3bf79 (bug 1549930) for causing perma browser chrome failures in browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js CLOSED TREE 2019-05-27 18:09:53 +03:00
Henri Sivonen
4364cf78ec Bug 1549930 - Avoid popping BrowserParent in response to window lowering. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D30873
2019-05-27 12:22:37 +00:00