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

54 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Ryan Hunt 00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Jonathan Kingston f6680698bd Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881

--HG--
extra : moz-landing-system : lando
2019-02-27 23:42:27 +00:00
Jonathan Kingston c4853316e7 Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770

--HG--
extra : moz-landing-system : lando
2019-02-27 23:41:31 +00:00
Jonathan Kingston f7e35ae39e Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769

--HG--
extra : moz-landing-system : lando
2019-02-27 23:41:04 +00:00
Alex Gaynor 0e903787da Bug 1415508 - use Span in constructing a byte input stream; r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20687

--HG--
extra : moz-landing-system : lando
2019-02-25 19:11:20 +00:00
Dorel Luca 4a4dcd57fa Backed out 4 changesets (bug 1525319) for Android failures in dom/base/test/test_progress_events_for_gzip_data.html
Backed out changeset b73f033efb41 (bug 1525319)
Backed out changeset 1d318d5c6b98 (bug 1525319)
Backed out changeset 6d73418988d4 (bug 1525319)
Backed out changeset 84ca79bd2dc3 (bug 1525319)
2019-02-25 04:06:11 +02:00
Jonathan Kingston 63ab2bd8aa Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881

--HG--
extra : moz-landing-system : lando
2019-02-24 20:27:55 +00:00
Jonathan Kingston 332531fa9c Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770

--HG--
extra : moz-landing-system : lando
2019-02-24 20:26:59 +00:00
Jonathan Kingston 2441197975 Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769

--HG--
extra : moz-landing-system : lando
2019-02-24 20:26:16 +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
Emilio Cobos Álvarez 63814207cb Bug 1516853 - Merge nsIDocument and nsDocument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D15498

--HG--
extra : moz-landing-system : lando
2018-12-31 14:10:19 +00: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
Andrea Marchesini a053cf1c15 Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 1 - NullPrincipal, r=ckerschb 2018-07-17 21:37:48 +02:00
Adrian Wielgosik 4fca802957 Bug 1460940 - Convert NS_NewDOMDocument to use nsIDocument. r=bz
MozReview-Commit-ID: GoJ30YZGRhq

--HG--
extra : rebase_source : 0995705c2c31c1a779c22c8336482d4c7e89e319
2018-05-11 19:46:15 +02:00
Boris Zbarsky 71a7545cf3 Bug 1455026. Remove support for weak references from DOMParser. r=qdot
MozReview-Commit-ID: GYCJ2fu2ZI9
2018-04-20 23:04:46 -04:00
Boris Zbarsky edb98511f4 Bug 1453869 part 16. Add a way to create a DOMParser directly from C++. r=mrbkap
Thunderbird uses DOMParser from C++ for now.  They should ideally migrate that into JS, but we can give them something that works for the moment.

MozReview-Commit-ID: C4D6QuFdbn8
2018-04-20 23:04:46 -04:00
Boris Zbarsky 91fa78892d Bug 1453869 part 15. Remove nsIDOMParser. r=mrbkap
MozReview-Commit-ID: 8gGb1qO56gu
2018-04-20 23:04:46 -04:00
Boris Zbarsky f8f22a4ffe Bug 1453869 part 14. Make the document and base URIs arguments to the DOMParser constructor. r=mrbkap
Init() is no longer needed, and the mAttemptedInit machinery can all go away.

MozReview-Commit-ID: 3wNavKLGdlc
2018-04-20 23:04:45 -04:00
Boris Zbarsky 9c8b0407da Bug 1453869 part 13. Make DOMParser store an nsIGlobalObject* as mOwner. r=mrbkap
Incidentally, we can remove mScriptHandlingObject, because mOwner is always the same object anyway.

MozReview-Commit-ID: 1txkjkKvBsi
2018-04-20 23:04:45 -04:00
Boris Zbarsky 32b5faa035 Bug 1453869 part 12. Make the DOMParser constructor require a principal. r=mrbkap
We always have one now.  So we can remove all the codepaths that attempted to
handle the !mPrincipal case.

We can also remove the nsContentUtils::IsSystemPrincipal(mPrincipal) codepaths,
because that can never happen: DOMParser::Constructor never creates a DOMParser
with a system principal.

MozReview-Commit-ID: EUrGoiI0o3u
2018-04-20 23:04:45 -04:00
Boris Zbarsky c1040dfa6b Bug 1453869 part 11. Inline DOMParser::InitInternal into its one caller. r=mrbkap
The other caller went away all the way back in part 1 of bug 1453869.

MozReview-Commit-ID: pJttjegpBm
2018-04-20 23:04:45 -04:00
Boris Zbarsky 1df89947b2 Bug 1453869 part 10. Stop constructing DOMParser by contract. r=mrbkap
MozReview-Commit-ID: A0bHF5RHhs6
2018-04-20 23:04:45 -04:00
Boris Zbarsky c2c06950b8 Bug 1453869 part 7. Make the DOMParser WebIDL constructor use a nullprincipal for the document if the caller is system-principal. r=mrbkap
In our test suite, we only run into two calls to this constructor with a system
principal, and both are in test code.

After this, calling the WebIDL constructor from system code is _almost_
equivalent to creating by contract.  The one difference is that the resulting
DOMParser (and the documents it creates) will have its script handling object
set to the global the constructor came from instead of being null.

MozReview-Commit-ID: Fe2yMeqoYnB
2018-04-20 23:01:25 -04:00
Boris Zbarsky df6591442f Bug 1453869 part 6. Remove nsIDOMParser::ParseFromStream. r=mrbkap
MozReview-Commit-ID: L2QKWgDE6UM
2018-04-20 23:01:25 -04:00
Boris Zbarsky 54fbc1b396 Bug 1453869 part 5. Remove nsIDOMParser::ParseFromBuffer. r=mrbkap
MozReview-Commit-ID: 4KuM0HRI2BC
2018-04-20 23:01:25 -04:00
Boris Zbarsky af62ed5dc8 Bug 1453869 part 4. Remove nsIDOMParser::ParseFromString. r=mrbkap
MozReview-Commit-ID: CoepOZNb0DU
2018-04-20 23:01:25 -04:00
Boris Zbarsky 4527d58c1c Bug 1453869 part 3. Remove the used-only-in-tests DOMParser.init method. r=mrbkap
Some DOM unit tests rely on being able to parse XUL via DOMParser.  That was allowed due to them calling init() with a system subject principal.  It can be more narrowly allowed by adding an explicit setter for being able to parse XUL/XBL.

MozReview-Commit-ID: 3h0WWGHmYOn
2018-04-20 23:01:24 -04:00
Boris Zbarsky 2cb41e7954 Bug 1453869 part 2. Get rid of the unused nsIDOMParser::Init method. r=mrbkap
MozReview-Commit-ID: B3HVscqYE6G
2018-04-20 23:01:24 -04:00
Boris Zbarsky bada81a4e5 Bug 1453869 part 1. Remove the unused 3-arg constructor from DOMParser. r=mrbkap
MozReview-Commit-ID: 1fWzq6rMWf1
2018-04-20 23:01:24 -04:00
Tom Ritter 449237fc51 Bug 1378552 - Reduce the liklihood of inadvertently misusing NullPrincipal::Create(). r=ckerschb
NullPrincipal::Create() (will null OA) may cause an OriginAttributes bypass.
We change Create() so OriginAttributes is no longer optional, and rename
Create() with no arguments to make it more explicit about what the caller is doing.

MozReview-Commit-ID: 7DQGlgh1tgJ
2018-03-22 13:36:20 -05:00
Emilio Cobos Álvarez c03ffd9c62 Bug 1425759: Simplify the style backend type setup. r=bholley
Now that what we use to decide whether a document is styled by Servo are only
prefs and the doc principal, we don't need to inherit the style backend type,
since unless the pref has changed, the result will be the same.

MozReview-Commit-ID: KBmeBn1cRne
2018-02-27 12:39:20 +01:00
Chris Peterson edb82b8131 Bug 1416164 - Replace NS_POSTCONDITION with MOZ_ASSERT. r=froydnj
MozReview-Commit-ID: 9K3Ksf36uxr

--HG--
extra : rebase_source : c5574794ae0e0ce5e756bdbcc2601896d6916002
2017-11-04 22:48:48 -07:00
Andrea Marchesini 6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Xidorn Quan a0f7c55075 Bug 1398619 - Correctly inherit backend for document created by DOMParser, and add test for it. r=bholley
The old code doesn't work because mScriptHandlingObject is a nsWeakPtr,
which cannot be casted to nsPIDOMWindowInner directly.

Since scriptHandlingObject is a strong reference to the same object, we
can just try casting that.

MozReview-Commit-ID: JRBs5N6xxc0

--HG--
extra : rebase_source : cd0237553198182b00ff9c667a17271b23464567
2017-09-12 14:28:27 +10:00
Bobby Holley d42f0733ac Bug 1389300 - Inherit style backend into NS_NewDOMDocument. r=smaug,r=heycam
Our current machinery for enabling stylo requires a docshell - if there isn't
one, we default to the Gecko style system.

When getComputedStyle operates on an element without a presshell, it uses the
caller's presshell instead. If the element has previously been styled with
one style system (but no longer has a presshell), and the caller uses a
different style backend, using the caller's style system can cause crashes when
we pull bits of cached data off the DOM (like cached style attributes).

So we want to throw when window.getComputedStyle(element) is called for a
(window, element) pair with different style backends (which is what the next
patch in this bug does).

However, that causes a few failures where stylo-backed documents try to do
getComputedStyle on an XHR document (which, without a docshell, will use the
gecko style system).

So this patch does some work to propagate the creator's style backend into
various docshell-less documents. This should allow both chrome (which uses gecko)
and content (which uses stylo) to use getComputedStyle on the response document
for XHRs they create.

Note that the second patch in this bug will make
chromeWin.getComputedStyle(contentObj) throw. If we discover code that does
that, we can just make it invoke the content's getComputedStyle method over Xrays.

MozReview-Commit-ID: 5OsmHJKq5Ui
2017-08-15 19:10:43 -07:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Andrea Marchesini 1fd1bc3935 Bug 1343933 - Renaming Principal classes - part 2 - NullPrincipal, r=qdot
--HG--
rename : caps/nsNullPrincipal.cpp => caps/NullPrincipal.cpp
rename : caps/nsNullPrincipal.h => caps/NullPrincipal.h
rename : caps/nsNullPrincipalURI.cpp => caps/NullPrincipalURI.cpp
rename : caps/nsNullPrincipalURI.h => caps/NullPrincipalURI.h
2017-03-22 11:38:40 +01:00
Ehsan Akhgari 012ba2217d Bug 1336213 - Part 2: Remove DOMParser::mOriginalPrincipal; r=bzbarsky 2017-02-03 10:46:45 -05:00
Ehsan Akhgari d250dc8172 Bug 1336213 - Part 1: Set the right principal on the documents created by DOMParser from the beginning; r=bzbarsky 2017-02-03 10:46:40 -05:00
Boris Zbarsky ada37acb39 Bug 1335368 part 1. Stop using IsCallerChrome in DOMParser::Constructor. r=bholley 2017-02-01 15:43:35 -05:00
Andrea Marchesini 359ae91eac Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
Dave Huseby f4337b6262 Bug 1237080 - adds deprecation msg for chrome scripted DOMParser without principal. r=baku
MozReview-Commit-ID: FuolzJOcslX
2016-06-07 18:57:45 -07:00
Jonathan Hao 525c086187 Bug 1259871 - Replace getSimpleCodebasePrincipal with createCodebasePrincipal. r=sicking
MozReview-Commit-ID: Frx0CjBzuve

--HG--
extra : histedit_source : 036eb321d9ccb20e0e071ba588b0a1249eb34bdd
2016-05-24 18:01:34 +08:00
Yoshi Huang ba1bb72568 Bug 1263496 - Part 3: fix for nsNullPrincipal::Create
This fixed the locations listed by
http://searchfox.org/mozilla-central/search?q=nsNullPrincipal::Create(&redirect=true
that needs to inherit origin attributes.
2016-04-27 18:38:07 +08:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08: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
Kit Cambridge a958ff06d5 Bug 1209361 - Add missing includes to `dom/base`. r=mccr8
--HG--
extra : commitid : 3rsv1VgB0jB
extra : rebase_source : 677d913e8a0e0955963bbdb65d0e759e9148df7a
2015-09-28 21:31:56 -07:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Nathan Froyd 1e6cdad33c Bug 1153988 - create nsNullPrincipals directly, rather than going through do_CreateInstance; r=smaug
There's a better way to create null principals than
do_CreateInstance("@mozilla.org/nullprincipal;1").  Let's do that and
save ourselves some XPCOM overhead.
2015-04-13 14:47:41 -04:00