Previous design allows us calling resume/block from both front-end and back-end,
it's not easy to know who called these operations.
So move all these logic to frond-end side, it's more clear than before.
One important thing is that we should block tab before loading the content.
If we block the tab after loading, the media might not be blocked because it had
already started (that is one situation I observed from test).
The value of block state would be stored in the outer window, before media want
to start, it would check this value to know whether it can start playing or not.
---
In addition, introduce new attribute "media-blocked".
The "media-blocked" attribute indicates that whether the tab is allowed to play autoplay media.
The "activemedia-blocked" attribute indicates whether the tab has blocked the autoplay media.
MozReview-Commit-ID: FnNh3zmItxo
--HG--
extra : rebase_source : cdc890c0c47a4a03ea8dbbdfee24c66b52945c60
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
Since the window would know when need to resume the media, we don't need the
add/removeMediaContent() anymore.
MozReview-Commit-ID: F9MSiqqnOiV
--HG--
extra : rebase_source : fa86b3977e13d1f2a6b6233b6d608ccc331b5bf7
Since the window would know when need to resume the media, we don't need the
add/removeMediaContent() anymore.
MozReview-Commit-ID: F9MSiqqnOiV
--HG--
extra : rebase_source : 28a8312373054b8e29b93267677de99dd862a074
In order to asynchronously load content scripts that need to run very early in
the page load cycle, before any ordinary page scripts, we need to be able to
block parsing from the document-element-inserted listener. Since the script
loader operates by returning promises, blocking on promise resolution is the
simplest way to achieve this.
MozReview-Commit-ID: CTWlyrP6dqG
--HG--
extra : rebase_source : 28ce713a6450c223f9b2089e6c6e8c78284ef8af
The previous implementation regarding to the Flash Blocking Subdocument list blocked all subdocuments that matched the list. This patch changes that so that subdocuments are only blocked if they are on the Subdocument Block List and also are loaded in a Third-Party context.
The changes to cert8.db and key3.db add the https certificate for subdocument.example.com so that testing can verify that a scheme mismatch between the document and its parent results in a third-party classification.
MozReview-Commit-ID: IXnA4iPzB4y
--HG--
extra : rebase_source : 103c1e184d4219e6db9d00da1ea54674a0e216dd
In bug1319771, we found that the tab would become visible unexpectly in short
period in some situations. We don't want to resume the tab in this kind of
situation, so we check whether there is any alive media component in the tab
using IsServiceStarted(). However, since we have lots different ways to create
the service, this function is not accurate at all.
Therefore, we can add media element directly to the document when it binds to
tree so that we can really know whether there is any alive media component.
MozReview-Commit-ID: FvZFg91IqgE
--HG--
extra : rebase_source : 43c2460f6e9a39d44bf2ca1638c992a0e27b196c
Our use counter tests force reporting of use counters from documents to
make the tests more deterministic: relying on the default
report-at-document-destruction behavior would introduce any number of
intermittents. However, documents may have any number of external
resource documents, and we have no mechanism for forcing a deterministic
reporting of the use counters from those documents. Relying on those
external resources to have been destroyed (and thereby reported their
use counters) when we examine the values of the use counters in question
is a recipe for intermittent failures.
Therefore, we introduce an optional report kind for use counter
reporting: if a document is reporting its use counters for the purposes
of a test, we will also report the use counters for the document's
external resource documents. This change makes everything more
deterministic.
Our use counter tests force reporting of use counters from documents to
make the tests more deterministic: relying on the default
report-at-document-destruction behavior would introduce any number of
intermittents. However, documents may have any number of external
resource documents, and we have no mechanism for forcing a deterministic
reporting of the use counters from those documents. Relying on those
external resources to have been destroyed (and thereby reported their
use counters) when we examine the values of the use counters in question
is a recipe for intermittent failures.
Therefore, we introduce an optional report kind for use counter
reporting: if a document is reporting its use counters for the purposes
of a test, we will also report the use counters for the document's
external resource documents. This change makes everything more
deterministic.
There hasn't been any traction on this feature, and we keep
paying the maintenance and code size and memory usage penalty
of having this implementation.
We can revive this from VCS history in the future if we decide
to start working on it again. In the mean time, it's better
to remove it.
This is refcounted as we'll need to hold strong references to the ImageTracker
from style structs that load images.
MozReview-Commit-ID: 994gE9tOjAn
--HG--
extra : rebase_source : 2d50059e51b42251c89a92a954cef7b49720ceba