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

55 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 9890093d16 Bug 1606660 - Factor out AllowFullscreen checks for iframe. r=nika
This has the side effect of fixing support of mozallowfullscreen when
feature policy is enabled, because it checks only AllowFullscreen, which
doesn't check for the moz-prefixed attribute.

I left the swapframeloader bits alone because they're mozbrowser
specific and I have no idea what they're trying to do.

Differential Revision: https://phabricator.services.mozilla.com/D78701
2020-06-08 21:42:48 +00:00
Timothy Gu 6407f13ce3 Bug 1628500 - Remove aIgnoreTabindex argument from Element::IsInteractiveHTMLContent(). r=edgar
This argument is set to true everywhere, and soon HTML will no longer consider
tabindex for interactive content: https://github.com/whatwg/html/pull/5457.

Differential Revision: https://phabricator.services.mozilla.com/D72568
2020-04-28 11:22:32 +00:00
Kris Maglione 878d4b6711 Bug 1595936: Part 2 - Refresh feature policy when attaching browsing context. r=farre,baku
We go to great lengths to try to avoid initializing FrameLoaders during
document updates. That means that when `BindToTree` is called, the element's
FrameLoader is not initialized, and it has no BrowsingContext. Calling
`GetBrowsingContext()` (which happens as a side-effect of
`HTMLIFrameElement::RefreshFeaturePolicy`), however, forces eager
initialization, which can cause any number of problems.

This patch moves that logic from being triggered by `BindToTree` to being
triggered by `BrowsingContext::Embed`, which happens as soon as the
BrowsingContext is bound to the element, but does not force it to be created
early.

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

--HG--
extra : moz-landing-system : lando
2020-01-24 19:03:10 +00:00
Thomas Nguyen cf2f2ec008 Bug 1580462 - Store iframe's FeaturePolicy in browsingContext to inherit cross origin document. r=baku,farre
Differential Revision: https://phabricator.services.mozilla.com/D48825

--HG--
extra : moz-landing-system : lando
2019-10-23 19:39:00 +00:00
Razvan Maries 7fb625f8cf Backed out changeset ae33b9c001e5 (bug 1580462) for build bustages on nsWindow.cpp. CLOSED TREE 2019-10-23 11:07:00 +03:00
Thomas Nguyen a220530f6b Bug 1580462 - Store iframe's FeaturePolicy in browsingContext to inherit cross origin document. r=baku,farre
Differential Revision: https://phabricator.services.mozilla.com/D48825

--HG--
extra : moz-landing-system : lando
2019-10-22 14:36:00 +00:00
Emilio Cobos Álvarez 135388d85f Bug 1587457 - Remove Element::GetTokenList. r=bzbarsky
Looks like this used to be more generic, looking at:

https://hg.mozilla.org/mozilla-central/rev/263812990c503f6e238b33b2fd3314284ac1be3e

But now only specific element subclasses use it, and the token lists can just be
members in the relevant subclasses.

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

--HG--
extra : moz-landing-system : lando
2019-10-11 04:09:40 +00:00
Andrea Marchesini e87202df68 Bug 1514296 - Rename Document.policy to Document.featurePolicy, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35801

--HG--
extra : moz-landing-system : lando
2019-07-08 00:10:56 +00:00
Ciure Andrei d94259f899 Backed out 2 changesets (bug 1514296) for causing beta simulation failures CLOSED TREE
Backed out changeset 88f4a687f039 (bug 1514296)
Backed out changeset fe343795c247 (bug 1514296)
2019-07-08 03:03:22 +03:00
Andrea Marchesini e01cab332f Bug 1514296 - Rename Document.policy to Document.featurePolicy, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35801

--HG--
extra : moz-landing-system : lando
2019-07-06 15:10:59 +00:00
Cosmin Sabou 56754efbdb Backed out 3 changesets (bug 1514474, bug 1514296) for mochitest failures on test_featureList.html. CLOSED TREE
Backed out changeset 52ae606e4cfa (bug 1514296)
Backed out changeset e74168e44dd7 (bug 1514474)
Backed out changeset a43f3aa0ea77 (bug 1514296)
2019-07-03 17:29:15 +03:00
Andrea Marchesini 0bcffcfa72 Bug 1514296 - Rename Document.policy to Document.featurePolicy, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35801

--HG--
extra : moz-landing-system : lando
2019-07-03 13:02:05 +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 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
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 2f03a57005 Bug 1500448 - Avoid the parsing of the FeaturePolicy 'allow' attribute when not needed, r=ckerschb 2018-10-20 06:08:46 +02:00
Andrea Marchesini b496f7aed2 Bug 1496034 - Improve HTMLIFrameElement::GetFeaturePolicyDefaultOrigin, r=bz 2018-10-12 09:49:51 +02:00
Andrea Marchesini 721aaab922 Bug 1496034 - Apply bz's comments to FeaturePolicy, r=bz 2018-10-12 09:36:33 +02:00
Andrea Marchesini 4be054a731 Bug 1390801 - FeaturePolicy - part 2 - WebIDL + DOM integration, r=ckerschb 2018-10-01 08:09:44 +02: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
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 47ebd819b3 Bug 1449806: Merge {Servo,Generic}SpecifiedValues into MappedDeclarations. r=xidorn
The idea would be that this header is only included in cpp files, thus it's ok
to include ServoBindings, etc.

MozReview-Commit-ID: EgQEsR0cZd4
2018-06-25 11:14:39 +02: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
Boris Zbarsky 9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00
Boris Zbarsky 04324f18ad Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05:00
Narcis Beleuzu edb8ba34eb Backed out 2 changesets (bug 1424474) for mochitest failures on test_bug494328.html r=backout on a CLOSED TREE
Backed out changeset 39d5991f02ba (bug 1424474)
Backed out changeset da3dec2fce06 (bug 1424474)
2017-12-21 02:55:27 +02:00
Boris Zbarsky a2696c3c8a Bug 1424474 part 2. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag 2017-12-20 17:43:18 -05:00
Boris Zbarsky 887ce3941a Bug 1419270 part 2. Use getter or setter specific NeedsSubjectPrincipal annotations more. r=qdot
MozReview-Commit-ID: KBwjFh3TMUg
2017-12-05 16:03:18 -05: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 154e5011a0 Bug 1406278: Part 4 - Use subject principal as triggering principal in <iframe>/<frame> "src" attribute r=bz
MozReview-Commit-ID: AgxZmfRvfTR

--HG--
extra : rebase_source : 5663f54ae3d03870d38107e1703902df5ade4b10
2017-10-04 22:59:44 -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
Kyle Machulis 2090426dc0 Bug 1405792 - Remove nsIDOMHTMLIFrameElement r=bz
MozReview-Commit-ID: 1u9C66X8j59

--HG--
extra : rebase_source : 5d87fe933170e32fbb44e24ec843623e143164d2
2017-10-04 20:41:24 -07:00
Alphan Chen 126b75ecd5 Bug 1318988 - Implement allowPaymentRequest on iframe. r=baku
--HG--
extra : rebase_source : 976b3449ec72d01004323706414e3b26c653aaec
2017-07-18 10:16:28 +08: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
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
Manish Goregaokar 48bc1c741c Bug 1334330 - Part 1: stylo: Abstractify nsMappedAttributes to work on arbitrary containers of specified value data; r=bz,emilio
MozReview-Commit-ID: BSM4TC9RKot

--HG--
extra : rebase_source : 5f2c5d998b9e2bc10a2c9ce8d0b3ce90817a0d39
2017-01-26 13:39:13 -08: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 0d3521f59a Bug 1306241 - Use NeedsSubjectPrincipal in dom/html/* - part 1, r=ehsan 2016-10-03 10:34:14 +02:00
Boris Zbarsky 2b85094faf Bug 909633. Remove the HTML Microdata API, since no one else ended up implementing it and now it's been removed from the spec. r=bkelly,jgraham 2016-05-20 23:13:17 -04:00
Boris Zbarsky 00cfdef4b1 Bug 1257849 part 2. Pass in the right set of supported tokens to the sandbox tokenlist implementation. r=bkelly 2016-05-04 23:41:24 -04:00
Thomas Nguyen 3f10b1a2de Bug 1260664 - W3C Reflect referrerPolicy as a limited enumerated attribute. r=franziskuskiefer . r=smaug
MozReview-Commit-ID: Dppj4iuZnFp
2016-04-18 18:35:47 +08:00
Deepthi Venkitaramanan 008e6b8991 Bug 1244328 - Merge the functionality of DOMSettableTokenList into DOMTokenList and make everything that used to refer to DOMSettableTokenList refer to DOMTokenList instead. r=bzbarsky 2016-02-11 17:50:42 -05:00
Franziskus Kiefer 6bf24410e1 Bug 1187357 - rename referrer attribute to referrerpolicy. r=hsivonen 2015-11-30 16:13:03 -08:00
Xidorn Quan f6fe1e11ba Bug 1187801 part 3 - Add iframe fullscreen flag and stop auto-rollback when this flag presents. r=smaug
--HG--
extra : source : f7801f9c5b8e65862ead640f7b07ad87a40c9345
2015-10-08 17:47:39 +11:00
Franziskus Kiefer cafd09a21a Bug 1175736 - Implement the iframe referrer attribute. r=ckerschb, r=bz 2015-07-17 10:46:19 -07:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrea Marchesini e6f385fb3d Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00