WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
44229
Range, EAnnotateForInterchange, and EAbsoluteURLs should be member variables of MarkupAccumulator
https://bugs.webkit.org/show_bug.cgi?id=44229
Summary
Range, EAnnotateForInterchange, and EAbsoluteURLs should be member variables ...
Ryosuke Niwa
Reported
2010-08-18 20:31:57 PDT
We currently pass Range, EAnnotateForInterchange, and EAbsoluteURLs variables through various member functions of MarkupAccumulator. But we should make all three member variables of MarkupAccumulator so that we don't pass around them needlessly.
Attachments
cleanup
(18.55 KB, patch)
2010-08-18 20:51 PDT
,
Ryosuke Niwa
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2010-08-18 20:51:30 PDT
Created
attachment 64807
[details]
cleanup
Darin Adler
Comment 2
2010-08-19 00:49:13 PDT
Comment on
attachment 64807
[details]
cleanup
> + inline bool shouldResolveURLs() { return m_shouldResolveURLs == AbsoluteURLs; } > + inline bool shouldAnnotate() { return m_shouldAnnotate == AnnotateForInterchange; }
No need for the inline keyword here. All function bodies in a class definition are treated as if marked within line.
> + const Range* m_range;
Since you're doing all the const, this could be const Range* const to make it clear that the range pointer is also constant. Not that I think the const is all that helpful. r=me
Ryosuke Niwa
Comment 3
2010-08-19 10:13:50 PDT
(In reply to
comment #2
)
> (From update of
attachment 64807
[details]
) > > + inline bool shouldResolveURLs() { return m_shouldResolveURLs == AbsoluteURLs; } > > + inline bool shouldAnnotate() { return m_shouldAnnotate == AnnotateForInterchange; } > > No need for the inline keyword here. All function bodies in a class definition are treated as if marked within line.
Will remove inline keyword.
> > + const Range* m_range; > > Since you're doing all the const, this could be const Range* const to make it clear that the range pointer is also constant. Not that I think the const is all that helpful.
Will add const to m_nodes and m_range. Having const signifies the fact m_range isn't supposed to change and neither is the Range object pointed by m_range. IMHO, it helps people reading the code because we then don't have to worry about the possibility of m_range being used as a shared state between member functions.
Ryosuke Niwa
Comment 4
2010-08-19 10:16:22 PDT
Committed
r65680
: <
http://trac.webkit.org/changeset/65680
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug