 Chromium Code Reviews
 Chromium Code Reviews Issue 2317343006:
  Fix console viewport test failures with scroll anchoring.  (Closed)
    
  
    Issue 2317343006:
  Fix console viewport test failures with scroll anchoring.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 <html> | 1 <html> | 
| 2 <head> | 2 <head> | 
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> | 
| 5 <script> | 5 <script> | 
| 6 function populateConsoleWithMessages(count) | 6 function populateConsoleWithMessages(count) | 
| 7 { | 7 { | 
| 8 for (var i = 0; i < count - 1; ++i) | 8 for (var i = 0; i < count - 1; ++i) | 
| 9 console.log("Multiline\nMessage #" + i); | 9 console.log("Multiline\nMessage #" + i); | 
| 10 console.log("hello %cworld", "color: blue"); | 10 console.log("hello %cworld", "color: blue"); | 
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 { | 81 { | 
| 82 var keyEvent = InspectorTest.createKeyEvent("a"); | 82 var keyEvent = InspectorTest.createKeyEvent("a"); | 
| 83 viewport._contentElement.dispatchEvent(keyEvent); | 83 viewport._contentElement.dispatchEvent(keyEvent); | 
| 84 consoleView._prompt._proxyElement.dispatchEvent(new Event('input')); | 84 consoleView._prompt._proxyElement.dispatchEvent(new Event('input')); | 
| 85 | 85 | 
| 86 dumpAndContinue(next); | 86 dumpAndContinue(next); | 
| 87 }, | 87 }, | 
| 88 | 88 | 
| 89 function testViewportMutationsShouldPreserveStickToBottom(next) | 89 function testViewportMutationsShouldPreserveStickToBottom(next) | 
| 90 { | 90 { | 
| 91 viewport._contentElement.children[1].innerText = "More than 2 lines: foo\n\nbar"; | 91 viewport._contentElement.lastChild.innerText = "More than 2 lines: f oo\n\nbar"; | 
| 
lushnikov
2016/09/12 20:18:39
how does scroll anchoring picks a node to anchor?
 
skobes
2016/09/12 20:22:37
Roughly, it will pick the first visible element.
 
lushnikov
2016/09/13 00:09:21
I still don't understand how the change helps to m
 
luoe
2016/09/13 01:30:38
skobes@, on second thought, I'm a bit uncertain, t
 
skobes
2016/09/13 20:25:04
What I observe is that when we set innerText for t
 
skobes
2016/09/13 20:25:04
SANACLAP doesn't trigger because no CSS properties
 | |
| 92 dumpAndContinue(onMessagesDumped); | 92 dumpAndContinue(onMessagesDumped); | 
| 93 | 93 | 
| 94 function onMessagesDumped() | 94 function onMessagesDumped() | 
| 95 { | 95 { | 
| 96 viewport.setStickToBottom(false); | 96 viewport.setStickToBottom(false); | 
| 97 viewport._contentElement.children[1].innerText = "More than 3 li nes: foo\n\n\nbar"; | 97 viewport._contentElement.lastChild.innerText = "More than 3 line s: foo\n\n\nbar"; | 
| 98 dumpAndContinue(next); | 98 dumpAndContinue(next); | 
| 99 } | 99 } | 
| 100 }, | 100 }, | 
| 101 | 101 | 
| 102 function testMuteUpdatesWhileScrolling(next) | 102 function testMuteUpdatesWhileScrolling(next) | 
| 103 { | 103 { | 
| 104 consoleView._updateStickToBottomOnMouseDown(); | 104 consoleView._updateStickToBottomOnMouseDown(); | 
| 105 viewport.element.scrollTop -= 10; | 105 viewport.element.scrollTop -= 10; | 
| 106 | 106 | 
| 107 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_sched uleViewportRefreshForTest", onMessageAdded); | 107 InspectorTest.addSniffer(WebInspector.ConsoleView.prototype, "_sched uleViewportRefreshForTest", onMessageAdded); | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 } | 179 } | 
| 180 } | 180 } | 
| 181 </script> | 181 </script> | 
| 182 </head> | 182 </head> | 
| 183 <body onload="runTest()"> | 183 <body onload="runTest()"> | 
| 184 <p> | 184 <p> | 
| 185 Verifies viewport stick-to-bottom behavior. | 185 Verifies viewport stick-to-bottom behavior. | 
| 186 </p> | 186 </p> | 
| 187 </body> | 187 </body> | 
| 188 </html> | 188 </html> | 
| OLD | NEW |