Commit Graph

67 Commits

Author SHA1 Message Date
Gabriele Svelto
ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca
a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto
bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
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
Boris Zbarsky
47341d0933 Bug 1553276. Don't enter the content compartment when calling a Web IDL legacycaller over Xrays. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D32047

--HG--
extra : moz-landing-system : lando
2019-05-21 19:49:18 +00:00
Sylvestre Ledru
7f60810d86 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-12 13:14:25 +00:00
Yoshi Cheng-Hao Huang
222255214e Bug 1534967 - Part 1: use RootedIdVector. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D25042
2019-04-08 10:46:53 +08:00
Kyle Machulis
2bb286e58e Bug 1524683 - Move all nsIFrameLoaderOwner references to nsFrameLoaderOwner; r=nika
Depends on D19728

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

--HG--
extra : moz-landing-system : lando
2019-02-15 22:20:53 +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
Peter Van der Beken
a17049feac Bug 1353867 - Change WindowProxy type. r=bzbarsky
Add a WindowProxyHolder type and generate binding code that takes or returns it whenever
the WebIDL refers to the WindowProxy type. This patch just makes the WindowProxyHolder
hold a strong reference to a nsPIDOMWindowOuter.

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

--HG--
extra : moz-landing-system : lando
2019-01-02 13:26:56 +00: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
Bogdan Tara
3eb2f351ae Backed out 6 changesets (bug 1353867) for nsDocShell.cpp failures CLOSED TREE
Backed out changeset aa9b106b15d9 (bug 1353867)
Backed out changeset 8c05f4d3f7ad (bug 1353867)
Backed out changeset 00869bed4121 (bug 1353867)
Backed out changeset 700aeb906fd2 (bug 1353867)
Backed out changeset 8b60851b93da (bug 1353867)
Backed out changeset ebdf4531b3bd (bug 1353867)
2018-12-31 17:47:12 +02:00
Peter Van der Beken
68a88553fa Bug 1353867 - Change WindowProxy type. r=bzbarsky
Add a WindowProxyHolder type and generate binding code that takes or returns it whenever
the WebIDL refers to the WindowProxy type. This patch just makes the WindowProxyHolder
hold a strong reference to a nsPIDOMWindowOuter.

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

--HG--
extra : moz-landing-system : lando
2018-12-31 10:50:36 +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
Boris Zbarsky
47f81c215b Bug 1507540 part 7. Use notxpcom more in dom/. r=mccr8 2018-11-19 20:20:17 -05: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
Neil Deakin
0d504e92c3 Bug 1437638, move frame loader property from XULElement to XULFrameElement, removing many checks that only apply to child frames instead of every XUL element. Since it is assumed that most frames/browsers will have frame loaders created for them, and that there aren't many of them, we can use a member field instead of slots, so remove the slot property, r=bz 2018-07-05 20:14:29 -04:00
Jan de Mooij
29f84e7bf2 Bug 1461292 part 4 - Remove unnecessary JSAutoRealm from GetPluginJSObject. r=bz 2018-05-16 21:05:29 +02:00
Kyle Machulis
54713b5c80 Bug 1433221 - Revert changes to classid checks for object tags; r=bz
As part of applet/java plugin removal in bug 1279218, classid checking
was removed, as it was not obvious that this was used anywhere other
than java plugins. The classid is still a valid attribute on object
tags (and is sometimes used on tags for flash embedding). We want
to use a fallback strategy when we find objects with classid
attributes, as we don't support them, meaning we need to revert our
prior removal of the check.

MozReview-Commit-ID: BKQ34HGTkvt

--HG--
extra : rebase_source : 671bc831a7b500ba1a5643a8dbae69dd0c44acf4
2018-04-30 21:53:48 -07:00
Boris Zbarsky
d989f864ea Bug 1444143 part 14. Rename nsIFrameLoader.idl to nsIFrameLoaderOwner.idl. r=mystor
MozReview-Commit-ID: 1XpEjoFLSQh

--HG--
rename : dom/base/nsIFrameLoader.idl => dom/base/nsIFrameLoaderOwner.idl
2018-03-21 22:43:17 -04:00
Doug Thayer
f55615a8df Bug 1398972 - Replace usage of plugin doorhanger XBL binding r=Felipe
Migrated to simply use PopupNotifications.jsm. Additionally, this
changes the behavior to always have two buttons and a remember
checkbox. When selecting allow with remember, it will behave like
the always allow option previously, but when selecting block with
remember, it will move that page into a quiet mode with respect
to Flash - i.e., no plugin overlays will show anymore, and instead
you will just see the plugin icon in the URL bar, which you can
continue to interact with as before.

MozReview-Commit-ID: EUFlI7nM09t

--HG--
extra : rebase_source : 4f6fdaa602ea6c398cc646ba98282ee5c154956e
2017-10-31 11:40:04 -07:00
Kyle Machulis
2f8387c6cb Bug 1398071 - Rewrite youtube embeds that use enablejsapi; r=cpeterson
Youtube has now deprecated flash embeds completely, meaning
enablejsapi in embeds will no longer work. We can now rewrite these to
use HTML5, as any functionality related to the js api will no
longer function anyways.

MozReview-Commit-ID: kZTwpyLaYw

--HG--
extra : rebase_source : 7b6516183a4c7de8fe47fb328e4f28f3ad7bc03f
2017-09-08 12:59:52 -07:00
Kyle Machulis
d812ac4e87 Bug 1279218 - Additional applet tag logic removal; r=bz
I've been having problems with interdiffs on mozreview lately, so for
ease of review, this patch is being submitted as a seperate patch for
review. Once it is r+'d, it will be folded into the first patch in
this set before landing.

MozReview-Commit-ID: CS9MngaXlBd

--HG--
extra : rebase_source : 6a86fd4f7a66e73497a756976a2562d183002a2a
2017-07-28 16:44:39 -07:00
Kyle Machulis
7eb9927ed4 Bug 1279218 - Remove Applet/Java support from nsObjectLoadingContent; r=bsmedberg,bz
MozReview-Commit-ID: AY6lYwS6NEU

--HG--
extra : rebase_source : deb4a6861a5d5e72e0ab18c64e5e1125d4bc4f05
2017-07-27 19:21:18 -07:00
Boris Zbarsky
d7ec8ed805 Bug 1372371. Fix enumerability handling in the window resolve hook. r=qdot 2017-06-12 22:17:03 -04:00
Boris Zbarsky
febf0f30d6 Bug 1364816 part 5. Make getting window names a bit faster by avoiding various intermediate strings. r=qdot,jandem 2017-06-06 21:21:45 -04:00
Peter Van der Beken
2310b3bd39 Bug 558184 - Part 8 - Load js plugins in a separate process. r=billm.
Every JS plugin is assigned a unique ID. When an instance of a JS plugin is created the
frame loader that we use to load the plugin's handler URI will create a special
TabContext. This TabContext causes the ContentParent to use the process for this specific
JS plugin (creating one if it hasn't already) when it creates the PBrowser actors.
This causes the iframes for all the instances of a specific JS plugin to be grouped in the
same process.

--HG--
extra : rebase_source : c39560bdf66cda1a005c7b823b3a46e4734878a4
extra : source : 9cba1db527c7eed4371c9f4caf96fd942608cab6
2017-05-29 12:38:46 +02:00
John Schoenick
4ce6580106 Bug 558184 - Part 4.3 - Load fake plugin handlers as eType_FakePlugin in nsObjectLoadingContent. r=peterv.
--HG--
extra : rebase_source : 4683568e90fd65a38c974aa755dd5f6f94479ee3
extra : source : 8e4be859c1a1ec73b29df98422d5ee6935cd9aa9
2015-05-20 15:30:05 +02:00
Michael Layzell
28a69a2cac Bug 1337056 - Part 7: Refactor nsObjectLoadingContent::GetTypeOfContent logic out into nsContentUtils, r=qdot
MozReview-Commit-ID: IJQNhQZzx3y
2017-03-21 11:08:03 -04:00
Mats Palmgren
6ef6efaea3 Bug 1340771 part 2 - Introduce a WeakFrame class for heap allocated weak frame pointers, stored in a hashtable for fast lookup. r=tn
* * *
Bug 1340771 part 3 - Change existing heap allocated AutoWeakFrame instances to use WeakFrame instead.  r=tn

MozReview-Commit-ID: GSuUiy98jBa
2017-03-01 18:03:14 +01:00
Mats Palmgren
d13aaf9ce0 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Boris Zbarsky
44299d0343 Bug 1332956 part 3. Implement the same behavior for <object>-inside-<object> and <object>-inside-mediaelement as we do for <embed> already. r=qdot
--HG--
rename : testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html => testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-ignored-in-media-element.html
rename : testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-2.html => testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-in-object-fallback-2.html
2017-02-08 18:19:01 -05:00
Carsten "Tomcat" Book
ad42fa5bcb Backed out changeset bdea29a8b0f3 (bug 1332956)
--HG--
extra : rebase_source : 6f70d61486f1d583ab0632476b552ef002ad1b89
2017-02-09 11:33:14 +01:00
Boris Zbarsky
e674c80494 Bug 1332956 part 3. Implement the same behavior for <object>-inside-<object> and <object>-inside-mediaelement as we do for <embed> already. r=qdot
--HG--
rename : testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html => testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-ignored-in-media-element.html
rename : testing/web-platform/tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-2.html => testing/web-platform/tests/html/semantics/embedded-content/the-object-element/object-in-object-fallback-2.html
2017-02-08 18:19:01 -05:00
Jet Villegas
f3535dc1b5 Bug 1311368 - Fix ShouldBlockContent logic when content blocking is enabled. r=tobytailor
--HG--
extra : amend_source : fdf881c7518bd109242731721e0cf02b499c13a4
2017-02-06 16:40:00 -05:00
Boris Zbarsky
d9a60c022b Bug 1335368 part 7. Mostly stop using IsCallerChrome in nsObjectLoadingContent. r=bholley 2017-02-01 15:43:36 -05:00
Felipe Gomes
cedca668f6 Bug 1282484 - Cache the value of PreferFallback() because ShouldPlay() is called several times during the load process. r=qDot
MozReview-Commit-ID: DqjCHssaJde
2017-01-24 03:07:51 -02:00
Felipe Gomes
917ff060cb Bug 1282484 - Add a mechanism to control plugin fallback content. r=qDot
MozReview-Commit-ID: Lt4tOdFdQzN
2017-01-24 03:07:41 -02:00
Chris Peterson
26308b5b88 Bug 1317111 - Remove RealPlayer plugin quirk handling. r=mats 2016-11-16 13:44:24 -08:00
Andi-Bogdan Postelnicu
aaf2063029 Bug 1317241 - Replace default bodies of special member functions with = default in dom/. r=baku
MozReview-Commit-ID: 12AHOhrpaNO

--HG--
extra : rebase_source : 7881277a13fe7389b95635ee9b94f1686f56d142
2016-11-14 11:40:37 +02:00
Michael Layzell
f9eea2d135 Bug 1303196 - Part 2: Connect the DocGroup and TabGroup objects to nsGlobalWindow and nsDocument, ensuring that Opener is set early enough that it is correct, r=smaug
MozReview-Commit-ID: 3rZfLw3dXkF
2016-10-27 15:53:35 -04:00
Boris Zbarsky
3f10f5ed57 Bug 1308287 part 1. Change [NeedsSubjectPrincipal] to only do the Maybe thing for interfaces that can be exposed to workers. r=baku
The idea is to not make consumers think about whether the principal exists or
not when the caller knows for sure that it does.

The substantive changes are in dom/bindings, nsHTMLDocument::SetDesignMode, and
around the CanUseStorage bits.  Everything else is pretty mechanical.
2016-10-10 21:07:48 -04:00
Andrea Marchesini
75ee078310 Bug 1306241 - Use NeedsSubjectPrincipal in dom/html/* - part 2, r=ehsan 2016-10-03 10:34:29 +02:00
Nicholas Nethercote
e4eb76b618 Bug 1297300 - Add missing checks to GetSpec() calls in dom/base/. r=bz.
--HG--
extra : rebase_source : 55e83aad222825b2dd1399fa42eee6b6c894d0ee
2016-09-08 14:17:58 +10:00
Tobias Schneider
ce4badc7bc Bug 1268120 - Make plugin content blocking work on e10s. r=francois 2016-06-17 11:05:42 +01:00
Masatoshi Kimura
e4ae8f8bff Bug 1282038 - Allow allowfullscreen for rewritten YouTube Flash embeds. r=qdot,jst
MozReview-Commit-ID: I8y0gMA5BxE

--HG--
rename : dom/base/test/test_youtube_flash_embed.html => dom/base/test/file_youtube_flash_embed.html
2016-06-24 19:12:53 +09:00
Boris Zbarsky
d157959ac1 Bug 1003797. Fire error events for <object> per spec. r=qdot 2016-06-23 00:32:23 -04:00
J. Ryan Stinnett
013ba36705 Bug 1242644 - HTML swapFrameLoaders. r=bz
Adds swapFrameLoaders for HTML frames.  It is also possible to swap frame
loaders between XUL and HTML frames.

MozReview-Commit-ID: 43JeiBuMcOL
2016-03-31 19:47:44 -05:00
Kyle Machulis
79cb11f843 Bug 1240471 - Possibly remove invalid queries and post console messages on youtube rewrite; r=khuey fb=cpeterson 2016-03-01 14:05:29 -08:00