Make the HTML parser more 64-bit friendly, and clean up some code.

RESOLVED FIXED

Status

()

Core
HTML: Parser
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: jst, Assigned: jst)

Tracking

({64bit})

Trunk
64bit
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

14 years ago
I was looking for classes where we mix 32-bit members with pointer members w/o
grouping them together (which causes the class to be larger than necessary on
some 64-bit platforms due to pointer size and alignment etc) and I found that we
do that in nsParserNode, so I decided to fix that, and in doing so, I found some
other silly stuff I decided to cleanup, and some unused code (and members) I
could remove.

Patch coming up.
(Assignee)

Comment 1

14 years ago
Created attachment 146778 [details] [diff] [review]
Cleanup

This does all that, and also initializes mRefCnt in nsCParserNode's default
ctor where it was left undefined before. Sigh.
(Assignee)

Comment 2

14 years ago
Created attachment 146779 [details] [diff] [review]
diff -w for review
(Assignee)

Updated

14 years ago
Attachment #146779 - Flags: superreview?(bzbarsky)
Attachment #146779 - Flags: review?(bzbarsky)
Comment on attachment 146779 [details] [diff] [review]
diff -w for review

>Index: htmlparser/public/nsHTMLTokens.h

>+  virtual PRBool IsWellFormed(void) const {
>+    return PRBool(eWellFormed == mContainerInfo);
>+  }

Ditch the "PRBool()" part.

> class CEntityToken : public CHTMLToken {
>+  static nsresult ConsumeEntity(PRUnichar aChar, nsString& aString,
>+                                nsScanner& aScanner);
>     static  PRInt32     TranslateToUnicodeStr(PRInt32 aValue,nsString& aString);

Fix your weird indent?

> class CTextToken: public CHTMLToken {
>+  nsresult ConsumeUntil(PRUnichar aChar, PRBool aIgnoreComments,
>+                        nsScanner& aScanner, nsString& aEndTagName,
>+                        PRInt32 aFlag, PRBool& aFlushTokens);
>     virtual PRInt32     GetTokenType(void);

Again.

>+  virtual void Bind(nsScanner* aScanner, nsScannerIterator& aStart,
>+                    nsScannerIterator& aEnd);
>     virtual void        Bind(const nsAString& aStr);

Again.

> class CAttributeToken: public CHTMLToken {
>+  virtual void BindKey(nsScanner* aScanner, nsScannerIterator& aStart,
>+                       nsScannerIterator& aEnd);
>     virtual const nsAString&     GetValue(void) {return mTextValue;}

Again.

r+sr=bzbarsky with those nits.
Attachment #146779 - Flags: superreview?(bzbarsky)
Attachment #146779 - Flags: superreview+
Attachment #146779 - Flags: review?(bzbarsky)
Attachment #146779 - Flags: review+
(Assignee)

Comment 4

14 years ago
You were looking at a diff -w, all those indentation issues were fixed already.
Thanks for the review!
Ah, damn.  Shoulda checked the normal diff.   ;)
(Assignee)

Comment 6

14 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Updated

14 years ago
Keywords: 64bit

Comment 7

14 years ago
the file:
mozilla/parser/htmlparser/src/win32.order

seems to have been checked into the branch:
:pserver:peterv%propagandism.org@cvs.mozilla.org:/cvsroot 

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