зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland. a=merge
--HG-- extra : rebase_source : 8ee1e412347621306f50b7d0dd1d8121ddcd498e
This commit is contained in:
Коммит
860ad350dd
|
@ -424,7 +424,7 @@ browsing-cfr-recommendations =
|
|||
.label = Recommend extensions as you browse
|
||||
.accesskey = R
|
||||
|
||||
browsing-cfr-recommendations-learn-more = Learn More
|
||||
browsing-cfr-recommendations-learn-more = Learn more
|
||||
|
||||
## General Section - Proxy
|
||||
|
||||
|
@ -432,7 +432,7 @@ network-settings-title = Network Settings
|
|||
|
||||
network-proxy-connection-description = Configure how { -brand-short-name } connects to the internet.
|
||||
|
||||
network-proxy-connection-learn-more = Learn More
|
||||
network-proxy-connection-learn-more = Learn more
|
||||
|
||||
network-proxy-connection-settings =
|
||||
.label = Settings…
|
||||
|
|
|
@ -3134,6 +3134,24 @@ nsDOMTokenList* Element::GetTokenList(
|
|||
return list;
|
||||
}
|
||||
|
||||
nsresult Element::CopyInnerTo(Element* aDst) {
|
||||
nsresult rv = aDst->mAttrs.EnsureCapacityToClone(mAttrs);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
uint32_t i, count = mAttrs.AttrCount();
|
||||
for (i = 0; i < count; ++i) {
|
||||
const nsAttrName* name = mAttrs.AttrNameAt(i);
|
||||
const nsAttrValue* value = mAttrs.AttrAt(i);
|
||||
nsAutoString valStr;
|
||||
value->ToString(valStr);
|
||||
rv = aDst->SetAttr(name->NamespaceID(), name->LocalName(),
|
||||
name->GetPrefix(), valStr, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Element* Element::Closest(const nsAString& aSelector, ErrorResult& aResult) {
|
||||
const RawServoSelectorList* list = ParseSelectorList(aSelector, aResult);
|
||||
if (!list) {
|
||||
|
@ -3919,6 +3937,7 @@ MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoElementMallocEnclosingSizeOf)
|
|||
void Element::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
|
||||
size_t* aNodeSize) const {
|
||||
FragmentOrElement::AddSizeOfExcludingThis(aSizes, aNodeSize);
|
||||
*aNodeSize += mAttrs.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
|
||||
|
||||
if (HasServoData()) {
|
||||
// Measure the ElementData object itself.
|
||||
|
|
|
@ -879,6 +879,13 @@ class Element : public FragmentOrElement {
|
|||
return mAttrs.GetSafeAttrNameAt(aIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as above, but does not do out-of-bounds checks!
|
||||
*/
|
||||
const nsAttrName* GetUnsafeAttrNameAt(uint32_t aIndex) const {
|
||||
return mAttrs.AttrNameAt(aIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the attribute info (name and value) for this element at a given index.
|
||||
*/
|
||||
|
@ -1851,6 +1858,12 @@ class Element : public FragmentOrElement {
|
|||
nsAtom* aAtom,
|
||||
const DOMTokenListSupportedTokenArray aSupportedTokens = nullptr);
|
||||
|
||||
/**
|
||||
* Copy attributes and state to another element
|
||||
* @param aDest the object to copy to
|
||||
*/
|
||||
nsresult CopyInnerTo(Element* aDest);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Slow path for GetClasses, this should only be called for SVG elements.
|
||||
|
@ -1883,6 +1896,10 @@ class Element : public FragmentOrElement {
|
|||
// There should not be data on nodes that are in the flattened tree, or
|
||||
// descendants of display: none elements.
|
||||
mozilla::RustCell<ServoNodeData*> mServoData;
|
||||
|
||||
protected:
|
||||
// Array containing all attributes for this element
|
||||
AttrArray mAttrs;
|
||||
};
|
||||
|
||||
class RemoveFromBindingManagerRunnable : public mozilla::Runnable {
|
||||
|
|
|
@ -1908,11 +1908,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
|
|||
}
|
||||
|
||||
// Traverse attribute names.
|
||||
{
|
||||
if (tmp->IsElement()) {
|
||||
Element* element = tmp->AsElement();
|
||||
uint32_t i;
|
||||
uint32_t attrs = tmp->mAttrs.AttrCount();
|
||||
uint32_t attrs = element->GetAttrCount();
|
||||
for (i = 0; i < attrs; i++) {
|
||||
const nsAttrName* name = tmp->mAttrs.AttrNameAt(i);
|
||||
const nsAttrName* name = element->GetUnsafeAttrNameAt(i);
|
||||
if (!name->IsAtom()) {
|
||||
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mAttrs[i]->NodeInfo()");
|
||||
cb.NoteNativeChild(name->NodeInfo(),
|
||||
|
@ -1928,24 +1929,6 @@ NS_INTERFACE_MAP_END_INHERITING(nsIContent)
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult FragmentOrElement::CopyInnerTo(FragmentOrElement* aDst) {
|
||||
nsresult rv = aDst->mAttrs.EnsureCapacityToClone(mAttrs);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
uint32_t i, count = mAttrs.AttrCount();
|
||||
for (i = 0; i < count; ++i) {
|
||||
const nsAttrName* name = mAttrs.AttrNameAt(i);
|
||||
const nsAttrValue* value = mAttrs.AttrAt(i);
|
||||
nsAutoString valStr;
|
||||
value->ToString(valStr);
|
||||
rv = aDst->AsElement()->SetAttr(name->NamespaceID(), name->LocalName(),
|
||||
name->GetPrefix(), valStr, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsTextFragment* FragmentOrElement::GetText() { return nullptr; }
|
||||
|
||||
uint32_t FragmentOrElement::TextLength() const {
|
||||
|
@ -2167,7 +2150,6 @@ void FragmentOrElement::FireNodeRemovedForChildren() {
|
|||
void FragmentOrElement::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
|
||||
size_t* aNodeSize) const {
|
||||
nsIContent::AddSizeOfExcludingThis(aSizes, aNodeSize);
|
||||
*aNodeSize += mAttrs.SizeOfExcludingThis(aSizes.mState.mMallocSizeOf);
|
||||
|
||||
nsDOMSlots* slots = GetExistingDOMSlots();
|
||||
if (slots) {
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "AttrArray.h" // member
|
||||
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
|
||||
#include "nsIContent.h" // base class
|
||||
#include "nsNodeUtils.h" // class member nsNodeUtils::CloneNodeImpl
|
||||
|
@ -144,10 +143,10 @@ class FragmentOrElement : public nsIContent {
|
|||
virtual ~FragmentOrElement();
|
||||
|
||||
/**
|
||||
* Copy attributes and state to another element
|
||||
* @param aDest the object to copy to
|
||||
* Dummy CopyInnerTo so that we can use the same macros for
|
||||
* Elements and DocumentFragments.
|
||||
*/
|
||||
nsresult CopyInnerTo(FragmentOrElement* aDest);
|
||||
nsresult CopyInnerTo(FragmentOrElement* aDest) { return NS_OK; }
|
||||
|
||||
public:
|
||||
/**
|
||||
|
@ -305,10 +304,6 @@ class FragmentOrElement : public nsIContent {
|
|||
}
|
||||
|
||||
friend class ::ContentUnbinder;
|
||||
/**
|
||||
* Array containing all attributes for this element
|
||||
*/
|
||||
AttrArray mAttrs;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[DEFAULT]
|
||||
[browser_test_toplevel_data_navigations.js]
|
||||
skip-if = (verify && debug && (os == 'mac'))
|
||||
skip-if = (verify && debug && (os == 'mac')) || (debug && (os == 'mac' || os == 'linux')) # Bug 1403815
|
||||
support-files =
|
||||
file_toplevel_data_navigations.sjs
|
||||
file_toplevel_data_meta_redirect.html
|
||||
|
|
|
@ -68,18 +68,6 @@ enum class TraceKind {
|
|||
};
|
||||
const static uintptr_t OutOfLineTraceKindMask = 0x07;
|
||||
|
||||
// Returns true if the JS::TraceKind is one the cycle collector cares about.
|
||||
// Everything used as WeakMap key should be listed here, to represent the key
|
||||
// in cycle collector's graph, otherwise the key is considered to be pointed
|
||||
// from somewhere unknown, and results in leaking the subgraph which contains
|
||||
// the key.
|
||||
// See the comments in NoteWeakMapsTracer::trace for more details.
|
||||
inline constexpr bool IsCCTraceKind(JS::TraceKind aKind) {
|
||||
return aKind == JS::TraceKind::Object || aKind == JS::TraceKind::Script ||
|
||||
aKind == JS::TraceKind::LazyScript || aKind == JS::TraceKind::Scope ||
|
||||
aKind == JS::TraceKind::RegExpShared;
|
||||
}
|
||||
|
||||
#define ASSERT_TRACE_KIND(tk) \
|
||||
static_assert( \
|
||||
(uintptr_t(tk) & OutOfLineTraceKindMask) == OutOfLineTraceKindMask, \
|
||||
|
@ -116,6 +104,25 @@ struct MapTypeToTraceKind {
|
|||
IF_BIGINT(D(BigInt, JS::BigInt, false), ) \
|
||||
D(RegExpShared, js::RegExpShared, true)
|
||||
|
||||
// Returns true if the JS::TraceKind is one the cycle collector cares about.
|
||||
// Everything used as WeakMap key should be listed here, to represent the key
|
||||
// in cycle collector's graph, otherwise the key is considered to be pointed
|
||||
// from somewhere unknown, and results in leaking the subgraph which contains
|
||||
// the key.
|
||||
// See the comments in NoteWeakMapsTracer::trace for more details.
|
||||
inline constexpr bool IsCCTraceKind(JS::TraceKind aKind)
|
||||
{
|
||||
switch (aKind) {
|
||||
#define JS_EXPAND_DEF(name, _, isCCTraceKind) \
|
||||
case JS::TraceKind::name: \
|
||||
return isCCTraceKind;
|
||||
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
|
||||
#undef JS_EXPAND_DEF
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Map from all public types to their trace kind.
|
||||
#define JS_EXPAND_DEF(name, type, _) \
|
||||
template <> \
|
||||
|
@ -125,6 +132,11 @@ struct MapTypeToTraceKind {
|
|||
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
|
||||
#undef JS_EXPAND_DEF
|
||||
|
||||
template <typename T>
|
||||
struct TypeParticipatesInCC {
|
||||
static const bool value = IsCCTraceKind(MapTypeToTraceKind<T>::kind);
|
||||
};
|
||||
|
||||
// RootKind is closely related to TraceKind. Whereas TraceKind's indices are
|
||||
// laid out for convenient embedding as a pointer tag, the indicies of RootKind
|
||||
// are designed for use as array keys via EnumeratedArray.
|
||||
|
|
|
@ -914,20 +914,10 @@ void js::GCMarker::traverseEdge(S source, const T& thing) {
|
|||
|
||||
namespace {
|
||||
|
||||
template <typename T>
|
||||
struct TypeParticipatesInCC {};
|
||||
#define EXPAND_PARTICIPATES_IN_CC(_, type, addToCCKind) \
|
||||
template <> \
|
||||
struct TypeParticipatesInCC<type> { \
|
||||
static const bool value = addToCCKind; \
|
||||
};
|
||||
JS_FOR_EACH_TRACEKIND(EXPAND_PARTICIPATES_IN_CC)
|
||||
#undef EXPAND_PARTICIPATES_IN_CC
|
||||
|
||||
struct ParticipatesInCCFunctor {
|
||||
template <typename T>
|
||||
bool operator()() {
|
||||
return TypeParticipatesInCC<T>::value;
|
||||
return JS::TypeParticipatesInCC<T>::value;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -945,7 +935,7 @@ bool js::GCMarker::mark(T* thing) {
|
|||
AssertShouldMarkInZone(thing);
|
||||
TenuredCell* cell = TenuredCell::fromPointer(thing);
|
||||
|
||||
if (!TypeParticipatesInCC<T>::value) {
|
||||
if (!JS::TypeParticipatesInCC<T>::value) {
|
||||
return cell->markIfUnmarked(MarkColor::Black);
|
||||
}
|
||||
|
||||
|
|
|
@ -581,7 +581,7 @@ impl<'le> GeckoElement<'le> {
|
|||
#[inline(always)]
|
||||
fn attrs(&self) -> &[structs::AttrArray_InternalAttr] {
|
||||
unsafe {
|
||||
let attrs = match self.0._base.mAttrs.mImpl.mPtr.as_ref() {
|
||||
let attrs = match self.0.mAttrs.mImpl.mPtr.as_ref() {
|
||||
Some(attrs) => attrs,
|
||||
None => return &[],
|
||||
};
|
||||
|
|
|
@ -7,5 +7,5 @@ support-files =
|
|||
browser_compartments_script.js
|
||||
|
||||
[browser_compartments.js]
|
||||
skip-if = os == "linux" && !debug && e10s # Bug 1230018
|
||||
skip-if = (os == "linux" && !debug && e10s) || (os == "win" && os_version == "10.0") # Bug 1230018, Bug 1409631
|
||||
[browser_webpagePerformanceAlerts.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче