Last Comment Bug 660771 - parser should use mozilla::Preferences
: parser should use mozilla::Preferences
Status: RESOLVED FIXED
[inbound] (part.2 only, part.1 has be...
:
Product: Core
Classification: Components
Component: HTML: Parser (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: Masayuki Nakano [:masayuki] (Mozilla Japan)
:
Mentors:
Depends on: 656826
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-31 02:07 PDT by Masayuki Nakano [:masayuki] (Mozilla Japan)
Modified: 2011-06-15 08:52 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1.0 (1.75 KB, patch)
2011-05-31 02:07 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
roc: review+
Details | Diff | Review
Patch v1.1 (1.75 KB, patch)
2011-05-31 16:51 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
mrbkap: review+
Details | Diff | Review
remove unnecessary code (708 bytes, patch)
2011-06-08 17:05 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
no flags Details | Diff | Review
remove unnecessary code (722 bytes, patch)
2011-06-08 17:08 PDT, Masayuki Nakano [:masayuki] (Mozilla Japan)
mrbkap: review+
Details | Diff | Review

Description Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-31 02:07:42 PDT
Created attachment 536257 [details] [diff] [review]
Patch v1.0
Comment 1 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2011-05-31 04:13:48 PDT
Comment on attachment 536257 [details] [diff] [review]
Patch v1.0

Review of attachment 536257 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with that fixed

::: parser/htmlparser/src/nsViewSourceHTML.cpp
@@ +204,2 @@
>  
> +  mWrapLongLines = Preferences::GetBool("view_source.wrap_long_lines", PR_TRUE);

default should be PR_FALSE
Comment 2 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-05-31 16:51:54 PDT
Created attachment 536475 [details] [diff] [review]
Patch v1.1

Roc:

Absolutely.
Comment 3 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-06-01 18:08:35 PDT
http://hg.mozilla.org/mozilla-central/rev/a4107cfe6b21
Comment 4 Hiroyuki Ikezoe (:hiro) 2011-06-02 15:10:43 PDT
(In reply to comment #3)
> http://hg.mozilla.org/mozilla-central/rev/a4107cfe6b21

    1.50  CViewSourceHTML::CViewSourceHTML()
    1.51  {
    1.52    mSyntaxHighlight = PR_FALSE;
    1.53    mWrapLongLines = PR_FALSE;
    1.54    mTabSize = -1;

There is no need to set initial values anymore.

Just out of curiosity, the default value of mSyntaxHighlight should be PR_FALSE or PR_TRUE? In original code, the value is PR_FALSE if failing to get nsIPrefBranch but the value is PR_TRUE if GetBoolPref is failed.
Comment 5 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-06-02 17:28:07 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > http://hg.mozilla.org/mozilla-central/rev/a4107cfe6b21
> 
>     1.50  CViewSourceHTML::CViewSourceHTML()
>     1.51  {
>     1.52    mSyntaxHighlight = PR_FALSE;
>     1.53    mWrapLongLines = PR_FALSE;
>     1.54    mTabSize = -1;
> 
> There is no need to set initial values anymore.
> 
> Just out of curiosity, the default value of mSyntaxHighlight should be
> PR_FALSE or PR_TRUE? In original code, the value is PR_FALSE if failing to
> get nsIPrefBranch but the value is PR_TRUE if GetBoolPref is failed.

I guess that it should be PR_TRUE because prefBranch is never NULL until shutting down.
Comment 6 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-06-08 17:05:38 PDT
Created attachment 538151 [details] [diff] [review]
remove unnecessary code

followup patch for comment 4. the initialized values are always overwritten.
Comment 7 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-06-08 17:08:28 PDT
Created attachment 538152 [details] [diff] [review]
remove unnecessary code

oops, removed also mTabSize.
Comment 8 Blake Kaplan (:mrbkap) (please use needinfo!) 2011-06-13 13:59:51 PDT
Comment on attachment 538152 [details] [diff] [review]
remove unnecessary code

Review of attachment 538152 [details] [diff] [review]:
-----------------------------------------------------------------
Comment 9 Masayuki Nakano [:masayuki] (Mozilla Japan) 2011-06-14 22:17:02 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/bf50cdd9ba99
Comment 10 Matt Brubeck (:mbrubeck) 2011-06-15 08:52:15 PDT
"remove unnecessary code" merged from m-i to m-c:
http://hg.mozilla.org/mozilla-central/rev/bf50cdd9ba99

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