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

65 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 6917a38081 Bug 1555216 - Change the signature of BindToTree to be (BindContext&, nsINode& aParentNode). r=bzbarsky
BindContext was going to have way more information at first, but then I realized
that most of the things I wanted to know were basically a flag away using the
parent node.

Still I think it's worth it, now experimenting with BindToTree will only mean
adding a field to a struct that's included from a couple cpp files, instead of a
massive pain.

I also think this is clearer, and doing this highlights quite a few
inconsistencies in our code which I've left untouched, but commented with
FIXMEs.

Steps are:

$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsresult BindToTree(Document\* aDocument, nsIContent\* aParent,#nsresult BindToTree(BindContext\&, nsINode\& aParent)#g' $file; done
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#                      nsIContent\* aBindingParent) override#override#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(Document\* aDocument, nsIContent\* aParent,#::BindToTree(BindContext\& aContext, nsINode\& aParent)#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsIContent\* aBindingParent)##g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(aDocument, aParent, aBindingParent)#::BindToTree(aContext, aParent)#g' $file; done
$ ./mach clang-format

Then manual fixups.

Depends on D32948

Differential Revision: https://phabricator.services.mozilla.com/D32949
2019-05-31 23:31:52 +02:00
Emilio Cobos Álvarez ff732c2cdf Bug 1555143 - Remove unused aDeep argument from UnbindFromTree. r=bzbarsky
$ for file in $(rg UnbindFromTree | cut -d : -f 1 | sort | uniq); do sed -i 's#UnbindFromTree(bool aDeep = true,#UnbindFromTree(#g' $file; done
$ for file in $(rg UnbindFromTree | cut -d : -f 1 | sort | uniq); do sed -i 's#UnbindFromTree(bool aDeep,#UnbindFromTree(#g' $file; done
$ for file in $(rg UnbindFromTree | cut -d : -f 1 | sort | uniq); do sed -i 's#UnbindFromTree(aDeep,#UnbindFromTree(#g' $file; done
$ ./mach clang-format

And fix the two callers and little use of the aDeep argument (see the "Manual
changes" patch attached to bug).

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

--HG--
extra : moz-landing-system : lando
2019-05-28 22:47:08 +00:00
Edgar Chen 2617857bc6 Bug 1551264 - Move user-initiated flag for form submission from HTMLFormElement to HTMLFormSubmission; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D30945

--HG--
extra : moz-landing-system : lando
2019-05-14 12:41:19 +00:00
Matthew Noorenberghe 0ad4c17e2f Bug 1474143 - Remove unused 'firstformsubmit' category and gFirstFormSubmitted. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D16650

--HG--
extra : moz-landing-system : lando
2019-02-23 00:23:37 +00:00
Matthew Noorenberghe cc5d6f955d Bug 1474143 - Remove unused 'passwordmanager' category and gPasswordManagerInitialized. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D16649

--HG--
extra : moz-landing-system : lando
2019-02-23 00:23:14 +00:00
Ciure Andrei f7412ac1f2 Backed out 10 changesets (bug 1474143) for perma failing browser_markup_events_01.js CLOSED TREE
Backed out changeset 1b5d04866585 (bug 1474143)
Backed out changeset 78bfb4dd1f6a (bug 1474143)
Backed out changeset 85ec4f1f5f60 (bug 1474143)
Backed out changeset 5c112b77e489 (bug 1474143)
Backed out changeset 5d35599598bb (bug 1474143)
Backed out changeset 9fd0d7a7946f (bug 1474143)
Backed out changeset 1a83be7a75ca (bug 1474143)
Backed out changeset 2fc9b13171d0 (bug 1474143)
Backed out changeset 3983d7b6d9ad (bug 1474143)
Backed out changeset 9fe55dd58cd8 (bug 1474143)

--HG--
rename : browser/actors/FormValidationChild.jsm => browser/actors/FormSubmitChild.jsm
rename : toolkit/components/satchel/FormSubmitChild.jsm => toolkit/components/satchel/formSubmitListener.js
2019-02-22 21:16:49 +02:00
Matthew Noorenberghe 702cf2d5ed Bug 1474143 - Remove unused 'firstformsubmit' category and gFirstFormSubmitted. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D16650

--HG--
extra : moz-landing-system : lando
2019-02-22 15:12:11 +00:00
Matthew Noorenberghe 44ada4578b Bug 1474143 - Remove unused 'passwordmanager' category and gPasswordManagerInitialized. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D16649

--HG--
extra : moz-landing-system : lando
2019-02-22 15:11:56 +00:00
Emilio Cobos Álvarez d2ed260822 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
Andrea Marchesini 9cc643f6d3 Bug 1513895 - Unify PopupBlocker algorithm in 1 single file, r=smaug 2018-12-16 10:21:16 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nathan Froyd 846d8789ee Bug 1492894 - part 1 - make the node hierarchy consistently constructed with NodeInfo&&; r=mccr8
Various places in dom/ use the pattern:

  already_AddRefed<NodeInfo> ni = ...;

which is supposed to be disallowed by our static analysis code, but
isn't, for whatever reason.  To fix our static analysis code, we need to
eliminate instances of the above pattern.

Unfortunately, eliminating this pattern requires restructuring how Nodes
are created.  Most Node subclasses take `already_AddRefed<NodeInfo>&` in
their constructors, and a few accept `already_AddRefed<NodeInfo>&&`.  We
need to enforce the latter pattern consistently, which requires changing
dozens of source files.
2018-09-21 16:45:49 -04:00
Kris Maglione 319fbff074 Bug 1483738: Part 1 - Change notifyInvalidSubmit to take a plain array. r=mconley
This makes things saner for all consumers, which makes it worth doing on its
own. But it also gives me an easy nsTArray to work with, which I can use to
dispatch DOM events with array properties.

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

--HG--
extra : rebase_source : e8bcc75e84845e42c932886502f99ca3154df48d
2018-08-16 12:20:54 -07:00
Emilio Cobos Álvarez 1fbd784d00 Bug 1481601 - Remove now-useless aPreallocateChildren from nsINode::Clone() and friends. r=bzbarsky
Since sed on multiple lines ended up being such a pain and I didn't end up
writing a script for this because I didn't think it'd end up being so boring, I
may have made a couple cleanups here and there as well...

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

--HG--
extra : moz-landing-system : lando
2018-08-08 23:58:44 +00:00
Emilio Cobos Álvarez 8f34c12e14 Bug 1479860: Remove unused aCompileEventHandlers argument from BindToTree. r=bz
Mostly automatic via sed. Only parts which I touched manually (apart from a
couple ones where I fixed indentation or which had mispelled arguments) are the
callers. I may have removed a couple redundant `virtual` keywords as well when
I started to do it manually, I can revert those if wanted.

Most of them are just removing the argument, but in Element.cpp I also added an
assertion for GetBindingParent when binding the ShadowRoot's kids (the binding
parent is set from the ShadowRoot constructor, and I don't think we bind a
shadow tree during unlink or what not which could cause a behavior difference).

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

MozReview-Commit-ID: 2oIgatty2HU
2018-08-01 10:42:54 +02:00
Edgar Chen 106676d84e Bug 1450989 - Capture the action and target as part of the form submission creation; r=bz 2018-07-22 11:11:27 +02:00
Boris Zbarsky 14f26fccf6 Bug 1449631 part 8. Remove nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: 5wQ2LYrjUxf
2018-04-05 13:42:41 -04:00
Boris Zbarsky 553b5d6aae Bug 1449631 part 5. Move Will/Pre/PostHandleEvent out of nsIDOMEventTarget. r=smaug
MozReview-Commit-ID: K2nOZNPy0XE
2018-04-05 13:42:41 -04:00
Boris Zbarsky 258352c8a8 Bug 1447098 part 2. Rename the NS_IMPL_FROMCONTENT macros to NS_IMPL_FROMNODE. r=mystor 2018-03-21 17:39:04 -04:00
Adrian Wielgosik 43a3ada8a9 Bug 1418077 - Remove nsIDOMHTMLFormElement. r=bz
MozReview-Commit-ID: 9eQxvfIMB22

--HG--
extra : rebase_source : f75e043da542b567e31d15db25791c738b275a09
2018-03-14 21:42:25 +01:00
Adrian Wielgosik 35f8ed790f Bug 1440741 - Remove all members from nsIDOMHTMLFormElement. r=qdot
MozReview-Commit-ID: 2UcUy4MkVsM

--HG--
extra : rebase_source : ddc6c18c5015ebc5569defa09b32c40e83939886
2018-02-23 19:28:08 +01:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Kris Maglione 1c66345e09 Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz
This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la

--HG--
extra : rebase_source : 5dba46f61d70ec647cae16383b62961ac72d2f47
2017-11-01 20:35:52 -07:00
Kris Maglione 4275cd1039 Bug 1406278: Part 1 - Pass subject principal to SetAttribute and friends. r=bz
In order to tailor certain security checks to the caller that is attempting to
load a particular piece of content, we need to be able to attach an
appropriate triggering principal to the corresponding requests. Since most
HTML content is loaded based on attribute values, that means capturing the
subject principal of the caller who sets those attributes, which means making
it available to AfterSetAttr hooks.

MozReview-Commit-ID: BMDL2Uepg0X

--HG--
extra : rebase_source : 25e438c243700a9368c393e40e3a6002d968d6c8
2017-10-09 14:33:38 -07:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Jan Henning f371937595 Bug 1398374 - Part 1 - Add helper method to test for the last non-disabled single line form input. r=bz
We want to treat those specially in IME handling.

MozReview-Commit-ID: 8OI2fDQEiGj

--HG--
extra : rebase_source : 03d15472572c9411cf10e941145e7fdbfd35323e
2017-10-01 15:57:16 +02:00
Jessica Jong 7ec4d944d8 Bug 1386969 - Change nsIRadioGroupContainer::Add/RemoveToRadioGroup() to take HTMLInputElement* as argument. r=bz
Currently, these two functions take nsIFormControl* as argument, but we only
pass HTMLInputElements to it, so we can change it to take HTMLInputElement* to
avoid overhead in casting.

MozReview-Commit-ID: CHG0F3xWCVF

--HG--
extra : amend_source : 6052bfec33bb8aa7d92e31b242757ed265256002
2017-08-03 02:39:00 -04:00
Ehsan Akhgari 540442244f Bug 1385324 - Part 2: Rewrite HTMLFormControlsCollection::GetSortedControls() to use RefPtr instead of raw pointers; r=qdot 2017-07-28 15:27:55 -04:00
Jessica Jong b52a4e5094 Bug 1366361 - Part 1: .action/formAction should return the document's URL if @action/formaction is missing or empty. r=smaug
MozReview-Commit-ID: H4CK0SVpaCv
2017-07-17 14:17:19 +08:00
Ehsan Akhgari 23e03fa69b Bug 1378983 - Improve the packing of HTMLFormElement; r=mystor
This brings the size of this node to 512 bytes on 64-bit debug builds.
2017-07-06 18:04:51 -04:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Kirk Steuber 99a80af5db Bug 1365092 - Move side effects of SetAttr, UnsetAttr, and ParseAttribute functions to BeforeSetAttr and AfterSetAttr r=bz
This is necessary to facilitate the transition to cloning attributes instead of reparsing them.

MozReview-Commit-ID: Gyd1tD6ldly

--HG--
extra : rebase_source : 777cfed750c95c448f953a6ec98026481997e227
2017-06-07 10:28:20 -07:00
Kirk Steuber e74f1cd513 Bug 1363481 - Add the old attribute value as a parameter to Element::AfterSetAttr r=bz
In order to facilitate the movement of code with side-effects called by Element::SetAttr to Element::BeforeSetAttr and Element::AfterSetAttr, Element::AfterSetAttr should have access to the old value of the attribute. This includes information about whether there was previously a value set or not.

Accomplishing this involved passing an additional argument through functions that find and change the old attribute value in order to ensure that we can differentiate between an empty old value and an absent old value (attribute was not set).

Note that while I tried to ensure that accurate values (and their absence) are reported to Element::AfterSetAttr, I largely ignored SVG. While the old value reported for SVG values should be however accurate the value already being reported to SetAttrAndNotify was, SVG elements do not currently report unset values properly because they will never pass a null pointer to SetAttrAndNotify.

MozReview-Commit-ID: K1mha8CNFZP

--HG--
extra : rebase_source : 42776eb01451d371e4aebcc17fe3dd112c8d268b
2017-05-18 14:09:01 -07:00
Jonathan Guillotte-Blouin 08c1af9cc5 Bug 1270740 - Remove requestAutocomplete DOM code. r=smaug
MozReview-Commit-ID: FPHXkOlLbKF

--HG--
extra : rebase_source : 144570d1a6428e761e11ad2cd94a3ba7a4a0b711
extra : amend_source : fe5b2ca83f18d648e71ebbcfab57ffaaa3b49fb8
2017-05-11 15:03:57 -07:00
Kirk Steuber 7fdb378650 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
John Dai d61dd33bd3 Bug 1312456 - Part 1: Remove Unicode case-insensitive matching for radio button groups. r=smaug 2017-01-04 23:22:00 -05:00
Boris Zbarsky 0b51e4d979 Bug 1318576. Remove entries from a form's past names map when an element is removed from the form, even if that element doesn't have a name or id anymore. r=baku 2016-11-21 12:34:02 -05:00
Stone Shih 1ed10ff082 Bug 1305458 Part1: Rename nsIDOMEventTarget::PreHandleEvent to nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: FM3vDUyLOCb

--HG--
extra : rebase_source : 5a513af84718a6d591f77437a0704984c8fc2b67
2016-10-21 10:11:07 +08:00
Edgar Chen 4e1969f9a4 Bug 1309508 - Part 2: Remove FormPasswordEventDispatcher class that could be replaced by AsyncEventRunning() approach. r=bz
MozReview-Commit-ID: EJZfQ6qX1di

--HG--
extra : rebase_source : 4ee0b9844344c038433e1a1c4c6d5f8206cd2a29
extra : histedit_source : 42883995c6fa925115ac135dcaae4a4e02405cee
2016-10-13 14:33:53 +08:00
Boris Zbarsky f04672a88c Bug 1287989. Don't try to do validation or fire submit events in iframes that are sandboxed without allow-forms. r=smaug 2016-08-02 11:05:36 -07:00
Boris Zbarsky ab51033732 Bug 1288581 part 2. Stop messing with the ExpandoAndGeneration's expando in CC code, since it's now traced by the reflector proxy. r=smaug 2016-07-22 16:19:52 -04:00
Andrea Marchesini aadce059f5 Bug 1279860 - part 1 - Renaming nsFormSubmission to mozilla::dom::HTMLFormSubmission, r=smaug
--HG--
rename : dom/html/nsFormSubmission.cpp => dom/html/HTMLFormSubmission.cpp
rename : dom/html/nsFormSubmission.h => dom/html/HTMLFormSubmission.h
rename : dom/html/nsFormSubmissionConstants.h => dom/html/HTMLFormSubmissionConstants.h
2016-06-16 08:24:16 +01:00
Jonathan Watt b15368cfcb Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
John Dai 1545cb9d2f Bug 1088761 - Support reportValidity() for form controls. r=smaug
From 2c2f7223e9d88f431f3e3fee7384dffbca07d8a9 Mon Sep 17 00:00:00 2001

--HG--
extra : rebase_source : 7daace21a903c55c893f0c6e7b0e0380b6ddca12
2016-04-15 16:13:00 +08:00