Closed
Bug 1426525
Opened 7 years ago
Closed 7 years ago
Remove XULDocument::mRefMap and its corresponding complexity (and maybe devirtualize nsIDocument::GetElementByID)
Categories
(Core :: XUL, enhancement)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: Gijs, Assigned: bzbarsky)
References
Details
(Keywords: dev-doc-needed)
Attachments
(5 files)
14.80 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
6.07 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
1.28 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
2.31 KB,
patch
|
Gijs
:
review+
|
Details | Diff | Splinter Review |
1.91 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
(In reply to Boris Zbarsky [:bz] from bug 1425356 comment #17)
> Was the "ref" attribute on XUL elements only used for this template stuff?
> If so, can we remove XULDocument::mRefMap and its corresponding complexity
> as a followup (and devirtualize nsIDocument::GetElementByID!)? It looks to
> me per
> https://searchfox.org/mozilla-central/
> search?q=%20ref%3D%22&case=false®exp=false&path=xul like the "ref"
> attribute is only used for template bits...
I don't know anything about mRefMap and GetElementByID particularly, but based on the searchfox query, I think the premise that "ref" is only used for templates is correct.
Assignee | ||
Comment 1•7 years ago
|
||
Note: The devirtualization already happened in bug 1426494, but we can still remove some complexity here.
Assignee | ||
Comment 2•7 years ago
|
||
'ref' used to be used for templates, but those are gone as of bug 1425356 being
fixed.
MozReview-Commit-ID: GerfZrckypp
Attachment #8939989 -
Flags: review?(bugs)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•7 years ago
|
||
MozReview-Commit-ID: Gv23I8gLhem
Attachment #8939990 -
Flags: review?(bugs)
Assignee | ||
Comment 4•7 years ago
|
||
MozReview-Commit-ID: K8Zkedorr7U
Attachment #8939991 -
Flags: review?(bugs)
Assignee | ||
Comment 5•7 years ago
|
||
MozReview-Commit-ID: He9RTzZMmSr
Attachment #8939992 -
Flags: review?(gijskruitbosch+bugs)
Assignee | ||
Comment 6•7 years ago
|
||
The WebIDL for this was already removed in bug 1425356.
MozReview-Commit-ID: HWxPe3a0Pmi
Attachment #8939993 -
Flags: review?(bugs)
Reporter | ||
Comment 7•7 years ago
|
||
Comment on attachment 8939992 [details] [diff] [review]
part 4. Remove uses of 'ref' in XUL trees
Review of attachment 8939992 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM, thanks for doing this!
Attachment #8939992 -
Flags: review?(gijskruitbosch+bugs) → review+
Updated•7 years ago
|
Attachment #8939993 -
Flags: review?(bugs) → review+
Updated•7 years ago
|
Attachment #8939991 -
Flags: review?(bugs) → review+
Comment 8•7 years ago
|
||
Comment on attachment 8939990 [details] [diff] [review]
part 2. Remove the now-nearly-unused XULDocument::GetElementsForID method
>- // This will clear the array if there are no elements.
>- GetElementsForID(id, elements);
>- if (!elements.Count()) {
>+ auto* entry = mIdentifierMap.GetEntry(id);
Could you not use auto here. I have no idea what entry is here.
>+ if (!entry) {
>+ continue;
>+ }
>+
>+ // We want to hold strong refs to the elements while applying
>+ // persistent attributes, just in case.
>+ elements.Clear();
>+ elements.SetCapacity(entry->GetIdElements().Length());
>+ for (auto* element : entry->GetIdElements()) {
I wouldn't mind the actual type here either. auto* doesn't really help readability.
Attachment #8939990 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 9•7 years ago
|
||
> Could you not use auto here. I have no idea what entry is here.
I guess mainly it doesn't matter too much what the exact entry type is, and I make it clear that we're holding a pointer to the entry. But sure, I can list the explicit type...
Comment 10•7 years ago
|
||
Comment on attachment 8939989 [details] [diff] [review]
part 1. Remove XULDocument's mRefMap member, since there should be no XUL elements with 'ref' attributes anymore
(MDN should be updated to hint that all this stuff related to templates is gone.)
Attachment #8939989 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 11•7 years ago
|
||
> (MDN should be updated to hint that all this stuff related to templates is gone.)
Good point. I added dev-doc-needed on bug 1425356.
Assignee | ||
Comment 12•7 years ago
|
||
I guess the "ref no longer acts like id" bit should get documented too.
Keywords: dev-doc-needed
Comment 13•7 years ago
|
||
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/501c70abf837
part 1. Remove XULDocument's mRefMap member, since there should be no XUL elements with 'ref' attributes anymore. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/85e218bf000c
part 2. Remove the now-nearly-unused XULDocument::GetElementsForID method. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/cee585723368
part 3. Remove the special-casing of the 'ref' attribute in CanBroadcast. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/37fdd4a04f4e
part 4. Remove uses of 'ref' in XUL trees. r=gijs
https://hg.mozilla.org/integration/mozilla-inbound/rev/96efa1b6f4d5
part 5. Remove the 'ref' getter/setter on XULElement. r=smaug
Comment 14•7 years ago
|
||
Backed out 5 changesets (bug 1426525) for bustage at build/src/layout/xul/tree/nsTreeContentView.cpp r=backout on a CLOSED TREE
Failure push: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=96efa1b6f4d5266a3c5cabc24ac46ca701986b8a&filter-classifiedState=unclassified&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&selectedJob=154423969
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=154423969&repo=mozilla-inbound&lineNumber=16959
Backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/44d2697ba0a3456e3016e356abb4663b6aff1a9b
Flags: needinfo?(bzbarsky)
Comment 15•7 years ago
|
||
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c713ef0ecf09
part 1. Remove XULDocument's mRefMap member, since there should be no XUL elements with 'ref' attributes anymore. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/07e377e19c7d
part 2. Remove the now-nearly-unused XULDocument::GetElementsForID method. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/c9fad2f64448
part 3. Remove the special-casing of the 'ref' attribute in CanBroadcast. r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/cb168f6a6bfd
part 4. Remove uses of 'ref' in XUL trees. r=gijs
https://hg.mozilla.org/integration/mozilla-inbound/rev/f5ed4ddcc512
part 5. Remove the 'ref' getter/setter on XULElement. r=smaug
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(bzbarsky)
Comment 16•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c713ef0ecf09
https://hg.mozilla.org/mozilla-central/rev/07e377e19c7d
https://hg.mozilla.org/mozilla-central/rev/c9fad2f64448
https://hg.mozilla.org/mozilla-central/rev/cb168f6a6bfd
https://hg.mozilla.org/mozilla-central/rev/f5ed4ddcc512
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•