Closed Bug 1691274 Opened 2 months ago Closed 2 months ago

Rewrite `X.setAttribute("hidden", Y)` to `X.hidden = Y` in browser/

Categories

(Firefox :: General, task, P2)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: ntim, Assigned: avikpaulsept2002, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

https://searchfox.org/mozilla-central/search?q=setAttribute%28%22hidden%22&path=browser%2F&case=false&regexp=false

.setAttribute("hidden", "true"); -> .hidden = true;
.setAttribute("hidden", true); -> .hidden = true;

.setAttribute("hidden", "false"); -> .hidden = false;
.setAttribute("hidden", false); -> .hidden = false;

For anything else:
.setAttribute("hidden", X); -> .hidden = X;

for instance: .setAttribute("hidden", !browser.isArticle); -> .hidden = !browser.isArticle;

Hey,
I am new to bug fixing but I would like to give my best shot on this.
Can you please provide the necessary gudiance.
Thank you.

(In reply to james from comment #1)

Hey,
I am new to bug fixing but I would like to give my best shot on this.
Can you please provide the necessary gudiance.
Thank you.

Hi James,

I recommend looking at: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#firefox-contributors-quick-reference

The overall process for this bug would be:

  • Clone mozilla-central + install tools (in case you haven't)
  • Make your changes (see comment 0)
  • Make your first build (artifact should be faster), see if everything works
  • Make a patch and submit it

If you're stuck in this process, feel free to ask on #introduction on chat.mozilla.org

Thanks, I'll get started right away

(In reply to Tim Nguyen :ntim from comment #2)

(In reply to james from comment #1)

Hey,
I am new to bug fixing but I would like to give my best shot on this.
Can you please provide the necessary gudiance.
Thank you.

Hi James,

I recommend looking at: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#firefox-contributors-quick-reference

The overall process for this bug would be:

  • Clone mozilla-central + install tools (in case you haven't)
  • Make your changes (see comment 0)
  • Make your first build (artifact should be faster), see if everything works
  • Make a patch and submit it

If you're stuck in this process, feel free to ask on #introduction on chat.mozilla.org

Hi Tim,
I cloned mozilla central, may I ask what do you mean by install tools?
Thank you

(In reply to james from comment #4)

I cloned mozilla central, may I ask what do you mean by install tools?

Running ./mach bootstrap in the terminal (if you haven't done so)

Blocks: 1691321
No longer blocks: 1592799

(In reply to Tim Nguyen :ntim from comment #5)

(In reply to james from comment #4)

I cloned mozilla central, may I ask what do you mean by install tools?

Running ./mach bootstrap in the terminal (if you haven't done so)

I did that already, I am confused as to what to do next?
Shall I start looking for the files as mentioned in comment #1 and replace the lines?

I recently fired up a virtual environment so it's more convenient for me to work on this but when I run ./mach bootstrap I get this error.
`Error running mach:

['bootstrap']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file bootstrap| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

NotImplementedError: Bootstrap support for this Linux distro not yet available: parrot

File "/home/user/Downloads/mozilla-central/python/mozboot/mozboot/mach_commands.py", line 52, in bootstrap
bootstrapper = Bootstrapper(
File "/home/user/Downloads/mozilla-central/python/mozboot/mozboot/bootstrap.py", line 247, in init
raise NotImplementedError(
`

Any workarounds as to how I can get this going in my parrot distro

(In reply to james from comment #6)

(In reply to Tim Nguyen :ntim from comment #5)

(In reply to james from comment #4)

I cloned mozilla central, may I ask what do you mean by install tools?

Running ./mach bootstrap in the terminal (if you haven't done so)

I did that already, I am confused as to what to do next?
Shall I start looking for the files as mentioned in comment #1 and replace the lines?

Yes.

(In reply to james from comment #7)

Any workarounds as to how I can get this going in my parrot distro

Not sure, I'd recommend asking on chat.mozilla.org on the #introduction channel.

(In reply to Tim Nguyen :ntim from comment #8)

(In reply to james from comment #6)

(In reply to Tim Nguyen :ntim from comment #5)

(In reply to james from comment #4)

I cloned mozilla central, may I ask what do you mean by install tools?

Running ./mach bootstrap in the terminal (if you haven't done so)

I did that already, I am confused as to what to do next?
Shall I start looking for the files as mentioned in comment #1 and replace the lines?

Yes.

(In reply to james from comment #7)

I made the changes in the file but when I try to run ./mach build I get this error
`Error running mach:

['build']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file build| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

Exception: Process executed with non-0 exit code 1: ['/home/user/.mozbuild/_virtualenvs/mach/bin/python', '/home/user/Downloads/mozilla-central/configure.py']

File "/home/user/Downloads/mozilla-central/python/mozbuild/mozbuild/build_commands.py", line 146, in build
return driver.build(
File "/home/user/Downloads/mozilla-central/python/mozbuild/mozbuild/controller/building.py", line 1143, in build
config_rc = self.configure(
File "/home/user/Downloads/mozilla-central/python/mozbuild/mozbuild/controller/building.py", line 1528, in configure
status = self._run_command_in_objdir(
File "/home/user/Downloads/mozilla-central/python/mozbuild/mozbuild/base.py", line 887, in _run_command_in_objdir
return self.run_process(cwd=self.topobjdir, **args)
File "/home/user/Downloads/mozilla-central/python/mach/mach/mixin/process.py", line 176, in run_process
raise Exception(

Sentry event ID: 2acab9749922402887fdc494196f03db
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit`

Any workarounds as to how I can get this going in my parrot distro

Not sure, I'd recommend asking on chat.mozilla.org on the #introduction channel.
I got a work around, just changed my usr/lib/os-release file to a debian one.

Fixed this error, this was caused by an older verison of cargo installed on my system
But unfortunately I came across with another error

0:01.05 /usr/bin/gmake -C faster -j1 -s
0:01.08 gmake[1]: *** No rule to make target '../../../security/nss/lib/crmf/crmf_crmf/libcrmf.a', needed by 'libxul.so'. Stop.
0:01.08 gmake: *** [/home/user/Downloads/mozilla-central/config/faster/rules.mk:77: /home/user/Downloads/mozilla-central/obj-x86_64-pc-linux-gnu/toolkit/library/build/libxul.so] Error 2
0:01.08 0 compiler warnings present.

I am new to all this, sorry to spam with repeated questions

(In reply to james from comment #10)

Fixed this error, this was caused by an older verison of cargo installed on my system
But unfortunately I came across with another error

0:01.05 /usr/bin/gmake -C faster -j1 -s
0:01.08 gmake[1]: *** No rule to make target '../../../security/nss/lib/crmf/crmf_crmf/libcrmf.a', needed by 'libxul.so'. Stop.
0:01.08 gmake: *** [/home/user/Downloads/mozilla-central/config/faster/rules.mk:77: /home/user/Downloads/mozilla-central/obj-x86_64-pc-linux-gnu/toolkit/library/build/libxul.so] Error 2
0:01.08 0 compiler warnings present.

I am new to all this, sorry to spam with repeated questions

I would recommend joining https://chat.mozilla.org and asking on the Introduction channel, you'll get more instant answers there from people more familiar with the potential problem.

You should use artifact builds in case you haven't: https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html
That type of build should be faster for this task.

(In reply to Tim Nguyen :ntim from comment #11)

(In reply to james from comment #10)

Fixed this error, this was caused by an older verison of cargo installed on my system
But unfortunately I came across with another error

0:01.05 /usr/bin/gmake -C faster -j1 -s
0:01.08 gmake[1]: *** No rule to make target '../../../security/nss/lib/crmf/crmf_crmf/libcrmf.a', needed by 'libxul.so'. Stop.
0:01.08 gmake: *** [/home/user/Downloads/mozilla-central/config/faster/rules.mk:77: /home/user/Downloads/mozilla-central/obj-x86_64-pc-linux-gnu/toolkit/library/build/libxul.so] Error 2
0:01.08 0 compiler warnings present.

I am new to all this, sorry to spam with repeated questions

I would recommend joining https://chat.mozilla.org and asking on the Introduction channel, you'll get more instant answers there from people more familiar with the potential problem.

You should use artifact builds in case you haven't: https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html
That type of build should be faster for this task.

I have made the changes and successfully ran ./mach build and ./mach run, Shall I add your name to the reviewer list while running hg commit?

Severity: -- → N/A
Priority: -- → P2

(In reply to james from comment #12)

(In reply to Tim Nguyen :ntim from comment #11)

(In reply to james from comment #10)

Fixed this error, this was caused by an older verison of cargo installed on my system
But unfortunately I came across with another error

0:01.05 /usr/bin/gmake -C faster -j1 -s
0:01.08 gmake[1]: *** No rule to make target '../../../security/nss/lib/crmf/crmf_crmf/libcrmf.a', needed by 'libxul.so'. Stop.
0:01.08 gmake: *** [/home/user/Downloads/mozilla-central/config/faster/rules.mk:77: /home/user/Downloads/mozilla-central/obj-x86_64-pc-linux-gnu/toolkit/library/build/libxul.so] Error 2
0:01.08 0 compiler warnings present.

I am new to all this, sorry to spam with repeated questions

I would recommend joining https://chat.mozilla.org and asking on the Introduction channel, you'll get more instant answers there from people more familiar with the potential problem.

You should use artifact builds in case you haven't: https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html
That type of build should be faster for this task.

I have made the changes and successfully ran ./mach build and ./mach run, Shall I add your name to the reviewer list while running hg commit?

Yeah, add r=ntim at the end of the commit message.

(In reply to Tim Nguyen :ntim from comment #13)

(In reply to james from comment #12)

(In reply to Tim Nguyen :ntim from comment #11)

(In reply to james from comment #10)

Fixed this error, this was caused by an older verison of cargo installed on my system
But unfortunately I came across with another error

0:01.05 /usr/bin/gmake -C faster -j1 -s
0:01.08 gmake[1]: *** No rule to make target '../../../security/nss/lib/crmf/crmf_crmf/libcrmf.a', needed by 'libxul.so'. Stop.
0:01.08 gmake: *** [/home/user/Downloads/mozilla-central/config/faster/rules.mk:77: /home/user/Downloads/mozilla-central/obj-x86_64-pc-linux-gnu/toolkit/library/build/libxul.so] Error 2
0:01.08 0 compiler warnings present.

I am new to all this, sorry to spam with repeated questions

I would recommend joining https://chat.mozilla.org and asking on the Introduction channel, you'll get more instant answers there from people more familiar with the potential problem.

You should use artifact builds in case you haven't: https://firefox-source-docs.mozilla.org/contributing/build/artifact_builds.html
That type of build should be faster for this task.

I have made the changes and successfully ran ./mach build and ./mach run, Shall I add your name to the reviewer list while running hg commit?

Yeah, add r=ntim at the end of the commit message.

Done, plz review the changes and let me know if I did everything correctly

Assignee: nobody → avikpaulsept2002
Status: NEW → ASSIGNED
Attachment #9202098 - Attachment description: Bug 1691274 - Replaced XUL-style boolean attributes with HTML-style when appropriate. r=ntim → Bug 1691274 - Replaced XUL-style boolean attributes with HTML-style when appropriate(suggestion of code review bot taken into account). r=ntim

James, the patch mostly looks good, thanks. I left a few comments. Please let me know if you have time to address them.

(In reply to Tim Nguyen :ntim from comment #16)

James, the patch mostly looks good, thanks. I left a few comments. Please let me know if you have time to address them.

Hey Tim,
I went through the comments, I can address them but I can't really understand as to what do you mean by simplifying the blocks, it would be helpful if you provided me with an example

(In reply to james from comment #17)

(In reply to Tim Nguyen :ntim from comment #16)

James, the patch mostly looks good, thanks. I left a few comments. Please let me know if you have time to address them.

Hey Tim,
I went through the comments, I can address them but I can't really understand as to what do you mean by simplifying the blocks, it would be helpful if you provided me with an example

You should check the online Phabricator revision (https://phabricator.services.mozilla.com/D104552) in case you haven't, there are small diffs on there showing how things can be simplified. Please let me know if you see them.

Attachment #9202098 - Attachment description: Bug 1691274 - Replaced XUL-style boolean attributes with HTML-style when appropriate(suggestion of code review bot taken into account). r=ntim → Bug 1691274 - Simplified the blocks wherever necessary as per the suggestion. r=ntim

Tim, I replaced all the blocks you mentioned in the comments, plz review it and let me know if any changes are required.

Attachment #9202098 - Attachment description: Bug 1691274 - Simplified the blocks wherever necessary as per the suggestion. r=ntim → Bug 1691274 - Use DOM hidden property methods instead of attribute methods in browser/ directory. r=ntim

Hi James, I've just queued this for landing. Nothing else to do from your side. Thanks!

Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b3fcb4fcea64
Use DOM hidden property methods instead of attribute methods in browser/ directory. r=ntim,preferences-reviewers

I'll take a look.

Flags: needinfo?(avikpaulsept2002) → needinfo?(ntim.bugs)
Flags: needinfo?(ntim.bugs)
Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/cf0c96111019
Use DOM hidden property methods instead of attribute methods in browser/ directory. r=ntim,preferences-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

(In reply to Tim Nguyen :ntim from comment #20)

Hi James, I've just queued this for landing. Nothing else to do from your side. Thanks!

Thanks for mentoring me, it's been a great experience. Looking forward to contribute.
A quick out of topic question, can I get my github account connected with my bugzilla one?

(In reply to james from comment #26)

(In reply to Tim Nguyen :ntim from comment #20)

Hi James, I've just queued this for landing. Nothing else to do from your side. Thanks!

Thanks for mentoring me, it's been a great experience. Looking forward to contribute.

No worries, thanks for contributing!

A quick out of topic question, can I get my github account connected with my bugzilla one?

There is a login with Github option on bugzilla. If you mean having your Mozilla commits appearing on Github, that's more related to the email you used to configure HG (mercurial), if it matches, the commits should appear (regardless of signing in with Github).

(In reply to Tim Nguyen :ntim from comment #27)

A quick out of topic question, can I get my github account connected with my bugzilla one?

There is a login with Github option on bugzilla. If you mean having your Mozilla commits appearing on Github, that's more related to the email you used to configure HG (mercurial), if it matches, the commits should appear (regardless of signing in with Github).

I have 2 emails connected to my github account but the primary one isn't the one I used on HG. I used the secondary email which is connected on github as the email to configure HG. I don't see any contribution showing up in my github profile. Any idea as to why that happened, I am quite new to all this that's why I am asking. Thanks for being patient.
[P.S. I added the secondary email (the email which I used on hg) to my github today only, is this the reason why it wont show up in my profile?]

(In reply to james from comment #28)

(In reply to Tim Nguyen :ntim from comment #27)

A quick out of topic question, can I get my github account connected with my bugzilla one?

There is a login with Github option on bugzilla. If you mean having your Mozilla commits appearing on Github, that's more related to the email you used to configure HG (mercurial), if it matches, the commits should appear (regardless of signing in with Github).

I have 2 emails connected to my github account but the primary one isn't the one I used on HG. I used the secondary email which is connected on github as the email to configure HG. I don't see any contribution showing up in my github profile. Any idea as to why that happened, I am quite new to all this that's why I am asking. Thanks for being patient.
[P.S. I added the secondary email (the email which I used on hg) to my github today only, is this the reason why it wont show up in my profile?]

Your commit is on Github, properly linked to your account: https://github.com/mozilla/gecko-dev/commit/8069ab6165223e24ec81ccb1840266f21f1a5625 so I don't see why it wouldn't show up on your contribution graph.

It also seems able to properly list your commits w/ your email: https://github.com/mozilla/gecko-dev/commits?author=avikpaulsept2002@gmail.com

...but not with your username: https://github.com/mozilla/gecko-dev/commits?author=jamesfrye420

I don't think Mozilla can do anything about this. This seems like a Github bug or just Github taking a few days to build their contribution graph properly. I suggest contacting Github about it after a few days if you want an answer.

Thanks Tim for the guidance, I will write an email to github after a few days if it doesn't show up

Hey Tim,
Sorry to disturb you once again but I just wanted to know whether the pull request has been accepted or not, cause I still don't see it on my profile

(In reply to james from comment #31)

Hey Tim,
Sorry to disturb you once again but I just wanted to know whether the pull request has been accepted or not, cause I still don't see it on my profile

Yes, as I mentioned before, this has been accepted and committed in the main repository: https://github.com/mozilla/gecko-dev/commit/8069ab6165223e24ec81ccb1840266f21f1a5625. Comment 24 and comment 25 also show the commit in the mercurial repo.

Again, if this doesn't show up on your github profile, this sounds like a Github issue.

James, forking the gecko-dev GitHub repo should get your contributions to show up on your profile.

(In reply to Harry Twyford [:harry] from comment #33)

James, forking the gecko-dev GitHub repo should get your contributions to show up on your profile.

Hi Harry,
I forked the repo as per you suggestion, it still doesn't show up.
I can't figure out the root of this problem. :)

Attachment #9202098 - Attachment description: Bug 1691274 - Use DOM hidden property methods instead of attribute methods in browser/ directory. r=ntim → Bug 1691274 - Simplified the blocks wherever necessary as per the suggestion. r=ntim

Apologies, I was working on another bug but didn't really know how to push a specific revision

You need to log in before you can comment on or make changes to this bug.