Commit Graph

500 Commits

Author SHA1 Message Date
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
Olli Pettay
a294d5e07b Bug 1466581, handle sequential focus also in nested shadow DOM, r=mrbkap 2018-07-10 01:56:42 +03:00
Olli Pettay
5444fa0f06 bug 1472427, <img usemap> should work in shadow DOM, r=baku 2018-07-04 20:26:09 +03:00
Emilio Cobos Álvarez
0348c342b8 Bug 1470930: Use enums for passing arguments for event dispatch. r=smaug
MozReview-Commit-ID: DsNuF7GAflJ
2018-06-26 18:22:06 +02:00
Paolo Amadini
7b05a02a57 Bug 1448126 - Part 2 - Remove the "scale" binding and its supporting platform code. r=bgrins
MozReview-Commit-ID: ETmUuosYxeG
2018-06-24 17:19:25 +01:00
Olli Pettay
f11188f86f bug 1466998, because of XUL panels, sequential focusing needs to handle also non-document-roots as roots, r=mrbkap 2018-06-19 21:28:34 +03:00
Henrik Skupin
4e7dd78790 Bug 1334981 - Backed out changeset d6ca24ba3673 for regression caused by bug 887718. r=enndeakin+6102
MozReview-Commit-ID: 9hIcRVRseO1
2018-06-07 15:48:48 +02:00
Boris Zbarsky
86d99155db Bug 1455676 part 14. Remove most use of nsIDOMNode in dom/. r=qdot 2018-05-29 22:58:49 -04:00
Boris Zbarsky
57fa3783fa Bug 1455676 part 2. Remove nsIDOMNode usage from accessible/. r=surkov 2018-05-29 22:58:47 -04:00
Boris Zbarsky
02774793c2 Bug 1377980 part 2. Remove most C++ use of nsIDOMRange. r=mccr8 2018-05-17 12:01:38 -04:00
Adrian Wielgosik
93eb294385 Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
MozReview-Commit-ID: LKRnyDPNlle
2018-05-11 19:46:15 +02:00
Boris Zbarsky
87fdbf744c Bug 1387143 part 23. Remove nsISelection collapse* methods. r=mats 2018-05-08 13:52:41 -04:00
Boris Zbarsky
4576949e36 Bug 1387143 part 11. Support non-XPCOM weakreference on Selection. r=mats
This way we don't have to deal with QI to get a Selection out of a weakref.

mfbt weakrefs don't have a SizeOfOnlyThis.  In any case, the memory used by the
weakref itself is pretty minor...
2018-05-08 13:52:37 -04:00
Chris Peterson
5d6b16ea3b Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L
2018-04-28 12:50:58 -07:00
Olli Pettay
73385eaf10 Bug 1430020, let sequential focus navigation in shadow DOM enter iframes, r=mrbkap 2018-04-28 16:07:06 +03:00
Cosmin Sabou
2b93123c31 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-04-27 13:13:54 +03:00
Cosmin Sabou
cd2df3e76b Merge inbound to mozilla-central. a=merge 2018-04-27 13:04:36 +03:00
Olli Pettay
75b8b67b91 bug 1430692, Handle focus navigation on NAC in shadow DOM, r=mrbkap 2018-04-27 12:37:43 +03:00
Boris Zbarsky
599ef690cf Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Boris Zbarsky
268d2c0bc3 Bug 1455674 part 9. Remove nsIDOMElement use from nsIFocusManager. r=qdot 2018-04-26 23:35:19 -04:00
Boris Zbarsky
6fb00d932f Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
Boris Zbarsky
e501fdf1fd Bug 1457156. Rename nsPIDOMWindow::mFocusedNode to reflect that it's an Element now. r=mccr8 2018-04-26 15:28:30 -04:00
shindli
55275cebc3 Backed out 2 changesets (bug 1457155, bug 1457156) for B failures in builds/worker/workspace/build/src/dom/html/HTMLObjectElement.cpp on a CLOSED TREE
Backed out changeset 8b2a6b54336c (bug 1457155)
Backed out changeset 4e267d999797 (bug 1457156)
2018-04-27 01:34:37 +03:00
Boris Zbarsky
6764622e9f Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
Boris Zbarsky
633fcbc890 Bug 1457156. Rename nsPIDOMWindow::mFocusedNode to reflect that it's an Element now. r=mccr8 2018-04-26 15:28:30 -04:00
Boris Zbarsky
03b49fcca6 Bug 1456588 part 5. Store an Element as the focused content in the focus manager. r=enndeakin 2018-04-26 10:37:47 -04:00
Boris Zbarsky
8041126861 Bug 1456588 part 4. Change nsFocusManager guts to make it clearer that the focused thing is always an Element. r=enndeakin
I couldn't find a good way to make this incremental without adding QIs and
AsElement() in various places....
2018-04-26 10:37:47 -04:00
Boris Zbarsky
04f72ca8d9 Bug 1456588 part 3. Change nsFocusManager::SetFocusInner to take Element. r=enndeakin 2018-04-26 10:37:47 -04:00
Boris Zbarsky
eb633469bd Bug 1456588 part 2. Change nsIFocusManager::MoveFocus to take Element. r=enndeakin 2018-04-26 10:37:47 -04:00
Boris Zbarsky
45892dfa49 Bug 1456588 part 1. Change nsIFocusManager::SetFocus to take Element. r=enndeakin 2018-04-26 10:37:46 -04:00
Brian Grinstead
a5f8b86117 Bug 1456703 - Remove nsIDOMXULTextBoxElement r=enndeakin+6102
MozReview-Commit-ID: 6ZRzVq1bJjz
2018-04-26 15:17:00 -07:00
Brian Grinstead
7de04ec3b1 Bug 1456703 - Stop using nsIDOMXULTextBoxElement to detect XUL textboxes r=enndeakin+6102
This is used in JS via instanceof checks, and in C++ only to get the `inputField`
attribute (the actual HTML input or textarea). We can swap out instanceof by checking
the tag name, and we can directly query for the input field from C++.


MozReview-Commit-ID: 7xpHQMYzYhD
2018-04-26 15:15:10 -07:00
Olli Pettay
aa92e453e0 Bug 1453693 - Ensure sequential focus navigation works in Shadow DOM and add some tests, r=mrbkap 2018-04-22 14:25:38 +03:00