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

72 Коммитов

Автор SHA1 Сообщение Дата
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
Nicholas Nethercote c86dc10505 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:

- a 16-bit C string literal, which is then converted to an 8-bit string in
  order for the lookup to occur;

- an 8-bit C string literal converted to a 16-bit string, which is then
  converted back to an 8-bit string in order for the lookup to occur.

This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.

The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.

Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.

The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)

--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
2017-07-12 15:13:37 +10:00
Stone Shih 1da6cd22e9 Backed out changeset 367b6f947f87 (bug 1370630) for breaking mozilla-internal jenkins site. r=backout. 2017-07-11 15:59:03 +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
Stone Shih 3fdee5b48d Bug 1370630 - Untrusted submit event shouldn't trigger form submission. r=smaug.
MozReview-Commit-ID: 6jl7Xvh1Y1Y
2017-06-19 15:46:07 +08:00
Mats Palmgren c4e9c5bd78 Bug 1375691 - Make RadioNodeList final and cleanup the code using it. r=bz
MozReview-Commit-ID: IJr4oMCoeJG
2017-06-29 20:53:46 +02:00
Mats Palmgren 4ab83f8814 Bug 1375688 - Use Lookup instead of Get+Remove/Put, and LookupForAdd instead of Get+Put, to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 1V611ywc3EQ
2017-06-29 20:53:46 +02: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
Birunthan Mohanathas 5e41427024 Bug 903966 - Stop blocking 'http://127.0.0.1/' as mixed content. r=ckerschb,kmckinley
According to the spec, content from loopback addresses should no longer
be treated as mixed content even in secure origins. See:
- 349501cdaa
- https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy

Note that we only whitelist '127.0.0.1' and '::1' to match Chrome 53 and
later. See:
- 130ee686fa

It is unclear if HTTPS origins should be able to use workers and WebSocket
connections through a loopback HTTP address. They are not supported in Chrome
(whether this is intentional or not is uncertain) so lets just ignore them for
now.

See also: https://github.com/w3c/web-platform-tests/pull/5304
2017-05-10 20:50:00 +03:00
Jessica Jong 57c042eeb9 Bug 1358448 - Add radio back to a radio group after moving out of a form. r=smaug
The container of a radio group is the form, if it belongs to a form, or the
document object otherwise.
When moving a radio out of a form, we should add it back to a radio group.
Similary, before moving the radio to a form, we should remove it from the
original radio group.

MozReview-Commit-ID: 22WsEhz2SXH

--HG--
extra : rebase_source : 68dbd50da523b734086d8e5de6e6ae179b0b4af0
2017-05-01 23:10:00 +02:00
Olli Pettay d47c995985 Bug 1351860 - Move mType from HTMLInputElement to nsIFormControl and make GetType non-virtual inlined, r=jessica
--HG--
extra : rebase_source : b7d76ce3321ea0d622da74a72b7278fd0fa63310
2017-03-31 22:49:00 -04:00
Olli Pettay 31b1f5cc92 Backout Bug 1351860, r=backout 2017-03-31 16:55:32 -04:00
Olli Pettay b84c192a09 Bug 1351860 - Move mType from HTMLInputElement to nsIFormControl and make GetType non-virtual inlined, r=jessica
--HG--
extra : rebase_source : 5f2cac2c4e944e2c9f2f1acf0d3064e153c40451
2017-03-31 13:13:36 -04:00
Cameron McCormack babad063ff Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
Gijs Kruitbosch be8efc6f08 Bug 1314249 - if the target changes, assume we should not pass an opener ref, r=smaug
MozReview-Commit-ID: 7DBrRW1WiMP

--HG--
rename : browser/base/content/test/general/browser_bug1064280_changeUrlInPinnedTab.js => browser/base/content/test/tabs/browser_navigatePinnedTab.js
extra : rebase_source : 2aa1a459e07cd0d326e9c3d6e1b87afd0dbbc28b
2016-11-16 16:31:42 +00: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
Jeremy Chen e42a48e81d Bug 1297306 - part5:create enum constructors for EnumTable. r=baku
Enable nsAttrValue::EnumTable to be initialized with enum. So, we could get rid
of the castings in EnumTable. Fix EnumTable initialization comment.

For those untyped enumerations, declare them with uint8_t, as to other typed
enumerations with type size larger than int16_t, force casting to int16_t.

Use {nullptr,0} instead of {0} to represent the last entry.

MozReview-Commit-ID: 7Dma3Apkmxj

--HG--
extra : rebase_source : b2289866c4c33d80c8e170727bf109d018d92f67
2016-09-07 10:20:17 +08:00
Boris Zbarsky d2b05776d7 Bug 1270369. HTMLFormElemement should have unenumerable named properties per spec. r=bkelly 2016-08-31 10:57:40 -04:00
Thomas Wisniewski dda8b0ae6b Bug 1285425 - Set forms to valid in their constructor. r=bz 2016-08-09 16:23:40 -04:00
Carsten "Tomcat" Book 6b13b3cde6 Merge mozilla-central to autoland 2016-08-03 17:08:48 +02:00
Masayuki Nakano 91380f92d1 Bug 1259672 Rename InternalFormEvent::originator to mOriginator r=smaug
MozReview-Commit-ID: 1RoHVeziNr3

--HG--
extra : rebase_source : 85c63944e477603cee3a36e435c83890ea037715
2016-08-03 17:06:10 +09: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
Chris Peterson b175c9fdd5 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
Andrea Marchesini 6f89091771 Bug 1279860 - part 3 - HTMLFormSubmission::GetFromForm, r=smaug 2016-06-16 08:25:48 +01: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
John Dai e05f13cdbb Bug 1088761 - Remove redundant trailing spaces. r=smaug
From b52ed31558ac41e31b7a885a988475b07f3aa3fe Mon Sep 17 00:00:00 2001

--HG--
extra : rebase_source : 42f91a3fa39a277c486342baad523d95e044b309
2016-04-12 19:02:42 +08:00
Sebastian Hengst acc64686c7 Backed out changeset 3ff28843a8f8 (bug 1088761) for failing form-validation-reportValidity.html on OSX 10.10 debug. r=backout 2016-05-12 13:19:22 +02:00
John Dai b0ac1b27cb Bug 1088761 - Remove redundant trailing spaces. r=smaug
--HG--
extra : rebase_source : aea196343737511284cbe3ea2c7fc052987a8c85
2016-05-11 04:23:00 +02:00
Boris Zbarsky 59de5a530f Bug 1270349 part 5. Use LegacyUnenumerableNamedProperties instead of passing flags to GetSupportedNames to determine whether named props on DOM proxies should be reflected in ownPropertyKeys. r=peterv 2016-05-09 22:25:40 -04:00
Boris Zbarsky 76180fb5a7 Bug 1270349 part 4. Use LegacyUnenumerableNamedProperties instead of NameIsEnumerable() calls to determine whether named props on DOM proxies should be enumerable. r=peterv 2016-05-09 22:25:40 -04:00
Masayuki Nakano 9170348baf Bug 1259656 part.7 Rename WidgetEvent::originalTarget to WidgetEvent::mOriginalTarget r=smaug
MozReview-Commit-ID: G1WVCWkS0Lt

--HG--
extra : rebase_source : e4790266f4efa33269c073bca1d98f9e8e6c90d7
2016-04-19 01:33:23 +09:00
Jonathan Watt fb7bb15e68 Bug 1263782 - Kill off the deprecated nsINode::IsInDoc(). r=baku 2016-03-31 11:58:25 +01:00
Christoph Kerschbaumer ba26bfd31e Bug 1251043 - Bail early with error if form-action blocks loading. r=francois 2016-03-23 11:15:20 -07:00
Masayuki Nakano d185d40ab2 Bug 1256589 part.1 Move the implementation of StopPropagation() from dom::Event to WidgetEvent r=smaug
MozReview-Commit-ID: Br5eBgC8TbW

--HG--
extra : rebase_source : 0e5743583f80b3e9e09397f49bd438bfe0f49d06
extra : source : 745c9d855d209780a884bd7a3d2cd3cdc20632af
2016-03-17 11:17:42 +09:00
Daniel Holbert 447b3ae749 Bug 1249450 part 2: Convert some nsIURI SetScheme("https") calls to use NS_GetSecureUpgradedURI instead. r=mcmanus 2016-03-10 15:23:46 -08:00
Andrew McCreight b80e656e9e Bug 1247679, part 3 - Replace NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK with JS_MEMBER. r=smaug 2016-02-22 10:11:02 -08:00
Kyle Huey 6d8924b5e6 Bug 1245314: Restore a null check for a non-existent inner window in form submission. r=baku 2016-02-03 13:30:46 -08:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Nicholas Nethercote 893eeadcd4 Bug 1187151 (part 7) - Replace nsBaseHashtable::Enumerate() calls in dom/ with iterators. r=khuey.
--HG--
extra : rebase_source : 2783c4611f0c0b8e1f5eaaa84f06f6d6bac20700
2016-01-27 16:04:59 -08:00
Christoph Kerschbaumer 071f422450 Bug 1233098 - Refactor CSP upgrade insecure requests flag within loadInfo (r=sicking) 2016-01-14 12:38:15 -08:00
Nigel Babu 7089beabc7 Backed out changeset f51b921e1ccf (bug 1233098) for browser-chrome bustage
--HG--
extra : commitid : ytS8fc4lFu
2016-01-14 08:04:37 +05:30
Christoph Kerschbaumer c42851930c Bug 1233098 - Refactor CSP upgrade insecure requests flag within loadInfo (r=sicking) 2016-01-13 15:51:43 -08:00
Andrea Marchesini 4fd7346fa1 Bug 1237674 - Rename nsFormData to mozilla::dom::FormData, r=smaug
--HG--
rename : dom/base/nsFormData.cpp => dom/base/FormData.cpp
rename : dom/base/nsFormData.h => dom/base/FormData.h
2016-01-07 19:30:36 +00:00
Makoto Kato 1929f6c7c4 Bug 1218315 - Replace NS_LITERAL_STRING(...).get() with MOZ_UTF16(...) on dom. r=nfroyd 2015-10-28 14:29:57 +09:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00