RESOLVED FIXED 67647
Web Inspector: do not re-create RawSourceCode when toggling pretty-print mode.
https://bugs.webkit.org/show_bug.cgi?id=67647
Summary Web Inspector: do not re-create RawSourceCode when toggling pretty-print mode.
Pavel Podivilov
Reported 2011-09-06 08:37:08 PDT
Web Inspector: do not re-create RawSourceCode when toggling pretty-print mode. * implement RawSourceCode.setFormatted that allows toggling pretty-print mode on the fly without recreating everything * add RawSourceCode unit tests * remove source mapping listeners and console messages from presentation model
Attachments
Patch (31.08 KB, patch)
2011-09-06 08:38 PDT, Pavel Podivilov
no flags
Patch (31.32 KB, patch)
2011-09-07 05:34 PDT, Pavel Podivilov
no flags
Patch (31.47 KB, patch)
2011-09-07 05:48 PDT, Pavel Podivilov
no flags
Patch (31.02 KB, patch)
2011-09-07 08:22 PDT, Pavel Podivilov
yurys: review+
Pavel Podivilov
Comment 1 2011-09-06 08:38:59 PDT
WebKit Review Bot
Comment 2 2011-09-06 08:40:40 PDT
Attachment 106423 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit', '--chromium']" exit_code: 2 Last 3072 characters of output: ://src.chromium.org/svn/trunk/src/media@99393 parsed_url: http://src.chromium.org/svn/trunk/src/media@99393 should_process: True processed: True requirements: set(['./']) name: build url: http://src.chromium.org/svn/trunk/src/build@99393 parsed_url: http://src.chromium.org/svn/trunk/src/build@99393 should_process: True processed: True requirements: set(['./']) name: net url: http://src.chromium.org/svn/trunk/src/net@99393 should_process: True requirements: set(['./']) name: tools/data_pack url: http://src.chromium.org/svn/trunk/src/tools/data_pack@99393 should_process: True requirements: set(['./']) name: third_party/ffmpeg url: From('chromium_deps', 'src/third_party/ffmpeg') should_process: True requirements: set(['third_party', 'chromium_deps', './']) name: tools/generate_stubs url: http://src.chromium.org/svn/trunk/src/tools/generate_stubs@99393 should_process: True requirements: set(['./']) name: third_party/libjpeg_turbo url: From('chromium_deps', 'src/third_party/libjpeg_turbo') should_process: True requirements: set(['third_party', 'chromium_deps', './']) name: third_party/v8-i18n url: From('chromium_deps', 'src/third_party/v8-i18n') should_process: True requirements: set(['third_party', 'chromium_deps', './']) name: tools/grit url: http://src.chromium.org/svn/trunk/src/tools/grit@99393 should_process: True requirements: set(['./']) name: base url: http://src.chromium.org/svn/trunk/src/base@99393 should_process: True requirements: set(['./']) name: sql url: http://src.chromium.org/svn/trunk/src/sql@99393 should_process: True requirements: set(['./']) name: v8 url: From('chromium_deps', 'src/v8') should_process: True requirements: set(['chromium_deps', './']) name: testing/gtest url: From('chromium_deps', 'src/testing/gtest') should_process: True requirements: set(['testing', 'chromium_deps', './']) name: third_party/libwebp url: http://src.chromium.org/svn/trunk/src/third_party/libwebp@99393 should_process: True requirements: set(['third_party', './']) name: googleurl url: From('chromium_deps', 'src/googleurl') should_process: True requirements: set(['chromium_deps', './']) name: third_party/skia/include url: From('chromium_deps', 'src/third_party/skia/include') should_process: True requirements: set(['third_party', 'chromium_deps', './']) name: third_party/ots url: From('chromium_deps', 'src/third_party/ots') should_process: True requirements: set(['third_party', 'chromium_deps', './']) name: third_party/snappy/src url: From('chromium_deps', 'src/third_party/snappy/src') should_process: True requirements: set(['third_party', 'chromium_deps', './']) Died at Tools/Scripts/update-webkit-chromium line 80. No such file or directory at Tools/Scripts/update-webkit line 104. If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Review Bot
Comment 3 2011-09-06 08:42:51 PDT
Comment on attachment 106423 [details] Patch Attachment 106423 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9590989
Yury Semikhatsky
Comment 4 2011-09-07 04:53:40 PDT
Comment on attachment 106423 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=106423&action=review > LayoutTests/inspector/debugger/raw-source-code.html:9 > + var sourceMapping = { Can this test be split into a few smaller ones? > LayoutTests/inspector/debugger/raw-source-code.html:83 > + var timerId = originalSetTimeout(invokeCallback, timeout) It should be originalSetTimeout.call(window,...) > LayoutTests/inspector/debugger/raw-source-code.html:93 > + for (var i = 0; i < 3; ++i) { Why do you do it exactly thrice? Should it loop until timers is empty? If you assume that firing timers may modify "timers" map it should be cloned before the iteration. > LayoutTests/inspector/debugger/raw-source-code.html:105 > + var script = createScript("foo.js", [0, 0, 20, 80], true, "<script source>"); Here and below script content and start/end line/column should be in sync, otherwise the test uses invalid scripts. r- for this.
Pavel Podivilov
Comment 5 2011-09-07 05:34:33 PDT
Yury Semikhatsky
Comment 6 2011-09-07 05:39:57 PDT
Comment on attachment 106575 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=106575&action=review > LayoutTests/inspector/debugger/raw-source-code.html:9 > + function createScriptMock(url, range, isContentScript, source) Can this method derive end coordinates from the start and source?
Pavel Podivilov
Comment 7 2011-09-07 05:40:55 PDT
(In reply to comment #4) > (From update of attachment 106423 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=106423&action=review > > > LayoutTests/inspector/debugger/raw-source-code.html:9 > > + var sourceMapping = { > > Can this test be split into a few smaller ones? This is a set of unit tests for a single class, I think it's nice to have them defined in the same file. Also, it's faster than loading multiple test documents. > > > LayoutTests/inspector/debugger/raw-source-code.html:83 > > + var timerId = originalSetTimeout(invokeCallback, timeout) > > It should be originalSetTimeout.call(window,...) Done. > > > LayoutTests/inspector/debugger/raw-source-code.html:93 > > + for (var i = 0; i < 3; ++i) { > > Why do you do it exactly thrice? Should it loop until timers is empty? If you assume that firing timers may modify "timers" map it should be cloned before the iteration. I don't want this test to start timing out if there is a setTimeout chain somewhere. Three times is just enough for the test purpose, and there shouldn't be any problems with it. Keys list is cloned by VM, no need to do it manually (items added during enumeration are guaranteed not to be visited. > > > LayoutTests/inspector/debugger/raw-source-code.html:105 > > + var script = createScript("foo.js", [0, 0, 20, 80], true, "<script source>"); > > Here and below script content and start/end line/column should be in sync, otherwise the test uses invalid scripts. r- for this. Done.
Pavel Podivilov
Comment 8 2011-09-07 05:48:40 PDT
Yury Semikhatsky
Comment 9 2011-09-07 06:30:28 PDT
Comment on attachment 106576 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=106576&action=review > LayoutTests/inspector/debugger/raw-source-code.html:96 > + function fireTimers() Are there real setTimeout chains that can't be handled with listeners/sniffers like in other inspector tests? We don't intervene in the timer in other tests I don't see why we should here.
Yury Semikhatsky
Comment 10 2011-09-07 06:31:10 PDT
(In reply to comment #7) > (In reply to comment #4) > > (From update of attachment 106423 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=106423&action=review > Keys list is cloned by VM, no need to do it manually (items added during enumeration are guaranteed not to be visited. > Good to know.
Pavel Podivilov
Comment 11 2011-09-07 08:20:57 PDT
(In reply to comment #9) > (From update of attachment 106576 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=106576&action=review > > > LayoutTests/inspector/debugger/raw-source-code.html:96 > > + function fireTimers() > > Are there real setTimeout chains that can't be handled with listeners/sniffers like in other inspector tests? We don't intervene in the timer in other tests I don't see why we should here. Removed use of timers from RawSourceCode._createSourceMapping and the test.
Pavel Podivilov
Comment 12 2011-09-07 08:22:25 PDT
Pavel Podivilov
Comment 13 2011-09-07 09:41:24 PDT
Ryosuke Niwa
Comment 14 2011-09-07 10:43:54 PDT
inspector/debugger/script-formatter.html is failing on Qt after this patch: http://build.webkit.org/results/Qt%20Linux%20Release/r94677%20(37240)/results.html
Ryosuke Niwa
Comment 20 2011-09-07 19:57:07 PDT
I'm going to rollout the patch for now since I don't understand what the test is testing or what this change is about, and nobody appears to be actively working on it.
Pavel Podivilov
Comment 21 2011-09-08 08:04:52 PDT
Note You need to log in before you can comment on or make changes to this bug.