import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1227766 patch 1 - Add flag for CSS properties that establish a containing block for fixed positioned elements. r=dholbert (9d4586e5ed)
- Bug 1227766 patch 2 - Add will-change bit for establishing a containing block for fixed positioned elements. r=dholbert (8a0908bf11)
- Bug 1228877 - Make nsStyleContext::HasChildThatUsesGrandancestorStyle by setting bit on grandchild's parent instead of grandchild. r=xidorn (16ab14cfa5)
- Bug 1230701 - Make will-change:position create a containing block for absolutely-positioned elements. r=dholbert (4f2f1ea91b)
- Bug 1225592 - [css-grid] Apply a max limit to the number of explicit tracks we will store (kMaxLine - 1). Also make the layout code more robust so it doesn't depend on that. r=dholbert (f4f3ce01e8)
- Bug 1227501 patch 2 - Crashtest. (6e711f37b5)
- Bug 1227501 patch 3 - Handle custom properties correctly in transition-property. r=xidorn (6ec6716f0d)
- Bug 1223688 - Clear mInSupportsConditions when we error out of CSS.supports() upon finding no tokens. r=dholbert (06cefdeb40)
- Bug 1223694 - Don't bother checking for correct style scopes for native anonymous content. r=dbaron (294dcb49a9)
- Bug 1226400 - crashtest for FontFaceSet::Load() crasher. r=birtles (8d0dba0db7)
- No bug - Remove annotations from the editor and layout crashtest manifests that are no longer needed. (68776b5f65)
- Bug 1225682 - Don't use nsAuto{,C}String as class member variables in netwerk/. r=mcmanus (d4be926153)
- Bug 1209970 - Fire scroll events early in the refresh tick. r=mats (420513e667)
- Bug 1234242 - Keep a RefPtr to the refresh driver to unregister the ScrollEvent, rather than relying on a chain of pointers remaining non-null. r=mstange a=KWierso (df8b4383d2)
- Bug 1228407 - Avoid a scenario where content floods APZ with smooth-scroll requests and blocks it from syncing a new scroll offset back to the main thread. r=botond (9882828dcc)
- Bug 1232048 - Fix breakage in scroll snapping when snapping twice in …a row to the same thing with non-smooth-scrolls in between. r=botond (6688500624)
This commit is contained in:
2023-06-30 13:30:55 +08:00
parent c4388cb7dc
commit 770c1e709f
30 changed files with 332 additions and 154 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ load 448329-3.html
load 456727-1.html
load 456727-2.html
load 459613.html
needs-focus asserts(0-1) load 467647-1.html # bug 414178
needs-focus load 467647-1.html
load 475132-1.xhtml
load 499844-1.html
load 503709-1.xhtml
@@ -39,7 +39,7 @@ load 643786-1.html
load 682650-1.html
load 713427-1.html
load 713427-2.xhtml
asserts(0-1) load 716456-1.html
load 716456-1.html
load 759748.html
load 761861.html
load 762183.html
+7 -7
View File
@@ -7,7 +7,7 @@ load 56746-1.html
load 89101-1.html
load 89358-1.html
load 90205-1.html
skip-if((OSX==1007||OSX==1008)&&browserIsRemote) load 99776-1.html # Bug 849747
skip-if(cocoaWidget&&browserIsRemote) load 99776-1.html # Bug 849747
load 118931-1.html
load 121533-1.html
load 123049-1.html
@@ -21,7 +21,7 @@ load 143862-2.html
load 147320-1.html
load 148245-1.html
load 149014-1.html
skip load 150431-1.html # slow test
load 150431-1.html
load 176915-1.html
load 191272-1.html
load 199696-1.html
@@ -153,7 +153,7 @@ load 374297-2.html
load 376223-1.xhtml
asserts(0-99) load 378325-1.html # bug 531589
load 378682.html
asserts(0-3) load 379105-1.xhtml # bug 570215, bug 479160
load 379105-1.xhtml
load 379419-1.xhtml
load 379768-1.html
load 379799-1.html
@@ -364,7 +364,7 @@ load 576649-1.html
load 579655.html
load 580494-1.html
load 580834-1.xhtml
asserts(0-13) load 589787.html # bug 574889
load 589787.html
load 595039-1.html
load 597924-1.html
load 606432-1.html
@@ -420,12 +420,12 @@ load 772306.html
load 788360.html
load 793848.html
load 795646.html
skip-if(1) load 802902.html # bug 901752
skip load 802902.html # bug 901752
load 806056-1.html
load 806056-2.html
load 812665.html
load 813372-1.html
asserts(0-4) load 817219.html # bug 623436
load 817219.html
load 818454.html
asserts-if(gtkWidget,0-1) load 822865.html # bug 540078
load 824862.html
@@ -445,7 +445,7 @@ load 876221.html
load 897852.html
asserts-if(Android,2) asserts-if(!Android,4-6) load 898913.html # bug 847368
pref(layers.acceleration.disabled,true) pref(layers.force-active,true) load 919434.html
pref(layout.css.sticky.enabled,true) load 926728.html
load 926728.html
load 930381.html
load 931450.html
load 931460-1.html
+11 -16
View File
@@ -346,7 +346,7 @@ load 478170-1.html
load 478185-1.html
asserts-if(!Android,0-1) load 479938-1.html # Bug 575011
load 480345-1.html
skip-if(Android) load 481921.html
load 481921.html
load 489462-1.html
load 489477.html
load 489480-1.xhtml
@@ -363,7 +363,7 @@ load 496742.html
load 499138.html
load 499862-1.html
load 499857-1.html
asserts-if(winWidget,0-3) load 499885-1.xhtml
asserts-if(winWidget&&!(/^Windows\x20NT\x205\.1/.test(http.oscpu)),3) load 499885-1.xhtml # Bug 1220265
load 501535-1.html
load 503961-1.xhtml
load 503961-2.html
@@ -423,7 +423,7 @@ load 586973-1.html
load 589002-1.html
load 590404.html
load 591141.html
asserts(0-1) load 592118.html
load 592118.html
load 594808-1.html
load 595435-1.xhtml
load 595740-1.html
@@ -456,7 +456,7 @@ load text-overflow-form-elements.html
load text-overflow-iframe.html
load text-overflow-bug666751-1.html
load text-overflow-bug666751-2.html
asserts(0-1) load text-overflow-bug670564.xhtml
load text-overflow-bug670564.xhtml
load text-overflow-bug671796.xhtml
load 667025.html
load 673770.html # bug 569193 and bug 459597
@@ -472,8 +472,8 @@ load 700031.xhtml
load 718516.html
load 723108.html
load 724235.html
skip-if(OSX=1010&&isDebugBuild) load 724978.xhtml
skip-if(OSX=1010&&isDebugBuild) load 730559.html
load 724978.xhtml
load 730559.html
load first-letter-638937.html
load first-letter-638937-2.html
load 734777.html
@@ -493,7 +493,7 @@ load 769303-2.html
load 769120.html
load 777838.html
load 783228.html
skip-if(Android) load 784600.html
load 784600.html
load 785555.html
load 786740-1.html
asserts(0-4) test-pref(font.size.inflation.emPerLine,15) load 791601.xhtml # 3 counts of bug 871327, 1 bug 367185
@@ -545,15 +545,15 @@ asserts-if(Android,0-4) asserts-if(!Android,1-4) load 876074-1.html # bug 876749
load 885009-1.html
load 893496-1.html
load 893523.html
asserts(0-3) load 898871.html # bug 479160
test-pref(layout.css.sticky.enabled,true) load 914891.html
test-pref(layout.css.sticky.enabled,true) load 915475.xhtml
asserts-if(cocoaWidget,0-3) load 898871.html # bug 479160
load 914891.html
load 915475.xhtml
load 927558.html
load 943509-1.html
asserts(3-8) load 944909-1.html
load 946167-1.html
load 947158.html
test-pref(layout.css.sticky.enabled,true) load 949932.html
load 949932.html
load 970710.html
load 973701-1.xhtml
load 973701-2.xhtml
@@ -583,11 +583,6 @@ load 1134531.html
load 1134667.html
load 1137723-1.html
load 1137723-2.html
# The tests for bug 1137723 above causes delayed assertions too,
# the next 3 lines can be removed once that is fixed.
asserts(0-3) load 1134667.html
asserts(0-3) load 1134667.html
asserts(0-3) load 1134667.html
load 1146103.html
load 1146107.html
load 1146114.html
+47 -11
View File
@@ -2092,6 +2092,12 @@ ScrollFrameHelper::ScrollToWithOrigin(nsPoint aScrollPosition,
nsRect range = aRange ? *aRange : nsRect(aScrollPosition, nsSize(0, 0));
if (aMode != nsIScrollableFrame::SMOOTH_MSD) {
// If we get a non-smooth-scroll, reset the cached APZ scroll destination,
// so that we know to process the next smooth-scroll destined for APZ.
mApzSmoothScrollDestination = Nothing();
}
if (aMode == nsIScrollableFrame::INSTANT) {
// Asynchronous scrolling is not allowed, so we'll kill any existing
// async-scrolling process and do an instant scroll.
@@ -2121,10 +2127,31 @@ ScrollFrameHelper::ScrollToWithOrigin(nsPoint aScrollPosition,
}
if (nsLayoutUtils::AsyncPanZoomEnabled(mOuter)) {
if (mApzSmoothScrollDestination == Some(mDestination) &&
mScrollGeneration == sScrollGenerationCounter) {
// If we already sent APZ a smooth-scroll request to this
// destination with this generation (i.e. it was the last request
// we sent), then don't send another one because it is redundant.
// This is to avoid a scenario where pages do repeated scrollBy
// calls, incrementing the generation counter, and blocking APZ from
// syncing the scroll offset back to the main thread.
// Note that if we get two smooth-scroll requests to the same
// destination with some other scroll in between,
// mApzSmoothScrollDestination will get reset to Nothing() and so
// we shouldn't have the problem where this check discards a
// legitimate smooth-scroll.
// Note: if there are two separate scrollframes both getting smooth
// scrolled at the same time, sScrollGenerationCounter can get
// incremented and this early-exit won't get taken. Bug 1231177 is
// on file for this.
return;
}
// The animation will be handled in the compositor, pass the
// information needed to start the animation and skip the main-thread
// animation for this scroll.
mLastSmoothScrollOrigin = aOrigin;
mApzSmoothScrollDestination = Some(mDestination);
mScrollGeneration = ++sScrollGenerationCounter;
if (!nsLayoutUtils::GetDisplayPort(mOuter->GetContent())) {
@@ -4187,18 +4214,30 @@ void ScrollFrameHelper::CurPosAttributeChanged(nsIContent* aContent)
/* ============= Scroll events ========== */
NS_IMETHODIMP
ScrollFrameHelper::ScrollEvent::Run()
ScrollFrameHelper::ScrollEvent::ScrollEvent(ScrollFrameHelper* aHelper)
: mHelper(aHelper)
{
if (mHelper)
mHelper->FireScrollEvent();
return NS_OK;
mDriver = mHelper->mOuter->PresContext()->RefreshDriver();
mDriver->AddRefreshObserver(this, Flush_Style);
}
ScrollFrameHelper::ScrollEvent::~ScrollEvent()
{
mDriver->RemoveRefreshObserver(this, Flush_Style);
mDriver = nullptr;
}
void
ScrollFrameHelper::ScrollEvent::WillRefresh(mozilla::TimeStamp aTime)
{
mHelper->FireScrollEvent();
}
void
ScrollFrameHelper::FireScrollEvent()
{
mScrollEvent.Forget();
MOZ_ASSERT(mScrollEvent);
mScrollEvent = nullptr;
ActiveLayerTracker::SetCurrentScrollHandlerFrame(mOuter);
WidgetGUIEvent event(true, eScroll, nullptr);
@@ -4224,14 +4263,11 @@ ScrollFrameHelper::FireScrollEvent()
void
ScrollFrameHelper::PostScrollEvent()
{
if (mScrollEvent.IsPending())
if (mScrollEvent)
return;
nsRootPresContext* rpc = mOuter->PresContext()->GetRootPresContext();
if (!rpc)
return;
// The ScrollEvent constructor registers itself with the refresh driver.
mScrollEvent = new ScrollEvent(this);
rpc->AddWillPaintObserver(mScrollEvent.get());
}
NS_IMETHODIMP
+10 -5
View File
@@ -19,6 +19,7 @@
#include "nsIReflowCallback.h"
#include "nsBoxLayoutState.h"
#include "nsQueryFrame.h"
#include "nsRefreshDriver.h"
#include "nsExpirationTracker.h"
#include "TextOverflow.h"
#include "ScrollVelocityQueue.h"
@@ -101,13 +102,16 @@ public:
bool IsSmoothScrollingEnabled();
class ScrollEvent : public nsRunnable {
class ScrollEvent : public nsARefreshObserver {
public:
NS_DECL_NSIRUNNABLE
explicit ScrollEvent(ScrollFrameHelper *helper) : mHelper(helper) {}
void Revoke() { mHelper = nullptr; }
NS_INLINE_DECL_REFCOUNTING(ScrollEvent, override)
explicit ScrollEvent(ScrollFrameHelper *helper);
void WillRefresh(mozilla::TimeStamp aTime) override;
protected:
virtual ~ScrollEvent();
private:
ScrollFrameHelper *mHelper;
RefPtr<nsRefreshDriver> mDriver;
};
class AsyncScrollPortEvent : public nsRunnable {
@@ -417,7 +421,7 @@ public:
nsCOMPtr<nsIContent> mScrollCornerContent;
nsCOMPtr<nsIContent> mResizerContent;
nsRevocableEventPtr<ScrollEvent> mScrollEvent;
RefPtr<ScrollEvent> mScrollEvent;
nsRevocableEventPtr<AsyncScrollPortEvent> mAsyncScrollPortEvent;
nsRevocableEventPtr<ScrolledAreaEvent> mScrolledAreaEvent;
nsIFrame* mHScrollbarBox;
@@ -432,6 +436,7 @@ public:
nsTArray<nsIScrollPositionListener*> mListeners;
nsIAtom* mLastScrollOrigin;
nsIAtom* mLastSmoothScrollOrigin;
Maybe<nsPoint> mApzSmoothScrollDestination;
uint32_t mScrollGeneration;
nsRect mScrollPort;
// Where we're currently scrolling to, if we're scrolling asynchronously.
+13 -10
View File
@@ -1927,28 +1927,31 @@ nsGridContainerFrame::Tracks::Initialize(
explicitGridOffset + aFunctions.mMinSizingFunctions.Length());
MOZ_ASSERT(aFunctions.mMinSizingFunctions.Length() ==
aFunctions.mMaxSizingFunctions.Length());
// First we initialize the implicit tracks before the explicit grid starts.
uint32_t i = 0;
for (; i < explicitGridOffset; ++i) {
uint32_t sentinel = std::min<uint32_t>(explicitGridOffset, mSizes.Length());
for (; i < sentinel; ++i) {
mSizes[i].Initialize(percentageBasis,
aFunctions.mAutoMinSizing,
aFunctions.mAutoMaxSizing);
}
uint32_t j = 0;
for (uint32_t len = aFunctions.mMinSizingFunctions.Length(); j < len; ++j) {
mSizes[i + j].Initialize(percentageBasis,
aFunctions.mMinSizingFunctions[j],
aFunctions.mMaxSizingFunctions[j]);
// Now initialize the explicit grid tracks.
sentinel = std::min<uint32_t>(i + aFunctions.mMinSizingFunctions.Length(),
mSizes.Length());
for (uint32_t j = 0; i < sentinel; ++i, ++j) {
mSizes[i].Initialize(percentageBasis,
aFunctions.mMinSizingFunctions[j],
aFunctions.mMaxSizingFunctions[j]);
}
i += j;
for (; i < mSizes.Length(); ++i) {
// Finally, initialize the implicit tracks that comes after the explicit grid.
sentinel = mSizes.Length();
for (; i < sentinel; ++i) {
mSizes[i].Initialize(percentageBasis,
aFunctions.mAutoMinSizing,
aFunctions.mAutoMaxSizing);
}
mGridGap = aGridGap;
// XXX allow negative values? pending outcome of www-style thread:
// https://lists.w3.org/Archives/Public/www-style/2015Oct/0028.html
MOZ_ASSERT(mGridGap >= nscoord(0), "negative grid gap");
}
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function boom() {
CSS.supports('');
var style = document.createElement("style");
var tn = document.createTextNode("* { border: var(--b); }");
style.appendChild(tn);
document.body.appendChild(style);
}
</script>
</head>
<body onload="boom();"></body>
</html>
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function boom()
{
var sheet = document.createElement("style");
sheet.scoped = true;
document.documentElement.appendChild(sheet);
}
</script>
</head>
<body onload="boom();"></body>
</html>
+55
View File
@@ -0,0 +1,55 @@
<!DOCTYPE HTML>
<html>
<head>
<title>FontFaceSet::Load crasher</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
margin: 50px;
}
p {
margin: 0;
font-size: 300%;
}
</style>
</head>
<body>
<p>This may crash on load...</p>
<script>
var scriptText = `
var fontFaceSet = document.fonts;
var link = document.createElement("link");
link.onerror = link.onload = function() {
fontFaceSet.load("12px foo");
}
link.rel = "stylesheet";
link.href = "data:text/css,";
document.body.appendChild(link);
`;
var styleText = `
@font-face {
font-family: foo;
src: url("data:text/ttf,");
}
`;
var ifr = document.createElement("iframe");
document.body.appendChild(ifr);
var style = ifr.contentDocument.createElement("style");
style.textContent = styleText;
ifr.contentDocument.body.appendChild(style);
var script = ifr.contentDocument.createElement("script");
script.textContent = scriptText;
ifr.contentDocument.body.appendChild(script);
ifr.remove();
</script>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<style>
* { will-change: --t; }
</style>
</head>
</html>
+6 -2
View File
@@ -26,7 +26,7 @@ load 431705-1.xul
load 432561-1.html
load 437170-1.html
load 437532-1.html
skip load 439184-1.html # skip until we figure out how to test this
load 439184-1.html
load 444237-1.html
load 444848-1.html
load 447776-1.html
@@ -102,7 +102,7 @@ load 927734-1.html
load 930270-1.html
load 930270-2.html
load 945048-1.html
pref(layers.offmainthreadcomposition.async-animations,true) load 972199-1.html
load 972199-1.html
load 989965-1.html
load 992333-1.html
pref(dom.webcomponents.enabled,true) load 1017798-1.html
@@ -122,6 +122,10 @@ load 1167782-1.html
load 1186768-1.xhtml
load 1200568-1.html
load 1206105-1.html
load 1223688-1.html
load 1223694-1.html
load 1226400-1.html
load 1227501-1.html
load border-image-visited-link.html
load font-face-truncated-src.html
load large_border_image_width.html
+26 -4
View File
@@ -442,6 +442,31 @@ protected:
bool mOriginalValue;
};
/**
* RAII class to set aParser->mInSupportsCondition to true and restore it
* to false later.
*/
class MOZ_RAII nsAutoInSupportsCondition
{
public:
explicit nsAutoInSupportsCondition(CSSParserImpl* aParser)
: mParser(aParser)
{
MOZ_ASSERT(!aParser->mInSupportsCondition,
"nsAutoInSupportsCondition is not designed to be used "
"re-entrantly");
mParser->mInSupportsCondition = true;
}
~nsAutoInSupportsCondition()
{
mParser->mInSupportsCondition = false;
}
private:
CSSParserImpl* const mParser;
};
// the caller must hold on to aString until parsing is done
void InitScanner(nsCSSScanner& aScanner,
css::ErrorReporter& aReporter,
@@ -4338,7 +4363,7 @@ CSSParserImpl::ParseSupportsRule(RuleAppendFunc aAppendFunc, void* aProcessData)
bool
CSSParserImpl::ParseSupportsCondition(bool& aConditionMet)
{
mInSupportsCondition = true;
nsAutoInSupportsCondition aisc(this);
if (!GetToken(true)) {
REPORT_UNEXPECTED_EOF(PESupportsConditionStartEOF2);
@@ -4356,7 +4381,6 @@ CSSParserImpl::ParseSupportsCondition(bool& aConditionMet)
bool result = ParseSupportsConditionInParens(aConditionMet) &&
ParseSupportsConditionTerms(aConditionMet) &&
!mScanner->SeenBadToken();
mInSupportsCondition = false;
return result;
}
@@ -4364,12 +4388,10 @@ CSSParserImpl::ParseSupportsCondition(bool& aConditionMet)
mToken.mIdent.LowerCaseEqualsLiteral("not")) {
bool result = ParseSupportsConditionNegation(aConditionMet) &&
!mScanner->SeenBadToken();
mInSupportsCondition = false;
return result;
}
REPORT_UNEXPECTED_TOKEN(PESupportsConditionExpectedStart);
mInSupportsCondition = false;
return false;
}
+12 -6
View File
@@ -1482,7 +1482,8 @@ CSS_PROP_DISPLAY(
contain,
Contain,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_PARSER_FUNCTION,
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
CSS_PROPERTY_FIXPOS_CB,
"layout.css.contain.enabled",
// Does not affect parsing, but is needed for tab completion in devtools:
VARIANT_HK | VARIANT_NONE,
@@ -3027,7 +3028,8 @@ CSS_PROP_DISPLAY(
Position,
CSS_PROPERTY_PARSE_VALUE |
// For position: sticky/fixed
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_ABSPOS_CB,
"",
VARIANT_HK,
kPositionKTable,
@@ -3386,7 +3388,8 @@ CSS_PROP_DISPLAY(
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR,
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR |
CSS_PROPERTY_FIXPOS_CB,
"",
0,
nullptr,
@@ -3431,7 +3434,8 @@ CSS_PROP_DISPLAY(
perspective,
Perspective,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_FIXPOS_CB,
"",
VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_POSITIVE_DIMENSION,
nullptr,
@@ -3442,7 +3446,8 @@ CSS_PROP_DISPLAY(
transform_style,
TransformStyle,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_FIXPOS_CB,
"",
VARIANT_HK,
kTransformStyleKTable,
@@ -3970,7 +3975,8 @@ CSS_PROP_SVGRESET(
filter,
Filter,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
CSS_PROPERTY_CREATES_STACKING_CONTEXT |
CSS_PROPERTY_FIXPOS_CB,
"",
0,
nullptr,
+16
View File
@@ -255,6 +255,22 @@ static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// CSS_PROP_LIST_EXCLUDE_INTERNAL section of nsCSSPropList.h.
#define CSS_PROPERTY_INTERNAL (1<<28)
// This property has values that can establish a containing block for
// fixed positioned and absolutely positioned elements.
// This should be set for any properties that can cause an element to be
// such a containing block, as implemented in
// nsStyleDisplay::IsFixedPosContainingBlock.
#define CSS_PROPERTY_FIXPOS_CB (1<<29)
// This property has values that can establish a containing block for
// absolutely positioned elements.
// This should be set for any properties that can cause an element to be
// such a containing block, as implemented in
// nsStyleDisplay::IsAbsPosContainingBlock.
// It does not need to be set for properties that also have
// CSS_PROPERTY_FIXPOS_CB set.
#define CSS_PROPERTY_ABSPOS_CB (1<<30)
/**
* Types of animatable values.
*/
+5
View File
@@ -4115,6 +4115,11 @@ AncestorFilter::AssertHasAllAncestors(Element *aElement) const
void
TreeMatchContext::AssertHasAllStyleScopes(Element* aElement) const
{
if (aElement->IsInNativeAnonymousSubtree()) {
// Document style sheets are never applied to native anonymous content,
// so it's not possible for them to be in a <style scoped> scope.
return;
}
Element* cur = aElement->GetParentElementCrossingShadowRoot();
while (cur) {
if (cur->IsScopedStyleRoot()) {
+2 -1
View File
@@ -5906,7 +5906,8 @@ nsComputedDOMStyle::DoGetTransitionProperty()
property->SetIdent(eCSSKeyword_all);
else if (cssprop == eCSSPropertyExtra_no_properties)
property->SetIdent(eCSSKeyword_none);
else if (cssprop == eCSSProperty_UNKNOWN)
else if (cssprop == eCSSProperty_UNKNOWN ||
cssprop == eCSSPropertyExtra_variable)
{
nsAutoString escaped;
nsStyleUtil::AppendEscapedCSSIdent(
+26 -28
View File
@@ -1705,29 +1705,18 @@ nsRuleNode::PropagateGrandancestorBit(nsStyleContext* aContext,
{
MOZ_ASSERT(aContext);
MOZ_ASSERT(aContextInheritedFrom &&
aContextInheritedFrom != aContext &&
aContextInheritedFrom != aContext->GetParent(),
"aContextInheritedFrom must be an ancestor of aContext's parent");
aContextInheritedFrom != aContext,
"aContextInheritedFrom must be an ancestor of aContext");
aContext->AddStyleBit(NS_STYLE_USES_GRANDANCESTOR_STYLE);
nsStyleContext* context = aContext->GetParent();
if (!context) {
return;
}
for (;;) {
nsStyleContext* parent = context->GetParent();
if (!parent) {
for (nsStyleContext* context = aContext->GetParent();
context != aContextInheritedFrom;
context = context->GetParent()) {
if (!context) {
MOZ_ASSERT(false, "aContextInheritedFrom must be an ancestor of "
"aContext's parent");
break;
}
if (parent == aContextInheritedFrom) {
break;
}
context->AddStyleBit(NS_STYLE_USES_GRANDANCESTOR_STYLE);
context = parent;
context->AddStyleBit(NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE);
}
}
@@ -5231,8 +5220,9 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
nsCSSProperty prop =
nsCSSProps::LookupProperty(propertyStr,
nsCSSProps::eEnabledForAllContent);
if (prop == eCSSProperty_UNKNOWN) {
transition->SetUnknownProperty(propertyStr);
if (prop == eCSSProperty_UNKNOWN ||
prop == eCSSPropertyExtra_variable) {
transition->SetUnknownProperty(prop, propertyStr);
} else {
transition->SetProperty(prop);
}
@@ -6108,10 +6098,18 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
nsCSSProps::LookupProperty(buffer,
nsCSSProps::eEnabledForAllContent);
if (prop != eCSSProperty_UNKNOWN &&
nsCSSProps::PropHasFlags(prop,
CSS_PROPERTY_CREATES_STACKING_CONTEXT))
{
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_STACKING_CONTEXT;
prop != eCSSPropertyExtra_variable) {
if (nsCSSProps::PropHasFlags(prop,
CSS_PROPERTY_CREATES_STACKING_CONTEXT)) {
display->mWillChangeBitField |=
NS_STYLE_WILL_CHANGE_STACKING_CONTEXT;
}
if (nsCSSProps::PropHasFlags(prop, CSS_PROPERTY_FIXPOS_CB)) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_FIXPOS_CB;
}
if (nsCSSProps::PropHasFlags(prop, CSS_PROPERTY_ABSPOS_CB)) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_ABSPOS_CB;
}
}
}
}
@@ -7821,11 +7819,11 @@ SetGridTrackList(const nsCSSValue& aValue,
// starting with a <line-names> (sub list of identifiers),
// and alternating between that and <track-size>.
aResult.mIsSubgrid = false;
for (;;) {
for (int32_t line = 1; ; ++line) {
AppendGridLineNames(item->mValue, aResult);
item = item->mNext;
if (!item) {
if (!item || line == nsStyleGridLine::kMaxLine) {
break;
}
@@ -8064,7 +8062,7 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
if (MOZ_LIKELY(parentContext)) {
nsStyleContext* grandparentContext = parentContext->GetParent();
if (MOZ_LIKELY(grandparentContext)) {
aContext->AddStyleBit(NS_STYLE_USES_GRANDANCESTOR_STYLE);
parentContext->AddStyleBit(NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE);
}
pos->mAlignSelf =
parentPos->ComputedAlignSelf(parentContext->StyleDisplay(),
@@ -8123,7 +8121,7 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
if (MOZ_LIKELY(parentContext)) {
nsStyleContext* grandparentContext = parentContext->GetParent();
if (MOZ_LIKELY(grandparentContext)) {
aContext->AddStyleBit(NS_STYLE_USES_GRANDANCESTOR_STYLE);
parentContext->AddStyleBit(NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE);
}
pos->mJustifySelf =
parentPos->ComputedJustifySelf(parentContext->StyleDisplay(),
+2
View File
@@ -243,6 +243,8 @@ enum class StyleBoxSizing : uint8_t {
#define NS_STYLE_WILL_CHANGE_TRANSFORM (1<<1)
#define NS_STYLE_WILL_CHANGE_SCROLL (1<<2)
#define NS_STYLE_WILL_CHANGE_OPACITY (1<<3)
#define NS_STYLE_WILL_CHANGE_FIXPOS_CB (1<<4)
#define NS_STYLE_WILL_CHANGE_ABSPOS_CB (1<<5)
// See AnimationEffectReadOnly.webidl
// and mozilla/dom/AnimationEffectReadOnlyBinding.h
+2 -25
View File
@@ -385,29 +385,6 @@ nsStyleContext::FindChildWithRules(const nsIAtom* aPseudoTag,
return result.forget();
}
/* static */ bool
nsStyleContext::ListContainsStyleContextThatUsesGrandancestorStyle(const nsStyleContext* aHead)
{
if (aHead) {
const nsStyleContext* child = aHead;
do {
if (child->UsesGrandancestorStyle()) {
return true;
}
child = child->mNextSibling;
} while (child != aHead);
}
return false;
}
bool
nsStyleContext::HasChildThatUsesGrandancestorStyle() const
{
return ListContainsStyleContextThatUsesGrandancestorStyle(mEmptyChild) ||
ListContainsStyleContextThatUsesGrandancestorStyle(mChild);
}
const void* nsStyleContext::StyleData(nsStyleStructID aSID)
{
const void* cachedData = GetCachedStyleData(aSID);
@@ -1559,8 +1536,8 @@ nsStyleContext::LogStyleContextTree(bool aFirst, uint32_t aStructs)
if (IsStyleIfVisited()) {
flags.AppendLiteral("IS_STYLE_IF_VISITED ");
}
if (UsesGrandancestorStyle()) {
flags.AppendLiteral("USES_GRANDANCESTOR_STYLE ");
if (HasChildThatUsesGrandancestorStyle()) {
flags.AppendLiteral("CHILD_USES_GRANDANCESTOR_STYLE ");
}
if (IsShared()) {
flags.AppendLiteral("IS_SHARED ");
+4 -13
View File
@@ -247,21 +247,16 @@ public:
}
}
// Does this style context, or any of its descendants, have any style values
// that were computed based on this style context's grandparent style context
// or any of the grandparent's ancestors?
bool UsesGrandancestorStyle() const
{ return !!(mBits & NS_STYLE_USES_GRANDANCESTOR_STYLE); }
// Does any descendant of this style context have any style values
// that were computed based on this style context's ancestors?
bool HasChildThatUsesGrandancestorStyle() const
{ return !!(mBits & NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE); }
// Is this style context shared with a sibling or cousin?
// (See nsStyleSet::GetContext.)
bool IsShared() const
{ return !!(mBits & NS_STYLE_IS_SHARED); }
// Does this style context have any children that return true for
// UsesGrandancestorStyle()?
bool HasChildThatUsesGrandancestorStyle() const;
// Tell this style context to cache aStruct as the struct for aSID
void SetStyle(nsStyleStructID aSID, void* aStruct);
@@ -490,10 +485,6 @@ private:
void ApplyStyleFixups(bool aSkipParentDisplayBasedStyleFixup);
// Helper function for HasChildThatUsesGrandancestorStyle.
static bool ListContainsStyleContextThatUsesGrandancestorStyle(
const nsStyleContext* aHead);
#ifdef DEBUG
struct AutoCheckDependency {
+11 -7
View File
@@ -2638,14 +2638,18 @@ mozilla::StyleTransition::SetInitialValues()
}
void
mozilla::StyleTransition::SetUnknownProperty(const nsAString& aUnknownProperty)
mozilla::StyleTransition::SetUnknownProperty(nsCSSProperty aProperty,
const nsAString& aPropertyString)
{
NS_ASSERTION(nsCSSProps::LookupProperty(aUnknownProperty,
nsCSSProps::eEnabledForAllContent) ==
eCSSProperty_UNKNOWN,
"should be unknown property");
mProperty = eCSSProperty_UNKNOWN;
mUnknownProperty = do_GetAtom(aUnknownProperty);
MOZ_ASSERT(nsCSSProps::LookupProperty(aPropertyString,
nsCSSProps::eEnabledForAllContent) ==
aProperty,
"property and property string should match");
MOZ_ASSERT(aProperty == eCSSProperty_UNKNOWN ||
aProperty == eCSSPropertyExtra_variable,
"should be either unknown or custom property");
mProperty = aProperty;
mUnknownProperty = do_GetAtom(aPropertyString);
}
bool
+9 -5
View File
@@ -62,8 +62,8 @@ struct nsStyleVisibility;
#define NS_STYLE_RELEVANT_LINK_VISITED 0x004000000
// See nsStyleContext::IsStyleIfVisited
#define NS_STYLE_IS_STYLE_IF_VISITED 0x008000000
// See nsStyleContext::UsesGrandancestorStyle
#define NS_STYLE_USES_GRANDANCESTOR_STYLE 0x010000000
// See nsStyleContext::HasChildThatUsesGrandancestorStyle
#define NS_STYLE_CHILD_USES_GRANDANCESTOR_STYLE 0x010000000
// See nsStyleContext::IsShared
#define NS_STYLE_IS_SHARED 0x020000000
// See nsStyleContext::AssertStructsNotUsedElsewhere
@@ -1907,10 +1907,13 @@ struct StyleTransition {
void SetDuration(float aDuration) { mDuration = aDuration; }
void SetProperty(nsCSSProperty aProperty)
{
NS_ASSERTION(aProperty != eCSSProperty_UNKNOWN, "invalid property");
NS_ASSERTION(aProperty != eCSSProperty_UNKNOWN &&
aProperty != eCSSPropertyExtra_variable,
"invalid property");
mProperty = aProperty;
}
void SetUnknownProperty(const nsAString& aUnknownProperty);
void SetUnknownProperty(nsCSSProperty aProperty,
const nsAString& aPropertyString);
void CopyPropertyFrom(const StyleTransition& aOther)
{
mProperty = aOther.mProperty;
@@ -1929,7 +1932,8 @@ private:
float mDelay;
nsCSSProperty mProperty;
nsCOMPtr<nsIAtom> mUnknownProperty; // used when mProperty is
// eCSSProperty_UNKNOWN
// eCSSProperty_UNKNOWN or
// eCSSPropertyExtra_variable
};
struct StyleAnimation {
+7 -2
View File
@@ -138,6 +138,8 @@ nsStyleDisplay::HasTransform(const nsIFrame* aContextFrame) const
bool
nsStyleDisplay::IsFixedPosContainingBlock(const nsIFrame* aContextFrame) const
{
// NOTE: Any CSS properties that influence the output of this function
// should have the CSS_PROPERTY_FIXPOS_CB set on them.
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
"unexpected aContextFrame");
return (IsContainPaint() || HasTransform(aContextFrame) ||
@@ -151,8 +153,11 @@ nsStyleDisplay::IsAbsPosContainingBlock(const nsIFrame* aContextFrame) const
{
NS_ASSERTION(aContextFrame->StyleDisplay() == this,
"unexpected aContextFrame");
return ((IsAbsolutelyPositionedStyle() || IsRelativelyPositionedStyle()) &&
!aContextFrame->IsSVGText()) || IsFixedPosContainingBlock(aContextFrame);
return ((IsAbsolutelyPositionedStyle() ||
IsRelativelyPositionedStyle() ||
(mWillChangeBitField & NS_STYLE_WILL_CHANGE_ABSPOS_CB)) &&
!aContextFrame->IsSVGText()) ||
IsFixedPosContainingBlock(aContextFrame);
}
bool
+2 -2
View File
@@ -3717,7 +3717,7 @@ var gCSSProperties = {
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "transition-property", "transition-duration", "transition-timing-function", "transition-delay" ],
initial_values: [ "all 0s ease 0s", "all", "0s", "0s 0s", "ease" ],
other_values: [ "all 0s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0s", "width 1s linear 2s", "width 1s 2s linear", "width linear 1s 2s", "linear width 1s 2s", "linear 1s width 2s", "linear 1s 2s width", "1s width linear 2s", "1s width 2s linear", "1s 2s width linear", "1s linear width 2s", "1s linear 2s width", "1s 2s linear width", "width linear 1s", "width 1s linear", "linear width 1s", "linear 1s width", "1s width linear", "1s linear width", "1s 2s width", "1s width 2s", "width 1s 2s", "1s 2s linear", "1s linear 2s", "linear 1s 2s", "width 1s", "1s width", "linear 1s", "1s linear", "1s 2s", "2s 1s", "width", "linear", "1s", "height", "2s", "ease-in-out", "2s ease-in", "opacity linear", "ease-out 2s", "2s color, 1s width, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", "1s \\32width linear 2s", "1s -width linear 2s", "1s -\\32width linear 2s", "1s \\32 0width linear 2s", "1s -\\32 0width linear 2s", "1s \\2width linear 2s", "1s -\\2width linear 2s", "2s, 1s width", "1s width, 2s", "2s all, 1s width", "1s width, 2s all", "2s all, 1s width", "2s width, 1s all" ],
other_values: [ "all 0s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0s", "width 1s linear 2s", "width 1s 2s linear", "width linear 1s 2s", "linear width 1s 2s", "linear 1s width 2s", "linear 1s 2s width", "1s width linear 2s", "1s width 2s linear", "1s 2s width linear", "1s linear width 2s", "1s linear 2s width", "1s 2s linear width", "width linear 1s", "width 1s linear", "linear width 1s", "linear 1s width", "1s width linear", "1s linear width", "1s 2s width", "1s width 2s", "width 1s 2s", "1s 2s linear", "1s linear 2s", "linear 1s 2s", "width 1s", "1s width", "linear 1s", "1s linear", "1s 2s", "2s 1s", "width", "linear", "1s", "height", "2s", "ease-in-out", "2s ease-in", "opacity linear", "ease-out 2s", "2s color, 1s width, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", "1s \\32width linear 2s", "1s -width linear 2s", "1s -\\32width linear 2s", "1s \\32 0width linear 2s", "1s -\\32 0width linear 2s", "1s \\2width linear 2s", "1s -\\2width linear 2s", "2s, 1s width", "1s width, 2s", "2s all, 1s width", "1s width, 2s all", "2s all, 1s width", "2s width, 1s all", "3s --my-color" ],
invalid_values: [ "1s width, 2s none", "2s none, 1s width", "2s inherit", "inherit 2s", "2s width, 1s inherit", "2s inherit, 1s width", "2s initial", "1s width,,2s color", "1s width, ,2s color", "bounce 1s cubic-bezier(0, rubbish) 2s", "bounce 1s steps(rubbish) 2s" ]
},
"transition-delay": {
@@ -3741,7 +3741,7 @@ var gCSSProperties = {
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "all" ],
other_values: [ "none", "left", "top", "color", "width, height, opacity", "foobar", "auto", "\\32width", "-width", "-\\32width", "\\32 0width", "-\\32 0width", "\\2width", "-\\2width", "all, all", "all, color", "color, all" ],
other_values: [ "none", "left", "top", "color", "width, height, opacity", "foobar", "auto", "\\32width", "-width", "-\\32width", "\\32 0width", "-\\32 0width", "\\2width", "-\\2width", "all, all", "all, color", "color, all", "--my-color" ],
invalid_values: [ "none, none", "color, none", "none, color", "inherit, color", "color, inherit", "initial, color", "color, initial", "none, color", "color, none" ]
},
"transition-timing-function": {
+2 -2
View File
@@ -43,7 +43,7 @@ load 382899-1.xul
load 383236-1.xul
load 384037-1.xhtml
load 384105-1.html
asserts(0-12) load 384373.html # bug 623436
load 384373.html
load 384491-1.xhtml
load 384871-1.html
load 386642.xul
@@ -90,6 +90,6 @@ load 514300-1.xul
load 536931-1.xhtml
asserts(1) load 538308-1.xul
load 557174-1.xml
load menulist-focused.xhtml
load 564705-1.xul
load 583957-1.html
load menulist-focused.xhtml
+1 -1
View File
@@ -196,7 +196,7 @@ private:
* The SHA 256 hash in raw bytes of the downloaded file. This is written
* by the worker thread but can be read on the main thread.
*/
nsAutoCString mSha256;
nsCString mSha256;
/**
* Whether or not to compute the hash. Must be set on the main thread before
+1 -1
View File
@@ -60,7 +60,7 @@ private:
uint32_t *aWriteCount);
private:
nsAutoCString mStorageName, mEnhanceId;
nsCString mStorageName, mEnhanceId;
nsCOMPtr<nsILoadContextInfo> mLoadInfo;
nsCOMPtr<nsIURI> mCacheURI;
+5 -3
View File
@@ -1884,8 +1884,10 @@ class CookieNotifierRunnable : public nsRunnable
{
public:
CookieNotifierRunnable(HttpBaseChannel* aChannel, char const * aCookie)
: mChannel(aChannel), mCookie(aCookie)
{ }
: mChannel(aChannel)
{
CopyASCIItoUTF16(aCookie, mCookie);
}
NS_IMETHOD Run()
{
@@ -1900,7 +1902,7 @@ public:
private:
RefPtr<HttpBaseChannel> mChannel;
NS_ConvertASCIItoUTF16 mCookie;
nsString mCookie;
};
} // namespace
@@ -475,8 +475,10 @@ function sendWheelAndPaint(aTarget, aOffsetX, aOffsetY, aEvent, aCallback, aWind
setTimeout(function() {
utils.advanceTimeAndRefresh(1000);
if (!aCallback)
if (!aCallback) {
utils.advanceTimeAndRefresh(0);
return;
}
var waitForPaints = function () {
SpecialPowers.Services.obs.removeObserver(waitForPaints, "apz-repaints-flushed", false);
+1
View File
@@ -1026,6 +1026,7 @@ function initElements()
resetScrollPosition(gSubView1);
resetScrollPosition(gSubView2);
resetScrollPosition(gSubView3);
_getDOMWindowUtils(window).advanceTimeAndRefresh(0);
runNextTestStep();
}