From f6388e33fd402f6e904da227a5b9471e2c82eb33 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 18 Feb 2019 18:17:10 +0100 Subject: [PATCH 1/8] Bug 1525775 - [css-mediaqueries] Synthesize a value for eIntID_SystemUsesDarkTheme to determine if GTK are using a light or dark theme. r=heycam,karlt --- widget/gtk/nsLookAndFeel.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp index 254c8d4e2be9..b6bbcccf44a8 100644 --- a/widget/gtk/nsLookAndFeel.cpp +++ b/widget/gtk/nsLookAndFeel.cpp @@ -706,6 +706,18 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) { aResult = enableAnimations ? 0 : 1; break; } + case eIntID_SystemUsesDarkTheme: { + // It seems GTK doesn't have an API to query if the current theme is + // "light" or "dark", so we synthesize it from the CSS2 Window/WindowText + // colors instead, by comparing their luminosity. + nscolor fg, bg; + if (NS_SUCCEEDED(NativeGetColor(eColorID_windowtext, fg)) && + NS_SUCCEEDED(NativeGetColor(eColorID_window, bg))) { + aResult = NS_GetLuminosity(bg) < NS_GetLuminosity(fg) ? 1 : 0; + break; + } + MOZ_FALLTHROUGH; + } default: aResult = 0; res = NS_ERROR_FAILURE; From 3330fe7b0cb8dae761a5ea3f18b1fe71a5fa8e72 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 18 Feb 2019 18:17:10 +0100 Subject: [PATCH 2/8] Bug 1526567 - [css-grid] Make the block-axis percentage basis be indefinite for measuring reflows. r=dholbert --- layout/generic/ReflowInput.cpp | 6 + layout/generic/nsGridContainerFrame.cpp | 2 +- layout/reftests/css-grid/reftest.list | 2 +- .../range-percent-intrinsic-size-2b-ref.html | 5 +- .../range-percent-intrinsic-size-2.html.ini | 4 - .../grid-item-percentage-sizes-001-ref.html | 312 +++++++++++++++++ .../grid-item-percentage-sizes-001.html | 318 ++++++++++++++++++ .../grid-item-percentage-sizes-002-ref.html | 312 +++++++++++++++++ .../grid-item-percentage-sizes-002.html | 318 ++++++++++++++++++ .../grid-item-percentage-sizes-003-ref.html | 316 +++++++++++++++++ .../grid-item-percentage-sizes-003.html | 318 ++++++++++++++++++ .../range-percent-intrinsic-size-2-ref.html | 20 +- .../range-percent-intrinsic-size-2a-ref.html | 5 +- 13 files changed, 1920 insertions(+), 18 deletions(-) delete mode 100644 testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini create mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html create mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html create mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html create mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html create mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html create mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 2e71d9781e85..448a7d0d20f9 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -2931,6 +2931,9 @@ bool SizeComputationInput::ComputeMargin(WritingMode aWM, // We have to compute the value. Note that this calculation is // performed according to the writing mode of the containing block // (http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-flows) + if (aPercentBasis == NS_UNCONSTRAINEDSIZE) { + aPercentBasis = 0; + } LogicalMargin m(aWM); m.IStart(aWM) = nsLayoutUtils::ComputeCBDependentValue( aPercentBasis, styleMargin->mMargin.GetIStart(aWM)); @@ -2976,6 +2979,9 @@ bool SizeComputationInput::ComputePadding(WritingMode aWM, // according to the writing mode of the containing block // (http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-flows) // clamp negative calc() results to 0 + if (aPercentBasis == NS_UNCONSTRAINEDSIZE) { + aPercentBasis = 0; + } LogicalMargin p(aWM); p.IStart(aWM) = std::max(0, nsLayoutUtils::ComputeCBDependentValue( diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index f8cb877d056f..a6b23d4906b5 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3439,7 +3439,7 @@ static nscoord ContentContribution( // The next two variables are MinSizeClamp values in the child's axes. nscoord iMinSizeClamp = NS_MAXSIZE; nscoord bMinSizeClamp = NS_MAXSIZE; - LogicalSize cbSize(childWM, 0, 0); + LogicalSize cbSize(childWM, 0, NS_UNCONSTRAINEDSIZE); if (aState.mCols.mCanResolveLineRangeSize) { nscoord sz = aState.mCols.ResolveSize(aGridItem.mArea.mCols); if (isOrthogonal) { diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list index f95d2159bdc9..164c0bbc8931 100644 --- a/layout/reftests/css-grid/reftest.list +++ b/layout/reftests/css-grid/reftest.list @@ -123,7 +123,7 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == grid-item-auto-min-size- == grid-item-canvas-001.html grid-item-canvas-001-ref.html skip-if(Android) == grid-item-button-001.html grid-item-button-001-ref.html == grid-item-table-stretch-001.html grid-item-table-stretch-001-ref.html -== grid-item-table-stretch-002.html grid-item-table-stretch-002-ref.html +fails-if(Android) == grid-item-table-stretch-002.html grid-item-table-stretch-002-ref.html # Bug 1527734 == grid-item-table-stretch-003.html grid-item-table-stretch-003-ref.html == grid-item-table-stretch-004.html grid-item-table-stretch-004-ref.html == grid-item-fieldset-stretch-001.html grid-item-fieldset-stretch-001-ref.html diff --git a/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html b/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html index a1412286cd68..830321d5b193 100644 --- a/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html +++ b/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html @@ -75,8 +75,9 @@ input[orient="vertical"] { -
- +
+ +
diff --git a/testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini b/testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini deleted file mode 100644 index 8d3374d831f7..000000000000 --- a/testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[range-percent-intrinsic-size-2.html] - expected: - if (os == "win"): FAIL - if (os == "android"): "FAIL" diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html new file mode 100644 index 000000000000..109087157512 --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html @@ -0,0 +1,312 @@ + + +CSS Grid Layout Reference: item [min-|max-]*[width|height] percentages + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html new file mode 100644 index 000000000000..97532e495c1f --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html @@ -0,0 +1,318 @@ + + +CSS Grid Layout Test: item [min-|max-]*[width|height] percentages + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html new file mode 100644 index 000000000000..568642631b1d --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html @@ -0,0 +1,312 @@ + + +CSS Grid Layout Reference: item [min-|max-]*[width|height] percentages + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html new file mode 100644 index 000000000000..2ceba537f0cc --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html @@ -0,0 +1,318 @@ + + +CSS Grid Layout Test: item [min-|max-]*[width|height] percentages + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html new file mode 100644 index 000000000000..41070a8f013c --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html @@ -0,0 +1,316 @@ + + +CSS Grid Layout Reference: item [min-|max-]*[width|height] calc() percentages + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html new file mode 100644 index 000000000000..fccf4fe0a6ed --- /dev/null +++ b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html @@ -0,0 +1,318 @@ + + +CSS Grid Layout Test: item [min-|max-]*[width|height] calc() percentages + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html index 83eff4b45c2c..207b60d8f27a 100644 --- a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html +++ b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html @@ -97,12 +97,14 @@ input[orient="vertical"] {
-
- +
+ +
-
- +
+ +
@@ -117,12 +119,14 @@ input[orient="vertical"] {
-
- +
+ +
-
- +
+ +
diff --git a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html index 815b0a1021cb..861d34c6a08d 100644 --- a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html +++ b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html @@ -71,8 +71,9 @@ input[orient="vertical"] {
-
- +
+ +
From d631a5507967316feccce1d2fc58325c34e80988 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Mon, 18 Feb 2019 21:23:40 +0200 Subject: [PATCH 3/8] Backed out 2 changesets (bug 1526567, bug 1525775) for dt failures on browser_webconsole_sidebar_scroll.js . CLOSED TREE Backed out changeset e919946fd913 (bug 1526567) Backed out changeset 133509097b7c (bug 1525775) --- layout/generic/ReflowInput.cpp | 6 - layout/generic/nsGridContainerFrame.cpp | 2 +- layout/reftests/css-grid/reftest.list | 2 +- .../range-percent-intrinsic-size-2b-ref.html | 5 +- .../range-percent-intrinsic-size-2.html.ini | 4 + .../grid-item-percentage-sizes-001-ref.html | 312 ----------------- .../grid-item-percentage-sizes-001.html | 318 ------------------ .../grid-item-percentage-sizes-002-ref.html | 312 ----------------- .../grid-item-percentage-sizes-002.html | 318 ------------------ .../grid-item-percentage-sizes-003-ref.html | 316 ----------------- .../grid-item-percentage-sizes-003.html | 318 ------------------ .../range-percent-intrinsic-size-2-ref.html | 20 +- .../range-percent-intrinsic-size-2a-ref.html | 5 +- widget/gtk/nsLookAndFeel.cpp | 12 - 14 files changed, 18 insertions(+), 1932 deletions(-) create mode 100644 testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini delete mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html delete mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html delete mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html delete mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html delete mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html delete mode 100644 testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 448a7d0d20f9..2e71d9781e85 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -2931,9 +2931,6 @@ bool SizeComputationInput::ComputeMargin(WritingMode aWM, // We have to compute the value. Note that this calculation is // performed according to the writing mode of the containing block // (http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-flows) - if (aPercentBasis == NS_UNCONSTRAINEDSIZE) { - aPercentBasis = 0; - } LogicalMargin m(aWM); m.IStart(aWM) = nsLayoutUtils::ComputeCBDependentValue( aPercentBasis, styleMargin->mMargin.GetIStart(aWM)); @@ -2979,9 +2976,6 @@ bool SizeComputationInput::ComputePadding(WritingMode aWM, // according to the writing mode of the containing block // (http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-flows) // clamp negative calc() results to 0 - if (aPercentBasis == NS_UNCONSTRAINEDSIZE) { - aPercentBasis = 0; - } LogicalMargin p(aWM); p.IStart(aWM) = std::max(0, nsLayoutUtils::ComputeCBDependentValue( diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index a6b23d4906b5..f8cb877d056f 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3439,7 +3439,7 @@ static nscoord ContentContribution( // The next two variables are MinSizeClamp values in the child's axes. nscoord iMinSizeClamp = NS_MAXSIZE; nscoord bMinSizeClamp = NS_MAXSIZE; - LogicalSize cbSize(childWM, 0, NS_UNCONSTRAINEDSIZE); + LogicalSize cbSize(childWM, 0, 0); if (aState.mCols.mCanResolveLineRangeSize) { nscoord sz = aState.mCols.ResolveSize(aGridItem.mArea.mCols); if (isOrthogonal) { diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list index 164c0bbc8931..f95d2159bdc9 100644 --- a/layout/reftests/css-grid/reftest.list +++ b/layout/reftests/css-grid/reftest.list @@ -123,7 +123,7 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == grid-item-auto-min-size- == grid-item-canvas-001.html grid-item-canvas-001-ref.html skip-if(Android) == grid-item-button-001.html grid-item-button-001-ref.html == grid-item-table-stretch-001.html grid-item-table-stretch-001-ref.html -fails-if(Android) == grid-item-table-stretch-002.html grid-item-table-stretch-002-ref.html # Bug 1527734 +== grid-item-table-stretch-002.html grid-item-table-stretch-002-ref.html == grid-item-table-stretch-003.html grid-item-table-stretch-003-ref.html == grid-item-table-stretch-004.html grid-item-table-stretch-004-ref.html == grid-item-fieldset-stretch-001.html grid-item-fieldset-stretch-001-ref.html diff --git a/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html b/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html index 830321d5b193..a1412286cd68 100644 --- a/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html +++ b/layout/reftests/forms/input/range/range-percent-intrinsic-size-2b-ref.html @@ -75,9 +75,8 @@ input[orient="vertical"] {
-
- - +
+
diff --git a/testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini b/testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini new file mode 100644 index 000000000000..8d3374d831f7 --- /dev/null +++ b/testing/web-platform/meta/css/css-sizing/range-percent-intrinsic-size-2.html.ini @@ -0,0 +1,4 @@ +[range-percent-intrinsic-size-2.html] + expected: + if (os == "win"): FAIL + if (os == "android"): "FAIL" diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html deleted file mode 100644 index 109087157512..000000000000 --- a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001-ref.html +++ /dev/null @@ -1,312 +0,0 @@ - - -CSS Grid Layout Reference: item [min-|max-]*[width|height] percentages - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html deleted file mode 100644 index 97532e495c1f..000000000000 --- a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-001.html +++ /dev/null @@ -1,318 +0,0 @@ - - -CSS Grid Layout Test: item [min-|max-]*[width|height] percentages - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html deleted file mode 100644 index 568642631b1d..000000000000 --- a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002-ref.html +++ /dev/null @@ -1,312 +0,0 @@ - - -CSS Grid Layout Reference: item [min-|max-]*[width|height] percentages - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html deleted file mode 100644 index 2ceba537f0cc..000000000000 --- a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-002.html +++ /dev/null @@ -1,318 +0,0 @@ - - -CSS Grid Layout Test: item [min-|max-]*[width|height] percentages - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html deleted file mode 100644 index 41070a8f013c..000000000000 --- a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003-ref.html +++ /dev/null @@ -1,316 +0,0 @@ - - -CSS Grid Layout Reference: item [min-|max-]*[width|height] calc() percentages - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html b/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html deleted file mode 100644 index fccf4fe0a6ed..000000000000 --- a/testing/web-platform/tests/css/css-grid/grid-items/grid-item-percentage-sizes-003.html +++ /dev/null @@ -1,318 +0,0 @@ - - -CSS Grid Layout Test: item [min-|max-]*[width|height] calc() percentages - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html index 207b60d8f27a..83eff4b45c2c 100644 --- a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html +++ b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2-ref.html @@ -97,14 +97,12 @@ input[orient="vertical"] {
-
- - +
+
-
- - +
+
@@ -119,14 +117,12 @@ input[orient="vertical"] {
-
- - +
+
-
- - +
+
diff --git a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html index 861d34c6a08d..815b0a1021cb 100644 --- a/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html +++ b/testing/web-platform/tests/css/css-sizing/range-percent-intrinsic-size-2a-ref.html @@ -71,9 +71,8 @@ input[orient="vertical"] {
-
- - +
+
diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp index b6bbcccf44a8..254c8d4e2be9 100644 --- a/widget/gtk/nsLookAndFeel.cpp +++ b/widget/gtk/nsLookAndFeel.cpp @@ -706,18 +706,6 @@ nsresult nsLookAndFeel::GetIntImpl(IntID aID, int32_t& aResult) { aResult = enableAnimations ? 0 : 1; break; } - case eIntID_SystemUsesDarkTheme: { - // It seems GTK doesn't have an API to query if the current theme is - // "light" or "dark", so we synthesize it from the CSS2 Window/WindowText - // colors instead, by comparing their luminosity. - nscolor fg, bg; - if (NS_SUCCEEDED(NativeGetColor(eColorID_windowtext, fg)) && - NS_SUCCEEDED(NativeGetColor(eColorID_window, bg))) { - aResult = NS_GetLuminosity(bg) < NS_GetLuminosity(fg) ? 1 : 0; - break; - } - MOZ_FALLTHROUGH; - } default: aResult = 0; res = NS_ERROR_FAILURE; From 7afb5aaf34a8e7111a6aaa8bbebe0eee789f467f Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Sun, 17 Feb 2019 22:27:56 -0700 Subject: [PATCH 4/8] Bug 1521425 - Round up when inflating mRect of SVG text. r=longsonr --- layout/svg/SVGTextFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index f0065c07a929..dbd8f477a9b6 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -3520,7 +3520,7 @@ void SVGTextFrame::ReflowSVG() { // Due to rounding issues when we have a transform applied, we sometimes // don't include an additional row of pixels. For now, just inflate our // covered region. - mRect.Inflate(presContext->AppUnitsPerDevPixel() / mLastContextScale); + mRect.Inflate(ceil(presContext->AppUnitsPerDevPixel() / mLastContextScale)); } if (mState & NS_FRAME_FIRST_REFLOW) { From 0f5eab5423a0d2383008f88013687add311fa02a Mon Sep 17 00:00:00 2001 From: Ivan Yung Date: Mon, 18 Feb 2019 19:16:16 -0300 Subject: [PATCH 5/8] Bug 1497934 - When about:policies#active is empty, show a message. r=felipe,flod --- .../content/aboutPolicies.css | 21 +++++++++++++++++++ .../content/aboutPolicies.js | 10 ++++++++- .../content/aboutPolicies.xhtml | 2 ++ .../locales/en-US/browser/aboutPolicies.ftl | 3 +++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/browser/components/enterprisepolicies/content/aboutPolicies.css b/browser/components/enterprisepolicies/content/aboutPolicies.css index 46ce5278921b..e946b772d385 100644 --- a/browser/components/enterprisepolicies/content/aboutPolicies.css +++ b/browser/components/enterprisepolicies/content/aboutPolicies.css @@ -147,3 +147,24 @@ tbody.collapsible td { white-space: pre; direction: ltr; } + +/* + * The Active tab has two messages: one for when the policy service + * is inactive and another for when the there are no specified + * policies. The three classes below control which message to display + * or to show the policy table. + */ +.no-specified-policies > table, +.inactive-service > table { + display: none; +} + +:not(.no-specified-policies) > .no-specified-policies-message, +:not(.inactive-service) > .inactive-service-message { + display: none; +} + +.no-specified-policies-message, +.inactive-service-message { + padding: 1rem; +} diff --git a/browser/components/enterprisepolicies/content/aboutPolicies.js b/browser/components/enterprisepolicies/content/aboutPolicies.js index d5804560d2f8..5f9f43dd3958 100644 --- a/browser/components/enterprisepolicies/content/aboutPolicies.js +++ b/browser/components/enterprisepolicies/content/aboutPolicies.js @@ -91,6 +91,15 @@ function generateActivePolicies(data) { } } + if (policy_count < 1) { + let current_tab = document.querySelector(".active"); + if (Services.policies.status == Services.policies.ACTIVE) { + current_tab.classList.add("no-specified-policies"); + } else { + current_tab.classList.add("inactive-service"); + } + } + addMissingColumns(); } @@ -206,7 +215,6 @@ function generateErrors() { new_cont.appendChild(row); } } - if (!flag) { let errors_tab = document.getElementById("category-errors"); errors_tab.style.display = "none"; diff --git a/browser/components/enterprisepolicies/content/aboutPolicies.xhtml b/browser/components/enterprisepolicies/content/aboutPolicies.xhtml index 5c09781b49dc..33b76f3b66e2 100644 --- a/browser/components/enterprisepolicies/content/aboutPolicies.xhtml +++ b/browser/components/enterprisepolicies/content/aboutPolicies.xhtml @@ -37,6 +37,8 @@
+

+

diff --git a/browser/locales/en-US/browser/aboutPolicies.ftl b/browser/locales/en-US/browser/aboutPolicies.ftl index 6fa7b49247ad..d5ef87a5738d 100644 --- a/browser/locales/en-US/browser/aboutPolicies.ftl +++ b/browser/locales/en-US/browser/aboutPolicies.ftl @@ -9,6 +9,9 @@ active-policies-tab = Active errors-tab = Errors documentation-tab = Documentation +no-specified-policies-message = The Enterprise Policies service is active but there are no policies enabled. +inactive-message = The Enterprise Policies service is inactive. + policy-name = Policy Name policy-value = Policy Value policy-errors = Policy Errors From b820dc9fb95f4306276bd23a73a9c7129aaaddb0 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Mon, 18 Feb 2019 17:12:31 -0600 Subject: [PATCH 6/8] Bug 1520931 - Baldr: another follow-up simplification from asm.js caching removal (r=bbouvier) --HG-- extra : rebase_source : e379f66ed0785becfa63a17fb33ab62171545364 --- js/src/wasm/AsmJS.cpp | 25 +++++++++-------------- js/src/wasm/WasmCompile.cpp | 4 ++-- js/src/wasm/WasmCompile.h | 2 +- js/src/wasm/WasmGenerator.cpp | 8 +------- js/src/wasm/WasmGenerator.h | 3 +-- js/src/wasm/WasmJS.cpp | 38 +++++++++++++++++++++++++---------- 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp index adf7442dc788..8bde64e874f0 100644 --- a/js/src/wasm/AsmJS.cpp +++ b/js/src/wasm/AsmJS.cpp @@ -2074,7 +2074,7 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidator str); } - SharedModule finish(UniqueLinkData* linkData) { + SharedModule finish() { MOZ_ASSERT(env_.funcTypes.empty()); if (!env_.funcTypes.resize(funcImportMap_.count() + funcDefs_.length())) { return nullptr; @@ -2167,7 +2167,7 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidator return nullptr; } - return mg.finishModule(*bytes, nullptr, linkData); + return mg.finishModule(*bytes); } }; @@ -6350,8 +6350,7 @@ static bool CheckModuleEnd(ModuleValidator& m) { template static SharedModule CheckModule(JSContext* cx, AsmJSParser& parser, - ParseNode* stmtList, UniqueLinkData* linkData, - unsigned* time) { + ParseNode* stmtList, unsigned* time) { int64_t before = PRMJ_Now(); FunctionNode* moduleFunctionNode = parser.pc->functionBox()->functionNode; @@ -6401,7 +6400,7 @@ static SharedModule CheckModule(JSContext* cx, AsmJSParser& parser, return nullptr; } - SharedModule module = m.finish(linkData); + SharedModule module = m.finish(); if (!module) { return nullptr; } @@ -7068,18 +7067,12 @@ static bool DoCompileAsmJS(JSContext* cx, AsmJSParser& parser, return NoExceptionPending(cx); } - // Validate and generate code in a single linear pass over the chars of the - // asm.js module. - SharedModule module; + // "Checking" parses, validates and compiles, producing a fully compiled + // WasmModuleObject as result. unsigned time; - { - // "Checking" parses, validates and compiles, producing a fully compiled - // WasmModuleObject as result. - UniqueLinkData linkData; - module = CheckModule(cx, parser, stmtList, &linkData, &time); - if (!module) { - return NoExceptionPending(cx); - } + SharedModule module = CheckModule(cx, parser, stmtList, &time); + if (!module) { + return NoExceptionPending(cx); } // Hand over ownership to a GC object wrapper which can then be referenced diff --git a/js/src/wasm/WasmCompile.cpp b/js/src/wasm/WasmCompile.cpp index 0cc345a66a6d..bab27d7f257f 100644 --- a/js/src/wasm/WasmCompile.cpp +++ b/js/src/wasm/WasmCompile.cpp @@ -551,7 +551,7 @@ SharedModule wasm::CompileBuffer(const CompileArgs& args, const ShareableBytes& bytecode, UniqueChars* error, UniqueCharsVector* warnings, - UniqueLinkData* maybeLinkData) { + JS::OptimizedEncodingListener* listener) { Decoder d(bytecode.bytes, 0, error, warnings); CompilerEnvironment compilerEnv(args); @@ -575,7 +575,7 @@ SharedModule wasm::CompileBuffer(const CompileArgs& args, return nullptr; } - return mg.finishModule(bytecode, nullptr, maybeLinkData); + return mg.finishModule(bytecode, listener); } void wasm::CompileTier2(const CompileArgs& args, const Bytes& bytecode, diff --git a/js/src/wasm/WasmCompile.h b/js/src/wasm/WasmCompile.h index 8831e77fb95b..71722ff6bea0 100644 --- a/js/src/wasm/WasmCompile.h +++ b/js/src/wasm/WasmCompile.h @@ -95,7 +95,7 @@ double EstimateCompiledCodeSize(Tier tier, size_t bytecodeSize); SharedModule CompileBuffer(const CompileArgs& args, const ShareableBytes& bytecode, UniqueChars* error, UniqueCharsVector* warnings, - UniqueLinkData* maybeLinkData = nullptr); + JS::OptimizedEncodingListener* listener = nullptr); // Attempt to compile the second tier of the given wasm::Module. diff --git a/js/src/wasm/WasmGenerator.cpp b/js/src/wasm/WasmGenerator.cpp index a403ea2859d5..a4c21ff70a0b 100644 --- a/js/src/wasm/WasmGenerator.cpp +++ b/js/src/wasm/WasmGenerator.cpp @@ -1094,8 +1094,7 @@ SharedMetadata ModuleGenerator::finishMetadata(const Bytes& bytecode) { SharedModule ModuleGenerator::finishModule( const ShareableBytes& bytecode, - JS::OptimizedEncodingListener* maybeTier2Listener, - UniqueLinkData* maybeLinkData) { + JS::OptimizedEncodingListener* maybeTier2Listener) { MOZ_ASSERT(mode() == CompileMode::Once || mode() == CompileMode::Tier1); UniqueCodeTier codeTier = finishCodeTier(); @@ -1213,11 +1212,6 @@ SharedModule ModuleGenerator::finishModule( module->serialize(*linkData_, *maybeTier2Listener); } - if (maybeLinkData) { - MOZ_ASSERT(!env_->debugEnabled()); - *maybeLinkData = std::move(linkData_); - } - return module; } diff --git a/js/src/wasm/WasmGenerator.h b/js/src/wasm/WasmGenerator.h index 60ad3729de3a..acce079f9277 100644 --- a/js/src/wasm/WasmGenerator.h +++ b/js/src/wasm/WasmGenerator.h @@ -220,8 +220,7 @@ class MOZ_STACK_CLASS ModuleGenerator { SharedModule finishModule( const ShareableBytes& bytecode, - JS::OptimizedEncodingListener* maybeTier2Listener = nullptr, - UniqueLinkData* maybeLinkData = nullptr); + JS::OptimizedEncodingListener* maybeTier2Listener = nullptr); MOZ_MUST_USE bool finishTier2(const Module& module); }; diff --git a/js/src/wasm/WasmJS.cpp b/js/src/wasm/WasmJS.cpp index 4a5ff820d4de..a9bed467e256 100644 --- a/js/src/wasm/WasmJS.cpp +++ b/js/src/wasm/WasmJS.cpp @@ -452,6 +452,24 @@ bool wasm::Eval(JSContext* cx, Handle code, globalObjs.get(), nullptr, instanceObj); } +struct MOZ_STACK_CLASS SerializeListener : JS::OptimizedEncodingListener { + // MOZ_STACK_CLASS means these can be nops. + MozExternalRefCountType MOZ_XPCOM_ABI AddRef() override { return 0; } + MozExternalRefCountType MOZ_XPCOM_ABI Release() override { return 0; } + + DebugOnly called = false; + Bytes* serialized; + SerializeListener(Bytes* serialized) : serialized(serialized) {} + + void storeOptimizedEncoding(const uint8_t* bytes, size_t length) override { + MOZ_ASSERT(!called); + called = true; + if (serialized->resize(length)) { + memcpy(serialized->begin(), bytes, length); + } + } +}; + bool wasm::CompileAndSerialize(const ShareableBytes& bytecode, Bytes* serialized) { MutableCompileArgs compileArgs = js_new(ScriptedCaller()); @@ -459,28 +477,26 @@ bool wasm::CompileAndSerialize(const ShareableBytes& bytecode, return false; } - // The caller has ensured HasCachingSupport(). + // The caller has ensured HasCachingSupport(). Moreover, we want to ensure + // we go straight to tier-2 so that we synchronously call + // JS::OptimizedEncodingListener::storeOptimizedEncoding(). + compileArgs->baselineEnabled = false; compileArgs->ionEnabled = true; + SerializeListener listener(serialized); + UniqueChars error; UniqueCharsVector warnings; - UniqueLinkData linkData; SharedModule module = - CompileBuffer(*compileArgs, bytecode, &error, &warnings, &linkData); + CompileBuffer(*compileArgs, bytecode, &error, &warnings, &listener); if (!module) { fprintf(stderr, "Compilation error: %s\n", error ? error.get() : "oom"); return false; } MOZ_ASSERT(module->code().hasTier(Tier::Serialized)); - - size_t serializedSize = module->serializedSize(*linkData); - if (!serialized->resize(serializedSize)) { - return false; - } - - module->serialize(*linkData, serialized->begin(), serialized->length()); - return true; + MOZ_ASSERT(listener.called); + return !listener.serialized->empty(); } bool wasm::DeserializeModule(JSContext* cx, const Bytes& serialized, From e8a5e4dfbc32c6a08809b8b996053996b499fdde Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Mon, 18 Feb 2019 17:55:43 -0600 Subject: [PATCH 7/8] Bug 1520931 - Baldr: fix implicit constructor warning (r=me) --- js/src/wasm/WasmJS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/wasm/WasmJS.cpp b/js/src/wasm/WasmJS.cpp index a9bed467e256..5e7ad562b0dd 100644 --- a/js/src/wasm/WasmJS.cpp +++ b/js/src/wasm/WasmJS.cpp @@ -459,7 +459,7 @@ struct MOZ_STACK_CLASS SerializeListener : JS::OptimizedEncodingListener { DebugOnly called = false; Bytes* serialized; - SerializeListener(Bytes* serialized) : serialized(serialized) {} + explicit SerializeListener(Bytes* serialized) : serialized(serialized) {} void storeOptimizedEncoding(const uint8_t* bytes, size_t length) override { MOZ_ASSERT(!called); From e7cc92c95a1d1f740e4d3cf0cdf021cb32c059d4 Mon Sep 17 00:00:00 2001 From: sotaro Date: Tue, 19 Feb 2019 09:12:47 +0900 Subject: [PATCH 8/8] Bug 1516834 - Check if CopyData succeeded r=nical When CopyData failed, an image does not have valid data. It should not be used. Differential Revision: https://phabricator.services.mozilla.com/D19746 --- dom/media/VideoFrameContainer.cpp | 12 +++++++----- dom/media/ipc/RemoteVideoDecoder.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dom/media/VideoFrameContainer.cpp b/dom/media/VideoFrameContainer.cpp index 58724ff6b4ad..09b9556db25c 100644 --- a/dom/media/VideoFrameContainer.cpp +++ b/dom/media/VideoFrameContainer.cpp @@ -80,7 +80,7 @@ void VideoFrameContainer::UpdatePrincipalHandleForFrameIDLocked( mFrameIDForPendingPrincipalHandle = aFrameID; } -static void SetImageToBlackPixel(PlanarYCbCrImage* aImage) { +static bool SetImageToBlackPixel(PlanarYCbCrImage* aImage) { uint8_t blackPixel[] = {0x10, 0x80, 0x80}; PlanarYCbCrData data; @@ -89,7 +89,7 @@ static void SetImageToBlackPixel(PlanarYCbCrImage* aImage) { data.mCrChannel = blackPixel + 2; data.mYStride = data.mCbCrStride = 1; data.mPicSize = data.mYSize = data.mCbCrSize = gfx::IntSize(1, 1); - aImage->CopyData(data); + return aImage->CopyData(data); } class VideoFrameContainerInvalidateRunnable : public Runnable { @@ -142,11 +142,13 @@ void VideoFrameContainer::SetCurrentFrames(const VideoSegment& aSegment) { if (frame->GetForceBlack()) { if (!mBlackImage) { - mBlackImage = GetImageContainer()->CreatePlanarYCbCrImage(); - if (mBlackImage) { + RefPtr blackImage = GetImageContainer()->CreatePlanarYCbCrImage(); + if (blackImage) { // Sets the image to a single black pixel, which will be scaled to // fill the rendered size. - SetImageToBlackPixel(mBlackImage->AsPlanarYCbCrImage()); + if (SetImageToBlackPixel(blackImage->AsPlanarYCbCrImage())) { + mBlackImage = blackImage; + } } } if (mBlackImage) { diff --git a/dom/media/ipc/RemoteVideoDecoder.cpp b/dom/media/ipc/RemoteVideoDecoder.cpp index 2be9cc76781f..99dc1880a323 100644 --- a/dom/media/ipc/RemoteVideoDecoder.cpp +++ b/dom/media/ipc/RemoteVideoDecoder.cpp @@ -64,7 +64,8 @@ RefPtr RemoteVideoDecoderChild::DeserializeImage( // images coming from AOMDecoder are RecyclingPlanarYCbCrImages. RefPtr image = new RecyclingPlanarYCbCrImage(mBufferRecycleBin); - image->CopyData(pData); + bool setData = image->CopyData(pData); + MOZ_ASSERT(setData); switch (memOrShmem.type()) { case MemoryOrShmem::Tuintptr_t: @@ -77,6 +78,10 @@ RefPtr RemoteVideoDecoderChild::DeserializeImage( MOZ_ASSERT(false, "Unknown MemoryOrShmem type"); } + if (!setData) { + return nullptr; + } + return image; }