Commit Graph

582 Commits

Author SHA1 Message Date
Masayuki Nakano
e56c690088 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25338
2019-03-29 15:12:47 +00:00
Dorel Luca
6cd4166b18 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano
12ec0ad7f4 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25338
2019-03-29 13:09:26 +00:00
Razvan Maries
dbc72dc35c Merge mozilla-inbound to mozilla-central a=merge 2019-03-14 23:41:17 +02:00
Henri Sivonen
afb4185e88 Bug 1535282 - Add logging of content process-level focus changes. r=nika
Depends on D22468

Differential Revision: https://phabricator.services.mozilla.com/D23479
2019-03-14 15:55:35 +00:00
Henri Sivonen
1966b8122c Bug 1534258 - Send Deactivate() messages to out-of-process iframes. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D22969
2019-03-14 16:00:32 +00:00
Olli Pettay
8dd28ee0bc Bug 1532291, bail out early when trying to find any focusable element in shadow tree, r=masayuki
If aIgnoreTabIndex is true, we're just trying to find any focusable element, doesn't matter which tabindex it has.
So better to bail out early from the deeply nested GetNextTabbableContentInScope to avoid exponential number of calls.

Differential Revision: https://phabricator.services.mozilla.com/D23312
2019-03-13 15:41:02 +02:00
Ryan Hunt
c7bab671c4 Bug 1532725 - Rename PRemoteFrame to PBrowserBridge. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D22132
2019-03-04 20:15:58 -06:00
Henri Sivonen
d2a6d32279 Bug 1524980 - Use RemoteFrameChild if present in nsFocusManager::Focus(). r=nika
Depends on D21913

Differential Revision: https://phabricator.services.mozilla.com/D21927
2019-03-05 19:33:52 +00:00
Henri Sivonen
c212b26e3c Bug 1524977 - Use RemoteFrameChild if present in nsFocusManager::GetNextTabbableContent(). r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21913
2019-03-05 19:33:09 +00:00
Nika Layzell
3fa99d55d8 Bug 1522579 - Part 2: Remove consumers of nsIContentParent, r=mccr8
This patch tries to move them to `ContentParent` instead.

`ProcessPriorityManagerImpl::ObserveContentParentCreated` could not be moved
due to using `do_QueryInterface` to cast from a `nsISupports` down to the
`ContentParent` object. This could be fixed to remove the interfaces entirely,
but I left that for a follow-up.

Depends on D20549

Differential Revision: https://phabricator.services.mozilla.com/D20550
2019-02-25 20:04:47 +00:00
Andreea Pavel
8e7c45a1a2 Backed out 6 changesets (bug 1522579) for build bustages on a CLOSED TREE
Backed out changeset 3c8320baa230 (bug 1522579)
Backed out changeset 0a288a3d85cd (bug 1522579)
Backed out changeset ecfd27e7d150 (bug 1522579)
Backed out changeset eda40fca0758 (bug 1522579)
Backed out changeset 5c7aafa32a0a (bug 1522579)
Backed out changeset a3c5a2c16411 (bug 1522579)
2019-02-25 18:19:38 +02:00
Nika Layzell
511727c9ad Bug 1522579 - Part 2: Remove consumers of nsIContentParent, r=mccr8
This patch tries to move them to `ContentParent` instead.

`ProcessPriorityManagerImpl::ObserveContentParentCreated` could not be moved
due to using `do_QueryInterface` to cast from a `nsISupports` down to the
`ContentParent` object. This could be fixed to remove the interfaces entirely,
but I left that for a follow-up.

Depends on D20549

Differential Revision: https://phabricator.services.mozilla.com/D20550
2019-02-25 15:51:12 +00:00
Olli Pettay
e79ba5645e bug 1528034, make IsHostOrSlot null-safe, r=enn 2019-02-17 16:39:09 +02:00
Edgar Chen
fed8331fd1 Bug 1518121 - Part 1: Check isFocusable from frame first if content has frame; r=smaug
This is for the scrollable frame, because nsIFrame::IsFocusable of a scrollable
frame returns true with tabIndex = 0 even if the content has no tabIndex
attribute.

Differential Revision: https://phabricator.services.mozilla.com/D19646
2019-02-13 19:11:43 +00:00
Edgar Chen
bf7e8966fc Bug 1519090 - Part 3: nsFocusManager::GetNextTabbableContentInScope should also check slot if aSkipOwner is false; r=smaug
Slot element could be also focusable.

Differential Revision: https://phabricator.services.mozilla.com/D16863
2019-01-22 08:15:02 +00:00
Edgar Chen
89a4fbbd8c Bug 1519090 - Part 2: Skip the node under slot scope in frame traversal; r=smaug
The nodes under slot scope is already being traversed in
GetNextTabbableContentIn*Scope.

Differential Revision: https://phabricator.services.mozilla.com/D16860
2019-01-22 08:11:56 +00:00
Edgar Chen
9dd67858b8 Bug 1519090 - Part 1: Some minor nsFocusManager cleanup; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D16848
2019-01-22 07:41:36 +00:00
Ehsan Akhgari
498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Emilio Cobos Álvarez
dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Emilio Cobos Álvarez
e461afa617 Bug 1516853 - Merge nsIDocument and nsDocument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D15498
2018-12-31 14:10:19 +00:00
Emilio Cobos Álvarez
b26d7730f0 Bug 1516366 - Move base classes from nsDocument to nsIDocument. r=smaug
This is a big step in order to merge both.

Also allows to remove some very silly casts, though it causes us to add some
ToSupports around to deal with ambiguity of casts from nsIDocument to
nsISupports, and add a dummy nsISupports implementation that will go away later
in the series.

Differential Revision: https://phabricator.services.mozilla.com/D15352
2018-12-29 20:41:28 +01:00
Sylvestre Ledru
3ece000f7a Bug 1516555 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D15426
2018-12-28 15:48:06 +00:00
Edgar Chen
a3b512e0aa Bug 1512457 - Part 3: Ensure GetNextTabbableContentInScope returns only elements which have a frame; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D14865
2018-12-20 14:47:39 +00:00
Edgar Chen
968da47ee2 Bug 1512457 - Part 2: Enter into frameless shadow host scope during tree traversal; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D14809
2018-12-19 13:37:46 +00:00
Edgar Chen
25b5b37bff Bug 1512457 - Part 1: Correctly handle the case that FocusManager could not find next content has frame in tree; r=smaug
In this case we should look for next highest tabindex or do end searching
handling, instead of just check the root content.

Differential Revision: https://phabricator.services.mozilla.com/D14798
2018-12-19 13:23:20 +00:00
Edgar Chen
6a738e84a5 Bug 1512043 - Ensure traverse all nodes owned by the top level shadow host; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D14143
2018-12-14 18:14:52 +00:00
Edgar Chen
22fcd42ad4 Bug 1500273 - Ensure backward focus navigation works in Shadow DOM; r=smaug
When entering into a Shadow DOM in backward navigation, the frame still points
to the last frame in Shadow DOM which could be a non-focusable frame, so move
the handling of backward navigation for Shadow DOM upward.

Differential Revision: https://phabricator.services.mozilla.com/D14069
2018-12-11 20:43:51 +00:00
Emilio Cobos Álvarez
b4983dea4d Bug 1513141 - Really minor nsFocusManager cleanup. r=edgar
I was skimming over the patch in bug 1512043 and wrote this. I think it should
not really affect that patch in any meaningful way, so I may as well land it.

Differential Revision: https://phabricator.services.mozilla.com/D14129
2018-12-11 11:25:02 +00:00
Neil Deakin
c4e382df7d Bug 1492326, use Element helper methods in dom/layout instead of QueryInterface to get interface implementations that might be implemented by custom elements, r=paolo 2018-12-04 11:33:05 -05:00
Gijs Kruitbosch
369f1dcc69 Bug 1503887 - clear focused window when Blur() is called and there's no docshell, presshell, or the focused element is no longer in the composed document r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D13655
2018-12-07 09:00:28 +00:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Ehsan Akhgari
6d06c0bc8f Bug 1508472 - Part 1: First batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal.  I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13046
2018-11-27 10:08:58 +00:00
Emilio Cobos Álvarez
47f30fca6b Bug 1507101 - Use StyleChildrenIterator instead of custom frame tree walking code to handle NAC inside shadow dom. r=smaug
There are lots of frames which create anonymous content (like scrollframes,
which generate scrollbars) but for which this code was wrong.

Use StyleChildrenIterator which has a defined order between NAC and flattened
tree. I've verified this doesn't break tabbing through input type="date" with
UA widget disabled, fwiw.

Differential Revision: https://phabricator.services.mozilla.com/D12152
2018-11-16 20:31:50 +00:00
Timothy Guan-tin Chien
2a63ce2955 Bug 1503019 - Part I, Remove dom.webcomponents.shadowdom.enabled r=smaug
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

Differential Revision: https://phabricator.services.mozilla.com/D11183
2018-11-15 06:51:07 +00:00
Andreea Pavel
f667cd7449 Backed out 2 changesets (bug 1503019) for failing crashtests at dom/base/crashtests/1505811.html on a CLOSED TREE
Backed out changeset 06b12fd41ff1 (bug 1503019)
Backed out changeset 7b845eac9dd7 (bug 1503019)
2018-11-15 01:52:30 +02:00
Timothy Guan-tin Chien
0644cf5b9d Bug 1503019 - Part I, Remove dom.webcomponents.shadowdom.enabled r=smaug
This patch removes the dom.webcomponents.shadowdom.enabled pref and all its
references, including the following functions:

* nsContentUtils::IsShadowDOMEnabled()
* nsIDocument::IsShadowDOMEnabled()
* nsDocument::IsShadowDOMEnabled(JSContext* aCx, JSObject* aGlobal)
* nsDocument::IsShadowDOMEnabled(const nsINode* aNode)
* nsTextNode::IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject)

This function is renamed and updated to nsDocument::IsCallerChromeOrAddon():

* nsDocument::IsShadowDOMEnabledAndCallerIsChromeOrAddon(JSContext* aCx, JSObject* aObject)

I didn't change the tests that load Shadow DOM tests in an iframe, in the interest of keeping hg annotation history.

Differential Revision: https://phabricator.services.mozilla.com/D11183
2018-11-14 19:34:52 +00:00
Timothy Guan-tin Chien
4da6f268cf Bug 1496242 - Part III, nsFocusManager should account for UA Widget when deciding to traverse into NAC r=smaug
In bug 1430692, a special case was added in nsFocusManager::GetNextTabbableContentInScope()
that traverse into the element when the primany frame implements nsIAnonymousContentCreator,
assuming there will be NAC to focus within.

This is not the case when UA Widget is turned on, where the focusable inner inputs will
be put in the UA Widget Shadow DOM.

The change here account this fact.

Depends on D9057

Differential Revision: https://phabricator.services.mozilla.com/D9303
2018-10-29 19:51:17 +00:00
Brendan Dahl
c5411186fb Bug 1501833 - Allow the retargetdocumentfocus attribute to be used in any chrome document. r=smaug
Fixes test browser/base/content/test/general/browser_documentnavigation.js
for browser.xhtml.

Differential Revision: https://phabricator.services.mozilla.com/D9711
2018-10-24 21:10:37 +00:00
Andrew McCreight
05b70f0bb6 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D6861
2018-10-01 21:38:01 +00:00
Olli Pettay
c2b3544d94 Bug 1490820, elements without frames shouldn't be focusable in shadow DOM, r=ehsan 2018-09-21 21:46:17 +03:00
Henrik Skupin
91999572bc Bug 1489967 - Keep active state when Firefox is moved to background and focusmanager test mode is enabled. r=enndeakin
The test mode can be used to virtually give a Chrome window the
focus even with Firefox being in the background.

Currently when such a window has the focus and another application
is moved to the foreground, the active state is lost. This means that
for example Selenium tests which are run in parallel and using
different instances of Firefox will not receive the expected
"focus" and "blur" events.

This patch checks for the test mode and if enabled doesn't
lower the window, which will keep the focused state.
2018-09-10 15:03:04 +02:00
Masayuki Nakano
8e0ecc58d3 Bug 1487591 - Make Selection treat AccessibleCaretEventHub as concrete class rather than nsISelectionListener r=smaug
AccessibleCaretEventHub is an nsISelectionListener of Selection whose type is
"normal".  This is added only when nsFrameSelection::Init() is called and
accessible caret is enabled.  Additionally, nsFrameSelection::Init() is
always called immediately after creating nsFrameSelection.

Therefore, when AccessibleCaretEventHub is installed to Selection, this is
always second selection listener and won't be installed multiple times.  So,
Selection can store pointer of AccessibleCaretEventHub directly only when
it's enabled and the Selection needs to notify it of selection change.

This patch makes Selection stores AccessibleCaretEventHub with RefPtr, then,
makes Selection::NotifySelectionListeners() call its OnSelectionChange()
immediately after AutoCopyListener.

Unfortunately, this patch includes making of MOZ_CAN_RUN_SCRIPT_BOUNDARY and
MOZ_CAN_RUN_SCRIPT a lot since some methods of AccessibleCaretEventHub are
marked as MOZ_CAN_RUN_SCRIPT and including AccessibleCaretEventHub.h into
Selection.h causes compile the compile errors.

Differential Revision: https://phabricator.services.mozilla.com/D4733
2018-08-31 21:19:44 +00:00
Xidorn Quan
1e77bd0b24 Bug 1483090 - Rename StyleUserInterface to StyleUI. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D3276
2018-08-14 08:37:37 +00:00
Olli Pettay
8bc0681917 bug 1482820, fix a small typo in nsFocusManager.cpp, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D3193
2018-08-13 09:43:05 +00:00
Olli Pettay
fca02d2589 bug 1481079, Shadow DOM hosts should be focusable, r=mrbkap 2018-08-11 02:58:23 +03:00
Olli Pettay
a05b932c79 Bug 1476301, try to ensure sequential focusing can leave shadow trees, r=mrbkap 2018-08-09 20:02:43 +03:00
Olli Pettay
e56212308c bug 1430701, remove now unused nsLightFrameIterator, r=mrbkap 2018-07-20 19:32:22 +03:00
Olli Pettay
6b4e04a637 bug 1430701, contents of frameless shadow hosts should be focusable, r=mrbkap 2018-07-20 19:29:52 +03:00
Kris Maglione
863d00faac Bug 1473631: Part 4 - Replace pref observers with callbacks in FocusManager. r=njn
MozReview-Commit-ID: 533Qz2nIkmX
2018-07-05 13:36:07 -07:00