nsIPrincipal's IDL attributes should be camel case
Categories
(Core :: DOM: Security, defect, P2)
Tracking
()
People
(Reporter: MattN, Assigned: jkt)
References
(Blocks 1 open bug)
Details
(Whiteboard: [domsecurity-active])
Attachments
(3 files)
The following IDL attributes were recently added as TitleCase and don't follow the tree convention which also means that the attributes are TitleCase in JS which is very unusual. We should rename them to camelCase ASAP before it becomes too hard to change them:
- AsciiOrigin
- AsciiSpec
- IsOriginPotentiallyTrustworthy
- etc.
This doesn't require changing the C++ code as the generated headers already convert it to TitleCase but this does affect JS consumers.
When choosing method names in your interface, it's best to use the interCaps style - leading lower case, subsequent units within the identifier capitalized. This matches existing JavaScript convention and will look natural to scripters.
from https://www-archive.mozilla.org/scriptable/xpidl/idl-authors-guide/best-practices
The method name used in XPIDL will appear with the same capitalization to JavaScript, so the best practice is to match JavaScript convention by declaring attributes and method names in interCaps.
from https://www-archive.mozilla.org/scriptable/xpidl/idl-authors-guide/rules
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
I think we should also consider preventing all of these interfaces as scriptable also as I can see the abuse in scripting happening and be harder to prevent.
Pushed by jkingston@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0ddcc1e78317 Make nsIPrincipal attributes camelcase. r=ckerschb
Comment 4•3 years ago
|
||
bugherder |
Comment 5•3 years ago
|
||
Reopened as i mistakenly added new ones that are the wrong case 🙈 sorry about that.
Comment 6•3 years ago
|
||
Comment 8•3 years ago
|
||
yes. did update the patch, thanks for pointing out :)
Pushed by btara@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/198b3e4d5e99 Make new nsIPrincipal attributes camelcase. r=ckerschb
Comment 10•3 years ago
|
||
bugherder |
Description
•