mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Backed out changeset d6e7f810f7d3 (bug 1424878)for failing reftests related to usercss/usercss-uppercase.html a=backout on a CLOSED TREE
This commit is contained in:
parent
9566c88e68
commit
5a6e9e8971
@ -735,11 +735,14 @@ nsPresContext::AppUnitsPerDevPixelChanged()
|
||||
mDeviceContext->FlushFontCache();
|
||||
}
|
||||
|
||||
MediaFeatureValuesChanged({
|
||||
eRestyle_ForceDescendants,
|
||||
NS_STYLE_HINT_REFLOW,
|
||||
MediaFeatureChangeReason::ResolutionChange
|
||||
});
|
||||
if (HasCachedStyleData()) {
|
||||
// All cached style data must be recomputed.
|
||||
MediaFeatureValuesChanged({
|
||||
eRestyle_ForceDescendants,
|
||||
NS_STYLE_HINT_REFLOW,
|
||||
MediaFeatureChangeReason::ResolutionChange
|
||||
});
|
||||
}
|
||||
|
||||
mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
|
||||
}
|
||||
@ -1403,13 +1406,18 @@ nsPresContext::UpdateEffectiveTextZoom()
|
||||
|
||||
mEffectiveTextZoom = newZoom;
|
||||
|
||||
// Media queries could have changed, since we changed the meaning
|
||||
// of 'em' units in them.
|
||||
MediaFeatureValuesChanged({
|
||||
eRestyle_ForceDescendants,
|
||||
NS_STYLE_HINT_REFLOW,
|
||||
MediaFeatureChangeReason::ZoomChange
|
||||
});
|
||||
// In case of servo, stylist.device might have already generated the default
|
||||
// computed values with the previous effective text zoom value even if the
|
||||
// pres shell has not initialized yet.
|
||||
if (mDocument->IsStyledByServo() || HasCachedStyleData()) {
|
||||
// Media queries could have changed, since we changed the meaning
|
||||
// of 'em' units in them.
|
||||
MediaFeatureValuesChanged({
|
||||
eRestyle_ForceDescendants,
|
||||
NS_STYLE_HINT_REFLOW,
|
||||
MediaFeatureChangeReason::ZoomChange
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
@ -1452,12 +1460,13 @@ nsPresContext::SetOverrideDPPX(float aDPPX)
|
||||
// SetOverrideDPPX is called during navigations, including history
|
||||
// traversals. In that case, it's typically called with our current value,
|
||||
// and we don't need to actually do anything.
|
||||
if (aDPPX == mOverrideDPPX) {
|
||||
return;
|
||||
}
|
||||
if (aDPPX != mOverrideDPPX) {
|
||||
mOverrideDPPX = aDPPX;
|
||||
|
||||
mOverrideDPPX = aDPPX;
|
||||
MediaFeatureValuesChanged({ MediaFeatureChangeReason::ResolutionChange });
|
||||
if (HasCachedStyleData()) {
|
||||
MediaFeatureValuesChanged({ MediaFeatureChangeReason::ResolutionChange });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gfxSize
|
||||
@ -2201,6 +2210,10 @@ NotifyTabSizeModeChanged(TabParent* aTab, void* aArg)
|
||||
void
|
||||
nsPresContext::SizeModeChanged(nsSizeMode aSizeMode)
|
||||
{
|
||||
if (!HasCachedStyleData()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsContentUtils::CallOnAllRemoteChildren(mDocument->GetWindow(),
|
||||
NotifyTabSizeModeChanged,
|
||||
&aSizeMode);
|
||||
@ -2773,6 +2786,27 @@ nsPresContext::NotifyDidPaintForSubtree(uint64_t aTransactionId,
|
||||
mDocument->EnumerateSubDocuments(nsPresContext::NotifyDidPaintSubdocumentCallback, &closure);
|
||||
}
|
||||
|
||||
bool
|
||||
nsPresContext::HasCachedStyleData()
|
||||
{
|
||||
if (!mShell) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mShell->StyleSet()->IsGecko()) {
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
return mShell->StyleSet()->AsGecko()->HasCachedStyleData();
|
||||
#else
|
||||
MOZ_CRASH("old style system disabled");
|
||||
#endif
|
||||
}
|
||||
|
||||
// XXXheycam ServoStyleSets do not use the rule tree, so just assume for now
|
||||
// that we need to restyle when e.g. dppx changes assuming we're sufficiently
|
||||
// bootstrapped.
|
||||
return mShell->DidInitialize();
|
||||
}
|
||||
|
||||
already_AddRefed<nsITimer>
|
||||
nsPresContext::CreateTimer(nsTimerCallbackFunc aCallback,
|
||||
const char* aName,
|
||||
|
@ -472,7 +472,7 @@ public:
|
||||
if (!r.IsEqualEdges(mVisibleArea)) {
|
||||
mVisibleArea = r;
|
||||
// Visible area does not affect media queries when paginated.
|
||||
if (!IsPaginated()) {
|
||||
if (!IsPaginated() && HasCachedStyleData()) {
|
||||
MediaFeatureValuesChanged({
|
||||
mozilla::MediaFeatureChangeReason::ViewportChange
|
||||
});
|
||||
@ -619,19 +619,19 @@ public:
|
||||
* independent of the language-specific global preference.
|
||||
*/
|
||||
void SetBaseMinFontSize(int32_t aMinFontSize) {
|
||||
if (aMinFontSize == mBaseMinFontSize) {
|
||||
if (aMinFontSize == mBaseMinFontSize)
|
||||
return;
|
||||
}
|
||||
|
||||
mBaseMinFontSize = aMinFontSize;
|
||||
|
||||
// Media queries could have changed, since we changed the meaning
|
||||
// of 'em' units in them.
|
||||
MediaFeatureValuesChanged({
|
||||
eRestyle_ForceDescendants,
|
||||
NS_STYLE_HINT_REFLOW,
|
||||
mozilla::MediaFeatureChangeReason::MinFontSizeChange
|
||||
});
|
||||
if (HasCachedStyleData()) {
|
||||
// Media queries could have changed, since we changed the meaning
|
||||
// of 'em' units in them.
|
||||
MediaFeatureValuesChanged({
|
||||
eRestyle_ForceDescendants,
|
||||
NS_STYLE_HINT_REFLOW,
|
||||
mozilla::MediaFeatureChangeReason::MinFontSizeChange
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
float GetFullZoom() { return mFullZoom; }
|
||||
@ -1282,6 +1282,9 @@ protected:
|
||||
|
||||
bool HavePendingInputEvent();
|
||||
|
||||
// Can't be inline because we can't include nsStyleSet.h.
|
||||
bool HasCachedStyleData();
|
||||
|
||||
// Creates a one-shot timer with the given aCallback & aDelay.
|
||||
// Returns a refcounted pointer to the timer (or nullptr on failure).
|
||||
already_AddRefed<nsITimer> CreateTimer(nsTimerCallbackFunc aCallback,
|
||||
|
@ -475,6 +475,16 @@ class nsStyleSet final
|
||||
--mRootStyleContextCount;
|
||||
}
|
||||
|
||||
// Return whether the rule tree has cached data such that we need to
|
||||
// do dynamic change handling for changes that change the results of
|
||||
// media queries or require rebuilding all style data.
|
||||
// We don't care whether we have cached rule processors or whether
|
||||
// they have cached rule cascades; getting the rule cascades again in
|
||||
// order to do rule matching will get the correct rule cascade.
|
||||
bool HasCachedStyleData() const {
|
||||
return (mRuleTree && mRuleTree->TreeHasCachedData()) || mRootStyleContextCount > 0;
|
||||
}
|
||||
|
||||
// Notify the style set that a rulenode is no longer in use, or was
|
||||
// just created and is not in use yet.
|
||||
static const uint32_t kGCInterval = 300;
|
||||
|
@ -160077,18 +160077,6 @@
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/mediaqueries/viewport-script-dynamic.html": [
|
||||
[
|
||||
"/css/mediaqueries/viewport-script-dynamic.html",
|
||||
[
|
||||
[
|
||||
"/css/mediaqueries/viewport-script-dynamic-ref.html",
|
||||
"=="
|
||||
]
|
||||
],
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/motion/offset-anchor-transform-box-fill-box.html": [
|
||||
[
|
||||
"/css/motion/offset-anchor-transform-box-fill-box.html",
|
||||
@ -260047,11 +260035,6 @@
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/mediaqueries/viewport-script-dynamic-ref.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"css/motion/animation/resources/interpolation-testcommon.js": [
|
||||
[
|
||||
{}
|
||||
@ -526237,14 +526220,6 @@
|
||||
"234627714b5f304ad7efbeaf2dea3455125f8cc4",
|
||||
"testharness"
|
||||
],
|
||||
"css/mediaqueries/viewport-script-dynamic-ref.html": [
|
||||
"7d55c513e2de39c9b362fc864233a3008ca6ced2",
|
||||
"support"
|
||||
],
|
||||
"css/mediaqueries/viewport-script-dynamic.html": [
|
||||
"1c2ba1a9116942599804ed29553e85628afadb04",
|
||||
"reftest"
|
||||
],
|
||||
"css/motion/animation/offset-anchor-interpolation.html": [
|
||||
"30eb3ea68aa502d93125d4e54ff15c0a96458cfa",
|
||||
"testharness"
|
||||
@ -592274,19 +592249,19 @@
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/modifier_click.py": [
|
||||
"88a384182fdd9df1515b9d8cfda8f56aed138ec7",
|
||||
"56df38086ef05cd8bff1437038efb598ab63f1e3",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/mouse.py": [
|
||||
"edad7693fcd01b418821942edb870191db64ea41",
|
||||
"2fb4c47335f144a2dd6f16db4c20239116f20fed",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/mouse_dblclick.py": [
|
||||
"f6afcb8c0fa017d58a9fcdd3cc474e0c8fd52db5",
|
||||
"932b053eef5e052d53ab2007540428d68b758ad4",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/pointer_origin.py": [
|
||||
"a9a99d58daec7719ee53ed758f566ccceb582f65",
|
||||
"da2a9f21018582c8cd52d206d172841f71fd19f3",
|
||||
"wdspec"
|
||||
],
|
||||
"webdriver/tests/actions/sequence.py": [
|
||||
@ -592306,7 +592281,7 @@
|
||||
"support"
|
||||
],
|
||||
"webdriver/tests/actions/support/mouse.py": [
|
||||
"bc7da107e5b897105dfa7405aa57cba7355854dc",
|
||||
"208a1c4fbc0d5c542d17de7f6474d477ce1feb45",
|
||||
"support"
|
||||
],
|
||||
"webdriver/tests/actions/support/refine.py": [
|
||||
@ -592314,7 +592289,7 @@
|
||||
"support"
|
||||
],
|
||||
"webdriver/tests/actions/support/test_actions_wdspec.html": [
|
||||
"95203777fcc012ab64465287737a89a4ba2c31dc",
|
||||
"34f99c46ac9c52e5902477c26a3d16a89a29235a",
|
||||
"support"
|
||||
],
|
||||
"webdriver/tests/conftest.py": [
|
||||
|
@ -1,2 +0,0 @@
|
||||
[viewport-script-dynamic.html]
|
||||
prefs: [dom.meta-viewport.enabled:true]
|
@ -1,9 +0,0 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test Reference</title>
|
||||
<link rel="author" href="mailto:emilio@crisal.io">
|
||||
<meta name="viewport" content="width=300">
|
||||
<style>
|
||||
p { color: green; }
|
||||
</style>
|
||||
<p>Should be green</p>
|
@ -1,20 +0,0 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: Meta viewport after a script and stylesheets</title>
|
||||
<link rel="author" href="mailto:emilio@crisal.io">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1424878">
|
||||
<link rel="help" href="https://drafts.csswg.org/mediaqueries/#mf-dimensions">
|
||||
<link rel="match" href="viewport-script-dynamic-ref.html">
|
||||
<style>
|
||||
p { color: green; }
|
||||
/* Ensure that we initially match it, and stop matching it afterwards */
|
||||
@media (min-width: 310px) {
|
||||
p {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- The broken script below is the point of the test, see the bugzilla bug. -->
|
||||
<script src="intentionally-broken-url.js"></script>
|
||||
<meta name="viewport" content="width=300">
|
||||
<p>Should be green</p>
|
Loading…
Reference in New Issue
Block a user