Skip to content

Commit b92aea5

Browse files
DanielRyanSmithDanielRyanSmith
and
DanielRyanSmith
authored
Add specifications for Interop 2025 (#4234)
* Add Interop 2025 * rename Web Compat * add mobile scores url * Add TODO for section height * Add min-heights constant --------- Co-authored-by: DanielRyanSmith <[email protected]>
1 parent 1723707 commit b92aea5

7 files changed

+725
-10
lines changed

webapp/components/interop-dashboard.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class InteropDashboard extends WPTFlags(PolymerElement) {
5252
margin: 0 2em;
5353
display: grid;
5454
grid-template-columns: 9fr 11fr;
55-
grid-template-rows: 0fr 0.55fr 0fr 0fr 1fr;
55+
grid-template-rows: 0fr 0fr 0fr 0fr 1fr;
5656
column-gap: 75px;
5757
grid-template-areas:
5858
"header scores"
@@ -950,7 +950,8 @@ class InteropDashboard extends WPTFlags(PolymerElement) {
950950
}
951951

952952
shouldShowMobileScoresView() {
953-
return this.showMobileScoresView && parseInt(this.year) >= 2024;
953+
const validYears = this.dataManager.getYearProp('validMobileYears');
954+
return this.showMobileScoresView && validYears.includes(this.year);
954955
}
955956

956957
// Check if the table being rendered is the first table.

webapp/components/interop-data-manager.js

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class InteropDataManager {
106106

107107
const yearInfo = paramsByYear[this.year];
108108
const previousYear = String(parseInt(this.year) - 1);
109+
this.validMobileYears = paramsByYear.valid_mobile_years;
109110

110111
// Calc and save investigation scores.
111112
this.investigationScores = yearInfo.investigation_scores;

webapp/components/interop-data.js

+353
Large diffs are not rendered by default.

webapp/components/interop-summary.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ import '../node_modules/@polymer/polymer/lib/elements/dom-if.js';
99
import { html, PolymerElement } from '../node_modules/@polymer/polymer/polymer-element.js';
1010
import {afterNextRender} from '../node_modules/@polymer/polymer/lib/utils/render-status.js';
1111

12+
// This min-height is added to this section to ensure that the section below
13+
// is not moved after the user selects between STABLE and EXPERIMENTAL
14+
// (experimental browser names are longer and add additional lines).
15+
// Different years have different initial heights for these sections.
16+
const SUMMARY_CONTAINER_MIN_HEIGHTS = {
17+
'2021': '275px',
18+
'2022': '470px',
19+
'2023': '470px',
20+
'2024': '380px',
21+
'2025': '380px',
22+
};
23+
24+
1225
class InteropSummary extends PolymerElement {
1326
static get template() {
1427
return html`
@@ -196,13 +209,11 @@ class InteropSummary extends PolymerElement {
196209
}
197210

198211
const summaryDiv = this.shadowRoot.querySelector('.summary-container');
212+
summaryDiv.style.minHeight = SUMMARY_CONTAINER_MIN_HEIGHTS[this.year] || '470px';
199213
// Don't display the interop score for Interop 2021.
200214
if (this.year === '2021') {
201215
const interopDiv = this.shadowRoot.querySelector('#interopSummary');
202216
interopDiv.style.display = 'none';
203-
summaryDiv.style.minHeight = '275px';
204-
} else if (this.year === '2024') {
205-
summaryDiv.style.minHeight = '350px';
206217
}
207218

208219
// The summary score elements are given class names asynchronously,

webapp/interop_handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func interopHandler(w http.ResponseWriter, r *http.Request) {
4343
http.Error(w, err.Error(), http.StatusBadRequest)
4444
return
4545
}
46-
_, isValidMobileYear := validMobileYears[year];
46+
_, isValidMobileYear := validMobileYears[year]
4747
if isMobileView != nil && !isValidMobileYear {
4848
year = defaultRedirectYear
4949
needsRedirect = true

webapp/interop_handler_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func TestInteropHandler_redirectMobile(t *testing.T) {
4343
// 2021 is an invalid interop mobile year and should be redirected.
4444
req := httptest.NewRequest("GET", "/interop-2021?mobile-view", strings.NewReader("{}"))
4545
req = mux.SetURLVars(req, map[string]string{
46-
"name": "interop",
47-
"year": "2021",
46+
"name": "interop",
47+
"year": "2021",
4848
"mobileView": "true",
4949
})
5050

@@ -115,8 +115,8 @@ func TestInteropHandler_mobileSuccess(t *testing.T) {
115115
req := httptest.NewRequest(
116116
"GET", "/interop-"+defaultRedirectYear+"?mobile-view", strings.NewReader("{}"))
117117
req = mux.SetURLVars(req, map[string]string{
118-
"name": "interop",
119-
"year": defaultRedirectYear,
118+
"name": "interop",
119+
"year": defaultRedirectYear,
120120
"mobileView": "true",
121121
})
122122

0 commit comments

Comments
 (0)