Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Oct 5, 2016
2 parents 70396e4 + f1a20ef commit 266fe0e
Show file tree
Hide file tree
Showing 105 changed files with 1,593 additions and 854 deletions.
1 change: 1 addition & 0 deletions accessible/base/EventTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ EventTree::Clear()

uint32_t eventsCount = mDependentEvents.Length();
for (uint32_t jdx = 0; jdx < eventsCount; jdx++) {
mDependentEvents[jdx]->mEventType = AccEvent::eDoNotEmit;
AccHideEvent* ev = downcast_accEvent(mDependentEvents[jdx]);
if (ev && ev->NeedsShutdown()) {
ev->Document()->ShutdownChildrenInSubtree(ev->mAccessible);
Expand Down
248 changes: 124 additions & 124 deletions accessible/ipc/other/PDocAccessible.ipdl

Large diffs are not rendered by default.

43 changes: 43 additions & 0 deletions accessible/tests/mochitest/events/test_coalescence.html
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,42 @@
};
}

/**
* Move a node by aria-owns from right to left in the tree, and then
* move its parent too by aria-owns. No hide event should be fired for
* original node.
*/
function test11()
{
this.eventSeq = [
new invokerChecker(EVENT_HIDE, getNode('t11_c1_child')),
new invokerChecker(EVENT_SHOW, 't11_c2_child'),
new invokerChecker(EVENT_HIDE, getNode('t11_c2')),
new invokerChecker(EVENT_SHOW, 't11_c2'),
new invokerChecker(EVENT_REORDER, 't11'),
new unexpectedInvokerChecker(EVENT_HIDE, 't11_c2_child'),
new unexpectedInvokerChecker(EVENT_REORDER, 't11_c1'),
new unexpectedInvokerChecker(EVENT_REORDER, 't11_c2'),
new unexpectedInvokerChecker(EVENT_REORDER, 't11_c3')
];

this.invoke = function test11_invoke()
{
// Remove a node from 't11_c1' container to give the event tree a
// desired structure (the 't11_c1' container node goes first in
// the event tree),
getNode('t11_c1_child').remove();
// then move 't11_c2_moved' from 't11_c2' to 't11_c1', and then move
// 't11_c2' to 't11_c3'.
getNode('t11_c1').setAttribute('aria-owns', 't11_c2_child');
getNode('t11_c3').setAttribute('aria-owns', 't11_c2');
};

this.getID = function test11_getID() {
return "Move a node by aria-owns to left within the tree";
};
}

////////////////////////////////////////////////////////////////////////////
// Do tests.

Expand Down Expand Up @@ -686,6 +722,7 @@
gQueue.push(new test8());
gQueue.push(new test9());
gQueue.push(new test10());
gQueue.push(new test11());

gQueue.invoke(); // Will call SimpleTest.finish();
}
Expand Down Expand Up @@ -815,5 +852,11 @@
<div id="t10_c3_moved"></div>
</div>
</div>

<div id="t11">
<div id="t11_c1"><div id="t11_c1_child"></div></div>
<div id="t11_c2"><div id="t11_c2_child"></div></div>
<div id="t11_c3"></div>
</div>
</body>
</html>
9 changes: 9 additions & 0 deletions build/autoconf/jemalloc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ if test "$MOZ_BUILD_APP" != js -o -n "$JS_STANDALONE"; then
for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
done
# jemalloc's configure assumes that if you have CFLAGS set at all, you set
# all the flags necessary to configure jemalloc, which is not likely to be
# the case on Windows if someone is building Firefox with flags set in
# their mozconfig.
if test "$_MSC_VER"; then
ac_configure_args="$ac_configure_args CFLAGS="
fi
# Force disable DSS support in jemalloc.
ac_configure_args="$ac_configure_args ac_cv_func_sbrk=false"
Expand Down
21 changes: 21 additions & 0 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -882,5 +882,26 @@ def libcxx_inline_visibility(c_compiler, target):
set_define('_LIBCPP_INLINE_VISIBILITY', libcxx_inline_visibility)
set_define('_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49', libcxx_inline_visibility)

@depends(c_compiler, target, check_build_environment)
def visibility_flags(c_compiler, target, env):
if target.os != 'WINNT':
if target.kernel == 'Darwin':
return ('-fvisibility=hidden', '-fvisibility-inlines-hidden')
return ('-I%s/system_wrappers' % os.path.join(env.dist),
'-include',
'%s/config/gcc_hidden.h' % env.topsrcdir)

@depends(target, visibility_flags)
def wrap_system_includes(target, visibility_flags):
if visibility_flags and target.kernel != 'Darwin':
return True

set_define('HAVE_VISIBILITY_HIDDEN_ATTRIBUTE',
depends(visibility_flags)(lambda v: bool(v) or None))
set_define('HAVE_VISIBILITY_ATTRIBUTE',
depends(visibility_flags)(lambda v: bool(v) or None))
set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
set_config('VISIBILITY_FLAGS', visibility_flags)

include('windows.configure')
include('rust.configure')
21 changes: 18 additions & 3 deletions dom/animation/KeyframeEffectReadOnly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
runningOnCompositorProperties.HasProperty(property.mProperty);
}

CalculateCumulativeChangeHint(aStyleContext);
// FIXME (bug 1303235): Do this for Servo too
if (aStyleContext->PresContext()->StyleSet()->IsGecko()) {
CalculateCumulativeChangeHint(aStyleContext);
}

MarkCascadeNeedsUpdate();

Expand Down Expand Up @@ -859,8 +862,13 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
: propertyValue.mProperty;

nsAutoString stringValue;
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
if (propertyValue.mServoDeclarationBlock) {
Servo_DeclarationBlock_SerializeOneValue(
propertyValue.mServoDeclarationBlock, &stringValue);
} else {
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
}

JS::Rooted<JS::Value> value(aCx);
if (!ToJSValue(aCx, stringValue, &value) ||
Expand Down Expand Up @@ -1270,6 +1278,13 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
return false;
}

// FIXME (bug 1303235): We don't calculate mCumulativeChangeHint for
// the Servo backend yet
nsPresContext* presContext = GetPresContext();
if (!presContext || presContext->StyleSet()->IsServo()) {
return false;
}

// FIXME: For further sophisticated optimization we need to check
// change hint on the segment corresponding to computedTiming.progress.
return NS_IsHintSubset(
Expand Down
15 changes: 13 additions & 2 deletions dom/animation/KeyframeEffectReadOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "mozilla/EffectCompositor.h"
#include "mozilla/KeyframeEffectParams.h"
#include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords
#include "mozilla/ServoBindingHelpers.h" // ServoDeclarationBlock and
// associated RefPtrTraits
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/dom/AnimationEffectReadOnly.h"
#include "mozilla/dom/Element.h"
Expand Down Expand Up @@ -60,11 +62,20 @@ struct PropertyValuePair
// The specified value for the property. For shorthand properties or invalid
// property values, we store the specified property value as a token stream
// (string).
nsCSSValue mValue;
nsCSSValue mValue;

// The specified value when using the Servo backend. However, even when
// using the Servo backend, we still fill in |mValue| in the case where we
// fail to parse the value since we use it to store the original string.
RefPtr<ServoDeclarationBlock> mServoDeclarationBlock;

bool operator==(const PropertyValuePair& aOther) const {
return mProperty == aOther.mProperty &&
mValue == aOther.mValue;
mValue == aOther.mValue &&
!mServoDeclarationBlock == !aOther.mServoDeclarationBlock &&
(!mServoDeclarationBlock ||
Servo_DeclarationBlock_Equals(mServoDeclarationBlock,
aOther.mServoDeclarationBlock));
}
};

Expand Down
114 changes: 91 additions & 23 deletions dom/animation/KeyframeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,12 @@ class ComputedOffsetComparator
// ------------------------------------------------------------------

inline bool
IsInvalidValuePair(const PropertyValuePair& aPair)
IsInvalidValuePair(const PropertyValuePair& aPair, StyleBackendType aBackend)
{
if (aBackend == StyleBackendType::Servo) {
return !aPair.mServoDeclarationBlock;
}

// There are three types of values we store as token streams:
//
// * Shorthand values (where we manually extract the token stream's string
Expand Down Expand Up @@ -589,6 +593,8 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
MOZ_ASSERT(aStyleContext);
MOZ_ASSERT(aElement);

StyleBackendType styleBackend = aElement->OwnerDoc()->GetStyleBackendType();

const size_t len = aKeyframes.Length();
nsTArray<ComputedKeyframeValues> result(len);

Expand All @@ -597,33 +603,46 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
ComputedKeyframeValues* computedValues = result.AppendElement();
for (const PropertyValuePair& pair :
PropertyPriorityIterator(frame.mPropertyValues)) {
if (IsInvalidValuePair(pair)) {
MOZ_ASSERT(!pair.mServoDeclarationBlock ||
styleBackend == StyleBackendType::Servo,
"Animation values were parsed using Servo backend but target"
" element is not using Servo backend?");

if (IsInvalidValuePair(pair, styleBackend)) {
continue;
}

// Expand each value into the set of longhands and produce
// a KeyframeValueEntry for each value.
nsTArray<PropertyStyleAnimationValuePair> values;

// For shorthands, we store the string as a token stream so we need to
// extract that first.
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
if (styleBackend == StyleBackendType::Servo) {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
IsComputeValuesFailureKey(pair)) {
CSSEnabledState::eForAllContent, aStyleContext,
*pair.mServoDeclarationBlock, values)) {
continue;
}
} else {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
pair.mValue, /* aUseSVGMode */ false, values)) {
continue;
// For shorthands, we store the string as a token stream so we need to
// extract that first.
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
IsComputeValuesFailureKey(pair)) {
continue;
}
} else {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
pair.mValue, /* aUseSVGMode */ false, values)) {
continue;
}
MOZ_ASSERT(values.Length() == 1,
"Longhand properties should produce a single"
" StyleAnimationValue");
}
MOZ_ASSERT(values.Length() == 1,
"Longhand properties should produce a single"
" StyleAnimationValue");
}

for (auto& value : values) {
Expand Down Expand Up @@ -969,6 +988,36 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
nsCSSParser& aParser, nsIDocument* aDocument)
{
MOZ_ASSERT(aDocument);
PropertyValuePair result;

result.mProperty = aProperty;

if (aDocument->GetStyleBackendType() == StyleBackendType::Servo) {
nsCString name = nsCSSProps::GetStringValue(aProperty);

NS_ConvertUTF16toUTF8 value(aStringValue);
RefPtr<ThreadSafeURIHolder> base =
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
RefPtr<ThreadSafeURIHolder> referrer =
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
RefPtr<ThreadSafePrincipalHolder> principal =
new ThreadSafePrincipalHolder(aDocument->NodePrincipal());

nsCString baseString;
aDocument->GetDocumentURI()->GetSpec(baseString);

RefPtr<ServoDeclarationBlock> servoDeclarationBlock =
Servo_ParseProperty(
reinterpret_cast<const uint8_t*>(name.get()), name.Length(),
reinterpret_cast<const uint8_t*>(value.get()), value.Length(),
reinterpret_cast<const uint8_t*>(baseString.get()), baseString.Length(),
base, referrer, principal).Consume();

if (servoDeclarationBlock) {
result.mServoDeclarationBlock = servoDeclarationBlock.forget();
return result;
}
}

nsCSSValue value;
if (!nsCSSProps::IsShorthand(aProperty)) {
Expand Down Expand Up @@ -1001,9 +1050,18 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
"The shorthand property of a token stream should be initialized"
" to unknown");
value.SetTokenStreamValue(tokenStream);
} else {
// If we succeeded in parsing with Gecko, but not Servo the animation is
// not going to work since, for the purposes of animation, we're going to
// ignore |mValue| when the backend is Servo.
NS_WARNING_ASSERTION(aDocument->GetStyleBackendType() !=
StyleBackendType::Servo,
"Gecko succeeded in parsing where Servo failed");
}

return { aProperty, value };
result.mValue = value;

return result;
}

/**
Expand Down Expand Up @@ -1344,6 +1402,8 @@ RequiresAdditiveAnimation(const nsTArray<Keyframe>& aKeyframes,
}
};

StyleBackendType styleBackend = aDocument->GetStyleBackendType();

for (size_t i = 0, len = aKeyframes.Length(); i < len; i++) {
const Keyframe& frame = aKeyframes[i];

Expand All @@ -1359,17 +1419,25 @@ RequiresAdditiveAnimation(const nsTArray<Keyframe>& aKeyframes,
: computedOffset;

for (const PropertyValuePair& pair : frame.mPropertyValues) {
if (IsInvalidValuePair(pair)) {
if (IsInvalidValuePair(pair, styleBackend)) {
continue;
}

if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
nsCSSParser parser(aDocument->CSSLoader());
if (!parser.IsValueValidForProperty(pair.mProperty,
tokenStream->mTokenStream)) {
continue;
if (styleBackend == StyleBackendType::Gecko) {
nsCSSValueTokenStream* tokenStream =
pair.mValue.GetTokenStreamValue();
nsCSSParser parser(aDocument->CSSLoader());
if (!parser.IsValueValidForProperty(pair.mProperty,
tokenStream->mTokenStream)) {
continue;
}
}
// For the Servo backend, invalid shorthand values are represented by
// a null mServoDeclarationBlock member which we skip above in
// IsInvalidValuePair.
MOZ_ASSERT(styleBackend != StyleBackendType::Servo ||
pair.mServoDeclarationBlock);
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
prop, pair.mProperty, CSSEnabledState::eForAllContent) {
addToPropertySets(*prop, offsetToUse);
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsAttrAndChildArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ nsAttrAndChildArray::RemoveAttrAt(uint32_t aPos, nsAttrValue& aValue)
return MakeMappedUnique(mapped);
}

BorrowedAttrInfo
mozilla::dom::BorrowedAttrInfo
nsAttrAndChildArray::AttrInfoAt(uint32_t aPos) const
{
NS_ASSERTION(aPos < AttrCount(),
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsDOMMutationObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
return;
}

AutoSlowOperation aso;
mozilla::AutoSlowOperation aso;

nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;

Expand Down
Loading

0 comments on commit 266fe0e

Please sign in to comment.