The notificationbar "stack" lazy getter is called when closing a tab
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1704868
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
I noticed in the profile of closing many tabs from bug 1379174 comment 6 that 2.2% of the time spent in removeTabs
is spent in notificationbox.js: get stack
https://share.firefox.dev/3g8aLPC
The code at https://searchfox.org/mozilla-central/rev/3de2db87f3c9001ae478318d47a2ca3427574382/browser/base/content/tabbrowser.js#3811-3812 tries to avoid triggering the notification box lazy getter, but then doesn't check if the stack has already been initialized before accessing it.
Unfortunately, the getNotificationBox
method is called at https://searchfox.org/mozilla-central/rev/3de2db87f3c9001ae478318d47a2ca3427574382/browser/base/content/browser.js#5859, so any tab that has already had a location change event will have a notification box.
Backed out 2 changesets (bug 1704868) for browser_app.js mochitest failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/50da9f556ed0e4fe60a103a9991bac42fd3734ac
Failure log: https://treeherder.mozilla.org/logviewer?job_id=336821307&repo=autoland&lineNumber=1505
[task 2021-04-16T18:49:01.215Z] 18:49:01 INFO - TEST-START | accessible/tests/browser/mac/browser_app.js
[task 2021-04-16T18:49:02.136Z] 18:49:02 INFO - TEST-INFO | started process screencapture
[task 2021-04-16T18:49:02.236Z] 18:49:02 INFO - TEST-INFO | screencapture: exit 0
[task 2021-04-16T18:49:02.236Z] 18:49:02 INFO - Buffered messages logged at 18:49:01
[task 2021-04-16T18:49:02.236Z] 18:49:02 INFO - Entering test bound
[task 2021-04-16T18:49:02.236Z] 18:49:02 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,<title>Two</title>" line: 0}]
[task 2021-04-16T18:49:02.236Z] 18:49:02 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,<title>Three</title>" line: 0}]
[task 2021-04-16T18:49:02.237Z] 18:49:02 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "data:text/html,<title>Four</title>" line: 0}]
[task 2021-04-16T18:49:02.237Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | We now have 4 open tabs -
[task 2021-04-16T18:49:02.237Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Correct role for tablist -
[task 2021-04-16T18:49:02.237Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | 4 items in AXTabs -
[task 2021-04-16T18:49:02.237Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | one selected tab -
[task 2021-04-16T18:49:02.238Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Correct role for tab -
[task 2021-04-16T18:49:02.238Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Correct subrole for tab -
[task 2021-04-16T18:49:02.238Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Correct title for tab -
[task 2021-04-16T18:49:02.238Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Correct title for tab -
[task 2021-04-16T18:49:02.238Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | [u'AXShowMenu', u'AXScrollToVisible', u'AXPress'] -
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Has switch action -
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | one selected tab -
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - TEST-PASS | accessible/tests/browser/mac/browser_app.js | Correct title for tab -
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - Leaving test bound
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - Entering test bound
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - Buffered messages finished
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - TEST-UNEXPECTED-FAIL | accessible/tests/browser/mac/browser_app.js | Root with no popups has 6 children - Got 5, expected 6
[task 2021-04-16T18:49:02.239Z] 18:49:02 INFO - Stack trace:
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - chrome://mochikit/content/browser-test.js:test_is:1362
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - chrome://mochitests/content/browser/accessible/tests/browser/mac/browser_app.js:null:133
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - Global property added while loading chrome://browser/content/nsContextMenu.js: screenshotsDisabled
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - Not taking screenshot here: see the one that was previously logged
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - TEST-UNEXPECTED-FAIL | accessible/tests/browser/mac/browser_app.js | Root has 1 more child - Got 6, expected 7
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - Stack trace:
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - chrome://mochikit/content/browser-test.js:test_is:1362
[task 2021-04-16T18:49:02.240Z] 18:49:02 INFO - chrome://mochitests/content/browser/accessible/tests/browser/mac/browser_app.js:null:169
[task 2021-04-16T18:49:02.251Z] 18:49:02 INFO - Not taking screenshot here: see the one that was previously logged
[task 2021-04-16T18:49:02.251Z] 18:49:02 INFO - TEST-UNEXPECTED-FAIL | accessible/tests/browser/mac/browser_app.js | Root has original child count - Got 5, expected 6
[task 2021-04-16T18:49:02.251Z] 18:49:02 INFO - Stack trace:
[task 2021-04-16T18:49:02.251Z] 18:49:02 INFO - chrome://mochikit/content/browser-test.js:test_is:1362
[task 2021-04-16T18:49:02.251Z] 18:49:02 INFO - chrome://mochitests/content/browser/accessible/tests/browser/mac/browser_app.js:null:179
[task 2021-04-16T18:49:02.541Z] 18:49:02 INFO - Not taking screenshot here: see the one that was previously logged
[task 2021-04-16T18:49:02.542Z] 18:49:02 INFO - TEST-UNEXPECTED-FAIL | accessible/tests/browser/mac/browser_app.js | Root has another child - Got 6, expected 7
[task 2021-04-16T18:49:02.542Z] 18:49:02 INFO - Stack trace:
[task 2021-04-16T18:49:02.542Z] 18:49:02 INFO - chrome://mochikit/content/browser-test.js:test_is:1362
[task 2021-04-16T18:49:02.542Z] 18:49:02 INFO - chrome://mochitests/content/browser/accessible/tests/browser/mac/browser_app.js:null:187
[task 2021-04-16T18:49:02.904Z] 18:49:02 INFO - Not taking screenshot here: see the one that was previously logged
[task 2021-04-16T18:49:02.904Z] 18:49:02 INFO - TEST-UNEXPECTED-FAIL | accessible/tests/browser/mac/browser_app.js | Root has the base child count - Got 5, expected 6
[task 2021-04-16T18:49:02.904Z] 18:49:02 INFO - Stack trace:
[task 2021-04-16T18:49:02.904Z] 18:49:02 INFO - chrome://mochikit/content/browser-test.js:test_is:1362
[task 2021-04-16T18:49:02.904Z] 18:49:02 INFO - chrome://mochitests/content/browser/accessible/tests/browser/mac/browser_app.js:null:194
[task 2021-04-16T18:49:02.930Z] 18:49:02 INFO - Leaving test bound
Recommend
-
31
The cornerstone of JavaScript is the function. It is a flexible abstraction that works as the basis for other abstractions, such as Promises, Iterables, Observables, and others. I have been teaching these concepts in conf...
-
10
getter 和setter 子类中为什么要写get和set方法获取释放数据,不写会怎样?在什么情况下要用getter和setter? getter通常与一个私有的实例变量对应,用于返回该变量的值
-
40
QQA: 为什么 java 中要写 getter/setter?java 有一个不成文的规定,如果要访问一个类的 private 字段,就需要写 getter/setter 方法。但我们在其它语言却很少见到类似的约定,为什么? 它是“封装”的体现,对外隐藏了具体实现...
-
18
昨天晚上看了长亭的一篇 Real Wolrd CTF 3rd Writeup | Old System 推文,觉得很有意思,自己...
-
9
Changelog Makes ActiveRecord::AttributeMethods::Query respect the getter overrides defined in the model. Fixes #40771 Before: ...
-
7
In this article Where is my getter/setter in Swift? A missing Objective-C piece 05 Jun 2014 ⋅ 1 min read ⋅...
-
7
Private methods and getter/setters for JavaScript classes Daniel Ehrenberg Stage 3 Keeping state and behavior private to a class lets library authors present a clear, stab...
-
5
Python 装饰器之 Property: Setter 和 Getter Property vs. Getter and Setter in Python decorators Herb
-
3
Closed Bug 1707692 Opened 1 month ago Closed 28 days ago...
-
4
Python vs C++ Series: Getter, Setter, and Property ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK