Changeset 223006 in webkit
- Timestamp:
- Oct 6, 2017, 3:48:28 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
- 3 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/unit-tests/url-utilities-expected.txt (modified) (21 diffs)
-
LayoutTests/inspector/unit-tests/url-utilities.html (modified) (22 diffs)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (modified) (4 diffs)
-
Source/WebInspectorUI/UserInterface/Base/URLUtilities.js (modified) (3 diffs)
-
Source/WebInspectorUI/UserInterface/Main.html (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Models/Resource.js (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js (modified) (6 diffs)
-
Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.css (copied) (copied from trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css ) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.js (copied) (copied from trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css ) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.css (copied) (copied from trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css ) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js (added)
-
Source/WebInspectorUI/UserInterface/Views/Table.css (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/Variables.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r222999 r223006 1 2017-10-05 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Network Tab - Headers Detail View 4 https://bugs.webkit.org/show_bug.cgi?id=177896 5 <rdar://problem/34071924> 6 7 Reviewed by Devin Rousso. 8 9 * inspector/unit-tests/url-utilities-expected.txt: 10 * inspector/unit-tests/url-utilities.html: 11 Tests for new utility functions. 12 1 13 2017-10-06 Nan Wang <n_wang@apple.com> 2 14 -
trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt
r209143 r223006 13 13 Test Valid: http://example.com 14 14 PASS: scheme should be: 'http' 15 PASS: userinfo should be: 'null' 15 16 PASS: host should be: 'example.com' 16 17 PASS: port should be: 'null' … … 22 23 Test Valid: http://example.com/ 23 24 PASS: scheme should be: 'http' 25 PASS: userinfo should be: 'null' 24 26 PASS: host should be: 'example.com' 25 27 PASS: port should be: 'null' … … 31 33 Test Valid: http://example.com:80/ 32 34 PASS: scheme should be: 'http' 35 PASS: userinfo should be: 'null' 33 36 PASS: host should be: 'example.com' 34 37 PASS: port should be: '80' … … 40 43 Test Valid: http://example.com/path/to/page.html 41 44 PASS: scheme should be: 'http' 45 PASS: userinfo should be: 'null' 42 46 PASS: host should be: 'example.com' 43 47 PASS: port should be: 'null' … … 49 53 Test Valid: http://example.com/path/to/page.html? 50 54 PASS: scheme should be: 'http' 55 PASS: userinfo should be: 'null' 51 56 PASS: host should be: 'example.com' 52 57 PASS: port should be: 'null' … … 58 63 Test Valid: http://example.com/path/to/page.html?a=1 59 64 PASS: scheme should be: 'http' 65 PASS: userinfo should be: 'null' 60 66 PASS: host should be: 'example.com' 61 67 PASS: port should be: 'null' … … 67 73 Test Valid: http://example.com/path/to/page.html?a=1&b=2 68 74 PASS: scheme should be: 'http' 75 PASS: userinfo should be: 'null' 69 76 PASS: host should be: 'example.com' 70 77 PASS: port should be: 'null' … … 76 83 Test Valid: http://example.com/path/to/page.html?a=1&b=2#test 77 84 PASS: scheme should be: 'http' 85 PASS: userinfo should be: 'null' 78 86 PASS: host should be: 'example.com' 79 87 PASS: port should be: 'null' … … 85 93 Test Valid: http://example.com:123/path/to/page.html?a=1&b=2#test 86 94 PASS: scheme should be: 'http' 95 PASS: userinfo should be: 'null' 87 96 PASS: host should be: 'example.com' 88 97 PASS: port should be: '123' … … 94 103 Test Valid: http://example.com/path/to/page.html#test 95 104 PASS: scheme should be: 'http' 105 PASS: userinfo should be: 'null' 96 106 PASS: host should be: 'example.com' 97 107 PASS: port should be: 'null' … … 103 113 Test Valid: http://example.com#alpha/beta 104 114 PASS: scheme should be: 'http' 115 PASS: userinfo should be: 'null' 105 116 PASS: host should be: 'example.com' 106 117 PASS: port should be: 'null' … … 112 123 Test Valid: app-specific://example.com 113 124 PASS: scheme should be: 'app-specific' 125 PASS: userinfo should be: 'null' 114 126 PASS: host should be: 'example.com' 115 127 PASS: port should be: 'null' … … 121 133 Test Valid: http://example 122 134 PASS: scheme should be: 'http' 135 PASS: userinfo should be: 'null' 123 136 PASS: host should be: 'example' 124 137 PASS: port should be: 'null' … … 130 143 Test Valid: http://my.example.com 131 144 PASS: scheme should be: 'http' 145 PASS: userinfo should be: 'null' 132 146 PASS: host should be: 'my.example.com' 133 147 PASS: port should be: 'null' … … 139 153 Test Valid: data:text/plain,test 140 154 PASS: scheme should be: 'data' 155 PASS: userinfo should be: 'null' 141 156 PASS: host should be: 'null' 142 157 PASS: port should be: 'null' … … 164 179 Expected: "http" 165 180 Actual: null 181 PASS: userinfo should be: 'null' 166 182 FAIL: host should be: 'example.com' 167 183 Expected: "example.com" … … 179 195 Expected: "http" 180 196 Actual: null 197 PASS: userinfo should be: 'null' 181 198 FAIL: host should be: 'example.com' 182 199 Expected: "example.com" … … 186 203 Expected: "/" 187 204 Actual: null 205 PASS: queryString should be: 'null' 206 PASS: fragment should be: 'null' 207 PASS: lastPathComponent should be: 'null' 208 209 Test Valid: http://user:pass@example.com/ 210 PASS: scheme should be: 'http' 211 PASS: userinfo should be: 'user:pass' 212 PASS: host should be: 'example.com' 213 PASS: port should be: 'null' 214 PASS: path should be: '/' 188 215 PASS: queryString should be: 'null' 189 216 PASS: fragment should be: 'null' … … 194 221 Expected: "http" 195 222 Actual: null 223 PASS: userinfo should be: 'null' 196 224 FAIL: host should be: 'example.com' 197 225 Expected: "example.com" … … 207 235 Test Valid: http://example.com?key=alpha/beta 208 236 PASS: scheme should be: 'http' 237 PASS: userinfo should be: 'null' 209 238 FAIL: host should be: 'example.com' 210 239 Expected: "example.com" … … 307 336 PASS: data should be: 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' 308 337 338 -- Running test case: WI.h2Authority 339 PASS: HTTP/2 :authority of 'http://example.com' should be 'example.com'. 340 PASS: HTTP/2 :authority of 'https://example.com' should be 'example.com'. 341 PASS: HTTP/2 :authority of 'ftp://example.com' should be 'example.com'. 342 PASS: HTTP/2 :authority of 'http://example.com/foo' should be 'example.com'. 343 PASS: HTTP/2 :authority of 'https://example.com/foo' should be 'example.com'. 344 PASS: HTTP/2 :authority of 'ftp://example.com/foo' should be 'example.com'. 345 PASS: HTTP/2 :authority of 'http://example.com:123' should be 'example.com:123'. 346 PASS: HTTP/2 :authority of 'https://example.com:123' should be 'example.com:123'. 347 PASS: HTTP/2 :authority of 'ftp://example.com:123' should be 'example.com:123'. 348 PASS: HTTP/2 :authority of 'ftp://user:pass@example.com/foo' should be 'user:pass@example.com'. 349 PASS: HTTP/2 :authority of 'http://user:pass@example.com/foo' should be 'example.com'. 350 PASS: HTTP/2 :authority of 'https://user:pass@example.com/foo' should be 'example.com'. 351 PASS: HTTP/2 :authority of 'ftp://user:pass@example.com:123/foo' should be 'user:pass@example.com:123'. 352 PASS: HTTP/2 :authority of 'http://user:pass@example.com:123/foo' should be 'example.com:123'. 353 PASS: HTTP/2 :authority of 'https://user:pass@example.com:123/foo' should be 'example.com:123'. 354 355 -- Running test case: WI.h2Path 356 PASS: HTTP/2 :path of 'http://example.com' should be '/'. 357 PASS: HTTP/2 :path of 'https://example.com' should be '/'. 358 PASS: HTTP/2 :path of 'ftp://example.com' should be ''. 359 PASS: HTTP/2 :path of 'http://example.com/foo' should be '/foo'. 360 PASS: HTTP/2 :path of 'https://example.com/foo' should be '/foo'. 361 PASS: HTTP/2 :path of 'ftp://example.com/foo' should be '/foo'. 362 PASS: HTTP/2 :path of 'http://example.com/foo#hash' should be '/foo'. 363 PASS: HTTP/2 :path of 'https://example.com/foo#hash' should be '/foo'. 364 PASS: HTTP/2 :path of 'ftp://example.com/foo#hash' should be '/foo'. 365 PASS: HTTP/2 :path of 'http://example.com/foo/bar.js' should be '/foo/bar.js'. 366 PASS: HTTP/2 :path of 'https://example.com/foo/bar.js' should be '/foo/bar.js'. 367 PASS: HTTP/2 :path of 'ftp://example.com/foo/bar.js' should be '/foo/bar.js'. 368 PASS: HTTP/2 :path of 'http://example.com/foo/bar.js#hash' should be '/foo/bar.js'. 369 PASS: HTTP/2 :path of 'https://example.com/foo/bar.js#hash' should be '/foo/bar.js'. 370 PASS: HTTP/2 :path of 'ftp://example.com/foo/bar.js#hash' should be '/foo/bar.js'. 371 PASS: HTTP/2 :path of 'http://example.com/?t=1' should be '/?t=1'. 372 PASS: HTTP/2 :path of 'https://example.com/?t=1' should be '/?t=1'. 373 PASS: HTTP/2 :path of 'ftp://example.com/?t=1' should be '/?t=1'. 374 PASS: HTTP/2 :path of 'http://example.com/foo/bar.js?t=1' should be '/foo/bar.js?t=1'. 375 PASS: HTTP/2 :path of 'https://example.com/foo/bar.js?t=1' should be '/foo/bar.js?t=1'. 376 PASS: HTTP/2 :path of 'ftp://example.com/foo/bar.js?t=1' should be '/foo/bar.js?t=1'. 377 PASS: HTTP/2 :path of 'http://example.com/foo/bar.js?t=1#hash' should be '/foo/bar.js?t=1'. 378 PASS: HTTP/2 :path of 'https://example.com/foo/bar.js?t=1#hash' should be '/foo/bar.js?t=1'. 379 PASS: HTTP/2 :path of 'ftp://example.com/foo/bar.js?t=1#hash' should be '/foo/bar.js?t=1'. 380 -
trunk/LayoutTests/inspector/unit-tests/url-utilities.html
r209143 r223006 28 28 InspectorTest.log("Test Valid: " + url); 29 29 30 let {scheme: expectedScheme, host: expectedHost, port: expectedPort, path: expectedPath, queryString: expectedQueryString, fragment: expectedFragment, lastPathComponent: expectedLastPathComponent} = expected;31 let {scheme: actualScheme, host: actualHost, port: actualPort, path: actualPath, queryString: actualQueryString, fragment: actualFragment, lastPathComponent: actualLastPathComponent} = parseURL(url);30 let {scheme: expectedScheme, userinfo: expectedUserInfo, host: expectedHost, port: expectedPort, path: expectedPath, queryString: expectedQueryString, fragment: expectedFragment, lastPathComponent: expectedLastPathComponent} = expected; 31 let {scheme: actualScheme, userinfo: actualUserInfo, host: actualHost, port: actualPort, path: actualPath, queryString: actualQueryString, fragment: actualFragment, lastPathComponent: actualLastPathComponent} = parseURL(url); 32 32 33 33 InspectorTest.expectEqual(actualScheme, expectedScheme, `scheme should be: '${expectedScheme}'`); 34 InspectorTest.expectEqual(actualUserInfo, expectedUserInfo, `userinfo should be: '${expectedUserInfo}'`); 34 35 InspectorTest.expectEqual(actualHost, expectedHost, `host should be: '${expectedHost}'`); 35 36 InspectorTest.expectEqual(actualPort, expectedPort, `port should be: '${expectedPort}'`); … … 45 46 testValid("http://example.com", { 46 47 scheme: "http", 48 userinfo: null, 47 49 host: "example.com", 48 50 port: null, … … 55 57 testValid("http://example.com/", { 56 58 scheme: "http", 59 userinfo: null, 57 60 host: "example.com", 58 61 port: null, … … 65 68 testValid("http://example.com:80/", { 66 69 scheme: "http", 70 userinfo: null, 67 71 host: "example.com", 68 72 port: 80, … … 75 79 testValid("http://example.com/path/to/page.html", { 76 80 scheme: "http", 81 userinfo: null, 77 82 host: "example.com", 78 83 port: null, … … 85 90 testValid("http://example.com/path/to/page.html?", { 86 91 scheme: "http", 92 userinfo: null, 87 93 host: "example.com", 88 94 port: null, … … 95 101 testValid("http://example.com/path/to/page.html?a=1", { 96 102 scheme: "http", 103 userinfo: null, 97 104 host: "example.com", 98 105 port: null, … … 105 112 testValid("http://example.com/path/to/page.html?a=1&b=2", { 106 113 scheme: "http", 114 userinfo: null, 107 115 host: "example.com", 108 116 port: null, … … 115 123 testValid("http://example.com/path/to/page.html?a=1&b=2#test", { 116 124 scheme: "http", 125 userinfo: null, 117 126 host: "example.com", 118 127 port: null, … … 125 134 testValid("http://example.com:123/path/to/page.html?a=1&b=2#test", { 126 135 scheme: "http", 136 userinfo: null, 127 137 host: "example.com", 128 138 port: 123, … … 135 145 testValid("http://example.com/path/to/page.html#test", { 136 146 scheme: "http", 147 userinfo: null, 137 148 host: "example.com", 138 149 port: null, … … 145 156 testValid("http://example.com#alpha/beta", { 146 157 scheme: "http", 158 userinfo: null, 147 159 host: "example.com", 148 160 port: null, … … 155 167 testValid("app-specific://example.com", { 156 168 scheme: "app-specific", 169 userinfo: null, 157 170 host: "example.com", 158 171 port: null, … … 165 178 testValid("http://example", { 166 179 scheme: "http", 180 userinfo: null, 167 181 host: "example", 168 182 port: null, … … 175 189 testValid("http://my.example.com", { 176 190 scheme: "http", 191 userinfo: null, 177 192 host: "my.example.com", 178 193 port: null, … … 186 201 testValid("data:text/plain,test", { 187 202 scheme: "data", 203 userinfo: null, 188 204 host: null, 189 205 port: null, … … 203 219 testValid("http:example.com/", { 204 220 scheme: "http", 221 userinfo: null, 205 222 host: "example.com", 206 223 port: null, … … 213 230 testValid("http:/example.com/", { 214 231 scheme: "http", 232 userinfo: null, 233 host: "example.com", 234 port: null, 235 path: "/", 236 queryString: null, 237 fragment: null, 238 lastPathComponent: null, 239 }); 240 241 testValid("http://user:pass@example.com/", { 242 scheme: "http", 243 userinfo: "user:pass", 215 244 host: "example.com", 216 245 port: null, … … 223 252 testValid("http://user@pass:example.com/", { 224 253 scheme: "http", 254 userinfo: null, 225 255 host: "example.com", 226 256 port: null, … … 233 263 testValid("http://example.com?key=alpha/beta", { 234 264 scheme: "http", 265 userinfo: null, 235 266 host: "example.com", 236 267 port: null, … … 244 275 } 245 276 }); 246 247 277 248 278 suite.addTestCase({ … … 356 386 }); 357 387 388 suite.addTestCase({ 389 name: "WI.h2Authority", 390 test() { 391 function test(url, expected) { 392 let components = parseURL(url); 393 InspectorTest.expectEqual(WI.h2Authority(components), expected, `HTTP/2 :authority of '${url}' should be '${expected}'.`); 394 } 395 396 test("http://example.com", "example.com"); 397 test("https://example.com", "example.com"); 398 test("ftp://example.com", "example.com"); 399 400 test("http://example.com/foo", "example.com"); 401 test("https://example.com/foo", "example.com"); 402 test("ftp://example.com/foo", "example.com"); 403 404 test("http://example.com:123", "example.com:123"); 405 test("https://example.com:123", "example.com:123"); 406 test("ftp://example.com:123", "example.com:123"); 407 408 test("ftp://user:pass@example.com/foo", "user:pass@example.com"); 409 test("http://user:pass@example.com/foo", "example.com"); 410 test("https://user:pass@example.com/foo", "example.com"); 411 412 test("ftp://user:pass@example.com:123/foo", "user:pass@example.com:123"); 413 test("http://user:pass@example.com:123/foo", "example.com:123"); 414 test("https://user:pass@example.com:123/foo", "example.com:123"); 415 416 return true; 417 } 418 }); 419 420 suite.addTestCase({ 421 name: "WI.h2Path", 422 test() { 423 function test(url, expected) { 424 let components = parseURL(url); 425 InspectorTest.expectEqual(WI.h2Path(components), expected, `HTTP/2 :path of '${url}' should be '${expected}'.`); 426 } 427 428 test("http://example.com", "/"); 429 test("https://example.com", "/"); 430 test("ftp://example.com", ""); 431 432 test("http://example.com/foo", "/foo"); 433 test("https://example.com/foo", "/foo"); 434 test("ftp://example.com/foo", "/foo"); 435 test("http://example.com/foo#hash", "/foo"); 436 test("https://example.com/foo#hash", "/foo"); 437 test("ftp://example.com/foo#hash", "/foo"); 438 439 test("http://example.com/foo/bar.js", "/foo/bar.js"); 440 test("https://example.com/foo/bar.js", "/foo/bar.js"); 441 test("ftp://example.com/foo/bar.js", "/foo/bar.js"); 442 test("http://example.com/foo/bar.js#hash", "/foo/bar.js"); 443 test("https://example.com/foo/bar.js#hash", "/foo/bar.js"); 444 test("ftp://example.com/foo/bar.js#hash", "/foo/bar.js"); 445 446 test("http://example.com/?t=1", "/?t=1"); 447 test("https://example.com/?t=1", "/?t=1"); 448 test("ftp://example.com/?t=1", "/?t=1"); 449 450 test("http://example.com/foo/bar.js?t=1", "/foo/bar.js?t=1"); 451 test("https://example.com/foo/bar.js?t=1", "/foo/bar.js?t=1"); 452 test("ftp://example.com/foo/bar.js?t=1", "/foo/bar.js?t=1"); 453 test("http://example.com/foo/bar.js?t=1#hash", "/foo/bar.js?t=1"); 454 test("https://example.com/foo/bar.js?t=1#hash", "/foo/bar.js?t=1"); 455 test("ftp://example.com/foo/bar.js?t=1#hash", "/foo/bar.js?t=1"); 456 457 return true; 458 } 459 }); 460 358 461 suite.runTestCasesAndFinish(); 359 462 } -
trunk/Source/WebInspectorUI/ChangeLog
r222988 r223006 1 2017-10-06 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Network Tab - Headers Detail View 4 https://bugs.webkit.org/show_bug.cgi?id=177896 5 <rdar://problem/34071924> 6 7 Reviewed by Devin Rousso. 8 9 * Localizations/en.lproj/localizedStrings.js: 10 * UserInterface/Main.html: 11 New resources and strings. 12 13 * UserInterface/Base/URLUtilities.js: 14 (parseURL): 15 (WI.h2Authority): 16 (WI.h2Path): 17 Utility methods to get the :authority and :path pseudo-headers from a URL. 18 This required adding user info (user:pass@) support to URL parsing. 19 20 * UserInterface/Views/NetworkTabContentView.js: 21 (WI.NetworkTabContentView): 22 * UserInterface/Views/NetworkTableContentView.js: 23 (WI.NetworkTableContentView.prototype.get navigationItems): 24 (WI.NetworkTableContentView.prototype.get filterNavigationItems): 25 Move the NetworkTab's filter controls to the left. Since these are not 26 dynamic just vend them from the TableContentView and place them in the 27 navigation bar. 28 29 * UserInterface/Models/Resource.js: 30 (WI.Resource.prototype.updateWithMetrics): 31 New event whenever metrics change. This is the first event that will allow 32 a client to react to a resource.protocol change. 33 34 * UserInterface/Views/NetworkResourceDetailView.css: 35 (.content-view.resource-details): 36 Base styles for the sub detail views. 37 38 * UserInterface/Views/NetworkResourceDetailView.js: 39 (WI.NetworkResourceDetailView): 40 (WI.NetworkResourceDetailView.prototype.headersContentViewGoToRequestData): 41 (WI.NetworkResourceDetailView.prototype.initialLayout): 42 (WI.NetworkResourceDetailView.prototype._showPreferredContentView): 43 (WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem): 44 Create a Header view and provide a way to switch to a particular view. This wil 45 be useful to jump from the Header's Request Data directly to the Preview's 46 Request ContentView. 47 48 * UserInterface/Views/ResourceDetailsSection.css: 49 (.resource-details > section): 50 (.resource-details > section > .title): 51 (.resource-details > section > .details): 52 (.resource-details > section > .details > p): 53 (.resource-details > section.incomplete > .details): 54 * UserInterface/Views/ResourceDetailsSection.js: 55 (WI.ResourceDetailsSection): 56 (WI.ResourceDetailsSection.prototype.get element): 57 (WI.ResourceDetailsSection.prototype.get titleElement): 58 (WI.ResourceDetailsSection.prototype.get detailsElement): 59 (WI.ResourceDetailsSection.prototype.toggleIncomplete): 60 (WI.ResourceDetailsSection.prototype.toggleError): 61 Simple sections with a title and details div with a border. 62 It may be common to have an incomplete load / error so this 63 provides some APIs and styles for sections marked incomplete 64 or with errors. 65 66 * UserInterface/Views/ResourceHeadersContentView.css: 67 (.resource-headers > section > .details): 68 (.resource-headers > section.headers > .details): 69 (.resource-headers > section.error > .details): 70 (.resource-headers > section.error .key): 71 Style the left border different colors for different sections or cases. 72 73 (.resource-headers .details): 74 (.resource-headers .details .pair): 75 (.resource-headers .details .key): 76 (.resource-headers .value): 77 (.resource-headers .header > .key): 78 (.resource-headers .h1-status > .key): 79 (.resource-headers .h2-pseudo-header > .key): 80 Wrapped text for key/value pairs and different colors for different 81 sections or cases. 82 83 (.resource-headers .go-to-arrow): 84 Go-to arrow styles for a request data section. 85 86 * UserInterface/Views/ResourceHeadersContentView.js: Added. 87 (WI.ResourceHeadersContentView): 88 (WI.ResourceHeadersContentView.prototype.initialLayout): 89 (WI.ResourceHeadersContentView.prototype.layout): 90 (WI.ResourceHeadersContentView.prototype._incompleteSectionWithMessage): 91 (WI.ResourceHeadersContentView.prototype._incompleteSectionWithLoadingIndicator): 92 (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): 93 (WI.ResourceHeadersContentView.prototype._responseSourceDisplayString): 94 (WI.ResourceHeadersContentView.prototype._refreshSummarySection): 95 (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection): 96 (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection): 97 (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection): 98 (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection): 99 (WI.ResourceHeadersContentView.prototype._resourceMetricsDidChange): 100 (WI.ResourceHeadersContentView.prototype._resourceRequestHeadersDidChange): 101 (WI.ResourceHeadersContentView.prototype._resourceResponseReceived): 102 (WI.ResourceHeadersContentView.prototype._goToRequestDataClicked): 103 Summary, Request, Response, Query String, and Request Data sections. 104 The sections refresh as data becomes available. 105 106 * UserInterface/Views/Table.css: 107 (.table): 108 These variables are already defined globally. 109 110 * UserInterface/Views/Variables.css: 111 (:root): 112 New variables for the colors we use. They closely match, and are 113 sometimes identical to ones used in Timelines / Memory views. 114 1 115 2017-10-06 Joseph Pecoraro <pecoraro@apple.com> 2 116 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r222868 r223006 296 296 localizedStrings["Disable paint flashing"] = "Disable paint flashing"; 297 297 localizedStrings["Disabled"] = "Disabled"; 298 localizedStrings["Disk Cache"] = "Disk Cache"; 298 299 localizedStrings["Display"] = "Display"; 299 300 localizedStrings["Do not fade unexecuted code"] = "Do not fade unexecuted code"; … … 562 563 localizedStrings["Medium"] = "Medium"; 563 564 localizedStrings["Memory"] = "Memory"; 565 localizedStrings["Memory Cache"] = "Memory Cache"; 564 566 localizedStrings["Memory usage of this canvas"] = "Memory usage of this canvas"; 565 567 localizedStrings["Memory: %s"] = "Memory: %s"; … … 606 608 localizedStrings["No matching ARIA role"] = "No matching ARIA role"; 607 609 localizedStrings["No preview available"] = "No preview available"; 610 localizedStrings["No request headers"] = "No request headers"; 611 localizedStrings["No request, served from the disk cache."] = "No request, served from the disk cache."; 612 localizedStrings["No request, served from the memory cache."] = "No request, served from the memory cache."; 613 localizedStrings["No response headers"] = "No response headers"; 608 614 localizedStrings["Node"] = "Node"; 609 615 localizedStrings["Node Removed"] = "Node Removed"; … … 877 883 localizedStrings["Stylesheets"] = "Stylesheets"; 878 884 localizedStrings["Subtree Modified"] = "Subtree Modified"; 885 localizedStrings["Summary"] = "Summary"; 879 886 localizedStrings["Tab width:"] = "Tab width:"; 880 887 localizedStrings["Tabs"] = "Tabs"; -
trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js
r222216 r223006 97 97 98 98 if (url.startsWith("data:")) 99 return {scheme: "data", host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null};100 101 var match = url.match(/^(?<scheme>[^\/:]+):\/\/(?<host>[^\/#:]*)(?::(?<port>[\d]+))?(?:(?<path>\/[^#]*)?(?:#(?<fragment>.*))?)?$/i);99 return {scheme: "data", userinfo: null, host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null}; 100 101 let match = url.match(/^(?<scheme>[^\/:]+):\/\/(?:(?<userinfo>[^#@\/]+)@)?(?<host>[^\/#:]*)(?::(?<port>[\d]+))?(?:(?<path>\/[^#]*)?(?:#(?<fragment>.*))?)?$/i); 102 102 if (!match) 103 return {scheme: null, host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null}; 104 105 var scheme = match.groups.scheme.toLowerCase(); 106 var host = match.groups.host.toLowerCase(); 107 var port = Number(match.groups.port) || null; 108 var wholePath = match.groups.path || null; 109 var fragment = match.groups.fragment || null; 110 var path = wholePath; 111 var queryString = null; 103 return {scheme: null, userinfo: null, host: null, port: null, path: null, queryString: null, fragment: null, lastPathComponent: null}; 104 105 let scheme = match.groups.scheme.toLowerCase(); 106 let userinfo = match.groups.userinfo || null; 107 let host = match.groups.host.toLowerCase(); 108 let port = Number(match.groups.port) || null; 109 let wholePath = match.groups.path || null; 110 let fragment = match.groups.fragment || null; 111 let path = wholePath; 112 let queryString = null; 112 113 113 114 // Split the path and the query string. 114 115 if (wholePath) { 115 varindexOfQuery = wholePath.indexOf("?");116 let indexOfQuery = wholePath.indexOf("?"); 116 117 if (indexOfQuery !== -1) { 117 118 path = wholePath.substring(0, indexOfQuery); … … 122 123 123 124 // Find last path component. 124 varlastPathComponent = null;125 let lastPathComponent = null; 125 126 if (path && path !== "/") { 126 127 // Skip the trailing slash if there is one. 127 varendOffset = path[path.length - 1] === "/" ? 1 : 0;128 varlastSlashIndex = path.lastIndexOf("/", path.length - 1 - endOffset);128 let endOffset = path[path.length - 1] === "/" ? 1 : 0; 129 let lastSlashIndex = path.lastIndexOf("/", path.length - 1 - endOffset); 129 130 if (lastSlashIndex !== -1) 130 131 lastPathComponent = path.substring(lastSlashIndex + 1, path.length - endOffset); 131 132 } 132 133 133 return {scheme, host, port, path, queryString, fragment, lastPathComponent};134 return {scheme, userinfo, host, port, path, queryString, fragment, lastPathComponent}; 134 135 } 135 136 … … 264 265 return host; 265 266 }; 267 268 // https://tools.ietf.org/html/rfc7540#section-8.1.2.3 269 WI.h2Authority = function(components) 270 { 271 let {scheme, userinfo, host, port} = components; 272 let result = host || ""; 273 274 // The authority MUST NOT include the deprecated "userinfo" 275 // subcomponent for "http" or "https" schemed URIs. 276 if (userinfo && (scheme !== "http" && scheme !== "https")) 277 result = userinfo + "@" + result; 278 if (port) 279 result += ":" + port; 280 281 return result; 282 }; 283 284 // https://tools.ietf.org/html/rfc7540#section-8.1.2.3 285 WI.h2Path = function(components) 286 { 287 let {scheme, path, queryString} = components; 288 let result = path || ""; 289 290 // The ":path" pseudo-header field includes the path and query parts 291 // of the target URI. [...] This pseudo-header field MUST NOT be empty 292 // for "http" or "https" URIs; "http" or "https" URIs that do not contain 293 // a path component MUST include a value of '/'. 294 if (!path && (scheme === "http" || scheme === "https")) 295 result = "/"; 296 if (queryString) 297 result += "?" + queryString; 298 299 return result; 300 }; -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r222959 r223006 152 152 <link rel="stylesheet" href="Views/RenderingFrameTimelineView.css"> 153 153 <link rel="stylesheet" href="Views/Resizer.css"> 154 <link rel="stylesheet" href="Views/ResourceDetailsSection.css"> 154 155 <link rel="stylesheet" href="Views/ResourceDetailsSidebarPanel.css"> 156 <link rel="stylesheet" href="Views/ResourceHeadersContentView.css"> 155 157 <link rel="stylesheet" href="Views/ResourceIcons.css"> 156 158 <link rel="stylesheet" href="Views/ResourceSidebarPanel.css"> … … 687 689 <script src="Views/ResourceClusterContentView.js"></script> 688 690 <script src="Views/ResourceCollectionContentView.js"></script> 691 <script src="Views/ResourceDetailsSection.js"></script> 689 692 <script src="Views/ResourceDetailsSidebarPanel.js"></script> 693 <script src="Views/ResourceHeadersContentView.js"></script> 690 694 <script src="Views/ResourceSidebarPanel.js"></script> 691 695 <script src="Views/ResourceTimelineDataGridNode.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
r222762 r223006 722 722 this.dispatchEventToListeners(WI.Resource.Event.TransferSizeDidChange); 723 723 } 724 725 this.dispatchEventToListeners(WI.Resource.Event.MetricsDidChange); 724 726 } 725 727 … … 1006 1008 TransferSizeDidChange: "resource-transfer-size-did-change", 1007 1009 CacheStatusDidChange: "resource-cached-did-change", 1010 MetricsDidChange: "resource-metrics-did-change", 1008 1011 InitiatedResourcesDidChange: "resource-initiated-resources-did-change", 1009 1012 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css
r222868 r223006 72 72 bottom: 0; 73 73 } 74 75 .content-view.resource-details { 76 position: absolute; 77 top: 0; 78 left: 0; 79 right: 0; 80 bottom: 0; 81 82 padding: 0 20px 20px; 83 overflow: scroll; 84 85 -webkit-user-select: text; 86 white-space: nowrap; 87 } -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js
r222868 r223006 38 38 39 39 this._contentBrowser = null; 40 this._resourceContentView = null; 40 41 this._headersContentView = null; 41 42 this._cookiesContentView = null; … … 69 70 } 70 71 72 // ResourceHeadersContentView delegate 73 74 headersContentViewGoToRequestData(headersContentView) 75 { 76 this._contentBrowser.navigationBar.selectedNavigationItem = this._previewNavigationItem; 77 78 this._resourceContentView.showRequest(); 79 } 80 71 81 // Protected 72 82 … … 84 94 const disableFindBanner = false; 85 95 this._contentBrowser = new WI.ContentBrowser(null, this, disableBackForward, disableFindBanner, contentViewNavigationItemsFlexItem, contentViewNavigationItemsGroup); 96 97 this._previewNavigationItem = new WI.RadioButtonNavigationItem("preview", WI.UIString("Preview")); 98 this._headersNavigationItem = new WI.RadioButtonNavigationItem("headers", WI.UIString("Headers")); 99 this._cookiesNavigationItem = new WI.RadioButtonNavigationItem("cookies", WI.UIString("Cookies")); 100 this._timingNavigationItem = new WI.RadioButtonNavigationItem("timing", WI.UIString("Timing")); 101 this._detailsNavigationItem = new WI.RadioButtonNavigationItem("details", WI.UIString("Details")); 86 102 87 103 // Insert all of our custom navigation items at the start of the ContentBrowser's NavigationBar. … … 89 105 this._contentBrowser.navigationBar.insertNavigationItem(closeNavigationItem, index++); 90 106 this._contentBrowser.navigationBar.insertNavigationItem(new WI.FlexibleSpaceNavigationItem, index++); 91 this._contentBrowser.navigationBar.insertNavigationItem( new WI.RadioButtonNavigationItem("preview", WI.UIString("Preview")), index++);92 this._contentBrowser.navigationBar.insertNavigationItem( new WI.RadioButtonNavigationItem("headers", WI.UIString("Headers")), index++);93 this._contentBrowser.navigationBar.insertNavigationItem( new WI.RadioButtonNavigationItem("cookies", WI.UIString("Cookies")), index++);94 this._contentBrowser.navigationBar.insertNavigationItem( new WI.RadioButtonNavigationItem("timing", WI.UIString("Timing")), index++);95 this._contentBrowser.navigationBar.insertNavigationItem( new WI.RadioButtonNavigationItem("details", WI.UIString("Details")), index++);107 this._contentBrowser.navigationBar.insertNavigationItem(this._previewNavigationItem, index++); 108 this._contentBrowser.navigationBar.insertNavigationItem(this._headersNavigationItem, index++); 109 this._contentBrowser.navigationBar.insertNavigationItem(this._cookiesNavigationItem, index++); 110 this._contentBrowser.navigationBar.insertNavigationItem(this._timingNavigationItem, index++); 111 this._contentBrowser.navigationBar.insertNavigationItem(this._detailsNavigationItem, index++); 96 112 this._contentBrowser.navigationBar.addEventListener(WI.NavigationBar.Event.NavigationItemSelected, this._navigationItemSelected, this); 97 113 … … 112 128 continue; 113 129 130 if (navigationItem !== this._previewNavigationItem 131 && navigationItem !== this._headersNavigationItem 132 && navigationItem !== this._cookiesNavigationItem 133 && navigationItem !== this._timingNavigationItem 134 && navigationItem !== this._detailsNavigationItem) 135 continue; 136 114 137 if (!firstNavigationItem) 115 138 firstNavigationItem = navigationItem; … … 129 152 switch (navigationItem.identifier) { 130 153 case "preview": 131 this._contentBrowser.showContentViewForRepresentedObject(this._resource); 154 if (!this._resourceContentView) 155 this._resourceContentView = this._contentBrowser.showContentViewForRepresentedObject(this._resource); 156 this._contentBrowser.showContentView(this._resourceContentView); 132 157 break; 133 158 case "headers": 134 // FIXME: Provide a Resource Headers View.135 159 if (!this._headersContentView) 136 this._headersContentView = new WI. DebugContentView("Headers");160 this._headersContentView = new WI.ResourceHeadersContentView(this._resource, this); 137 161 this._contentBrowser.showContentView(this._headersContentView); 138 162 break; -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
r222470 r223006 39 39 this._contentBrowser = new WI.ContentBrowser(null, this, disableBackForward, disableFindBanner); 40 40 this._contentBrowser.showContentView(this._networkTableContentView); 41 42 let filterNavigationItems = this._networkTableContentView.filterNavigationItems; 43 for (let i = 0; i < filterNavigationItems.length; ++i) 44 this._contentBrowser.navigationBar.insertNavigationItem(filterNavigationItems[i], i); 41 45 42 46 this.addSubview(this._contentBrowser); -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
r222988 r223006 134 134 get navigationItems() 135 135 { 136 let items = [this._typeFilterScopeBar]; 137 136 let items = []; 138 137 if (this._disableResourceCacheNavigationItem) 139 138 items.push(this._disableResourceCacheNavigationItem); 140 139 items.push(this._clearNetworkItemsNavigationItem); 141 142 140 return items; 141 } 142 143 get filterNavigationItems() 144 { 145 return [this._typeFilterScopeBar]; 143 146 } 144 147 -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.css
r223005 r223006 24 24 */ 25 25 26 .network-resource-detail { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 bottom: 0; 32 /* left or right set by NetworkTableView on display / resize */ 33 z-index: 10; 34 background-color: white; 26 .resource-details > section { 27 padding-top: 8px; 35 28 } 36 29 37 .network-resource-detail .navigation-bar { 38 position: -webkit-sticky; 39 top: 0; 40 z-index: 1; 30 .resource-details > section > .title { 31 margin: 10px 0; 41 32 } 42 33 43 .network-resource-detail .item.close > .glyph { 44 border-radius: 2px; 45 padding: 2px; 46 background: white; 34 .resource-details > section > .details { 35 -webkit-margin-start: 10px; 47 36 } 48 37 49 .network-resource-detail .item.close > .glyph:hover { 50 background-color: var(--button-background-color-hover); 38 body[dir=ltr] .resource-details > section > .details { 39 border-left: 2px solid var(--border-color); 40 } 41 42 body[dir=rtl] .resource-details > section > .details { 43 border-right: 2px solid var(--border-color); 51 44 } 52 45 53 .network-resource-detail .item.close > .glyph:active { 54 background-color: var(--button-background-color-pressed); 46 .resource-details > section > .details > p { 47 margin: 0; 48 padding: 2px 0; 49 -webkit-padding-start: 7px; 55 50 } 56 51 57 . network .network-resource-detail .navigation-bar .item.radio.button.text-only{58 color: inherit;59 b ackground-color: inherit;52 .resource-details > section.incomplete > .details { 53 color: var(--console-secondary-text-color) !important; 54 border-color: var(--console-secondary-text-color) !important; 60 55 } 61 62 .network .network-resource-detail .navigation-bar .item.radio.button.text-only.selected {63 color: var(--selected-background-color);64 background-color: white;65 }66 67 .network-resource-detail > .content-browser {68 position: absolute;69 top: 0;70 left: 0;71 right: 0;72 bottom: 0;73 } -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.js
r223005 r223006 24 24 */ 25 25 26 .network-resource-detail { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 bottom: 0; 32 /* left or right set by NetworkTableView on display / resize */ 33 z-index: 10; 34 background-color: white; 26 WI.ResourceDetailsSection = class ResourceDetailsSection 27 { 28 constructor(title, className) 29 { 30 this._element = document.createElement("section"); 31 if (className) 32 this._element.className = className; 33 34 this._titleElement = this._element.appendChild(document.createElement("div")); 35 this._titleElement.className = "title"; 36 this._titleElement.textContent = title; 37 38 this._detailsElement = this._element.appendChild(document.createElement("div")); 39 this._detailsElement.className = "details"; 40 } 41 42 // Public 43 44 get element() { return this._element; } 45 get titleElement() { return this._titleElement; } 46 get detailsElement() { return this._detailsElement; } 47 48 toggleIncomplete(isIncomplete) 49 { 50 console.assert(typeof isIncomplete === "boolean"); 51 this.element.classList.toggle("incomplete", isIncomplete); 52 } 53 54 toggleError(isError) 55 { 56 console.assert(typeof isError === "boolean"); 57 this.element.classList.toggle("error", isError); 58 } 35 59 } 36 37 .network-resource-detail .navigation-bar {38 position: -webkit-sticky;39 top: 0;40 z-index: 1;41 }42 43 .network-resource-detail .item.close > .glyph {44 border-radius: 2px;45 padding: 2px;46 background: white;47 }48 49 .network-resource-detail .item.close > .glyph:hover {50 background-color: var(--button-background-color-hover);51 }52 53 .network-resource-detail .item.close > .glyph:active {54 background-color: var(--button-background-color-pressed);55 }56 57 .network .network-resource-detail .navigation-bar .item.radio.button.text-only {58 color: inherit;59 background-color: inherit;60 }61 62 .network .network-resource-detail .navigation-bar .item.radio.button.text-only.selected {63 color: var(--selected-background-color);64 background-color: white;65 }66 67 .network-resource-detail > .content-browser {68 position: absolute;69 top: 0;70 left: 0;71 right: 0;72 bottom: 0;73 } -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.css
r223005 r223006 24 24 */ 25 25 26 .network-resource-detail { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 bottom: 0; 32 /* left or right set by NetworkTableView on display / resize */ 33 z-index: 10; 34 background-color: white; 26 body[dir] .resource-headers > section > .details { 27 border-color: var(--network-system-color); 35 28 } 36 29 37 .network-resource-detail .navigation-bar { 38 position: -webkit-sticky; 39 top: 0; 40 z-index: 1; 30 body[dir] .resource-headers > section.headers > .details { 31 border-color: var(--network-header-color); 41 32 } 42 33 43 .network-resource-detail .item.close > .glyph { 44 border-radius: 2px; 45 padding: 2px; 46 background: white; 34 body[dir] .resource-headers > section.error > .details { 35 border-color: var(--network-error-color); 47 36 } 48 37 49 . network-resource-detail .item.close > .glyph:hover{50 background-color: var(--button-background-color-hover);38 .resource-headers > section.error .key { 39 color: var(--network-error-color); 51 40 } 52 41 53 .network-resource-detail .item.close > .glyph:active { 54 background-color: var(--button-background-color-pressed); 42 .resource-headers .details { 43 white-space: normal; 44 word-break: break-all; 55 45 } 56 46 57 . network .network-resource-detail .navigation-bar .item.radio.button.text-only{58 color: inherit;59 background-color: inherit;47 .resource-headers .details .pair { 48 --resource-headers-value-indent: 15px; 49 -webkit-margin-start: var(--resource-headers-value-indent); 60 50 } 61 51 62 .network .network-resource-detail .navigation-bar .item.radio.button.text-only.selected{63 color: var(--selected-background-color);64 background-color: white;52 body[dir=rtl] .resource-headers .details .pair { 53 /* Don't include indents in RTL */ 54 --resource-headers-value-indent: 0px; 65 55 } 66 56 67 .network-resource-detail > .content-browser { 68 position: absolute; 69 top: 0; 70 left: 0; 71 right: 0; 72 bottom: 0; 57 .resource-headers .details .key { 58 color: var(--network-system-color); 59 font-weight: 500; 60 -webkit-margin-start: calc(var(--resource-headers-value-indent) * -1); 73 61 } 62 63 .resource-headers .value { 64 color: black; 65 } 66 67 .resource-headers .header > .key { 68 color: var(--network-header-color); 69 } 70 71 .resource-headers .h1-status > .key, 72 .resource-headers .h2-pseudo-header > .key { 73 color: var(--network-pseudo-header-color); 74 } 75 76 .resource-headers .go-to-arrow { 77 vertical-align: top; 78 bottom: 1px; 79 } -
trunk/Source/WebInspectorUI/UserInterface/Views/Table.css
r222868 r223006 31 31 background: white; 32 32 33 --even-zebra-stripe-row-background-color: white;34 --odd-zebra-stripe-row-background-color: hsl(0, 0%, 95%);35 33 --table-column-border-start: 1px solid transparent; 36 34 --table-column-border-end: 0.5px solid var(--border-color); -
trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css
r222868 r223006 97 97 --memory-max-comparison-stroke-color: hsl(220, 10%, 55%); 98 98 99 --network-header-color: hsl(204, 52%, 55%); 100 --network-system-color: hsl(79, 32%, 50%); 101 --network-pseudo-header-color: hsl(312, 35%, 51%); 102 --network-error-color: hsl(0, 54%, 50%); 103 99 104 --even-zebra-stripe-row-background-color: white; 100 105 --odd-zebra-stripe-row-background-color: hsl(0, 0%, 95%);
Note:
See TracChangeset
for help on using the changeset viewer.