WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 60044
Extract LineInfo class
https://bugs.webkit.org/show_bug.cgi?id=60044
Summary
Extract LineInfo class
Levi Weintraub
Reported
2011-05-03 11:29:51 PDT
isFirstLine, isLastLine, isEmpty, and previousLineBrokeCleanly are identifiers used repeatedly through RenderBlock/RenderBlockLineLayout to track identifying line information. This could be packaged into a class that represents relevant information about a line.
Attachments
First patch
(3.35 KB, patch)
2011-05-03 11:37 PDT
,
Levi Weintraub
no flags
Details
Formatted Diff
Diff
Patch
(33.20 KB, patch)
2011-05-03 13:40 PDT
,
Levi Weintraub
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2011-05-03 11:32:05 PDT
Like!
Levi Weintraub
Comment 2
2011-05-03 11:37:27 PDT
Created
attachment 92096
[details]
First patch Removing some unused arguments that leak references to these boolean values to external code.
Eric Seidel (no email)
Comment 3
2011-05-03 12:04:56 PDT
Comment on
attachment 92096
[details]
First patch View in context:
https://bugs.webkit.org/attachment.cgi?id=92096&action=review
> Source/WebCore/rendering/RenderBlock.h:492 > + static bool requiresLineBox(const InlineIterator&, bool isLineEmpty = true, bool previousLineBrokeCleanly = true);
I take it this is called other places with isLineEmpty and previousLineBrokeCleanly? This patch is just removing some unused plumbing?
Ryosuke Niwa
Comment 4
2011-05-03 12:07:58 PDT
(In reply to
comment #3
)
> (From update of
attachment 92096
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=92096&action=review
> > > Source/WebCore/rendering/RenderBlock.h:492 > > + static bool requiresLineBox(const InlineIterator&, bool isLineEmpty = true, bool previousLineBrokeCleanly = true); > > I take it this is called other places with isLineEmpty and previousLineBrokeCleanly? This patch is just removing some unused plumbing?
Yes, this patch only removes unused arguments from generatesLineBoxesForInlineChild.
Levi Weintraub
Comment 5
2011-05-03 13:40:10 PDT
Created
attachment 92117
[details]
Patch
Eric Seidel (no email)
Comment 6
2011-05-03 13:44:45 PDT
Comment on
attachment 92117
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=92117&action=review
LGTM.
> Source/WebCore/rendering/RenderBlockLineLayout.cpp:80 > + void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previousLineBrokeCleanly = previousLineBrokeCleanly; }
I used to think we normally put a \n before private. But since thsi is the 3rd time I've made ethis comment today, I think my sense may be off. :)
Levi Weintraub
Comment 7
2011-05-03 13:45:55 PDT
(In reply to
comment #6
)
> (From update of
attachment 92117
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=92117&action=review
> > LGTM. > > > Source/WebCore/rendering/RenderBlockLineLayout.cpp:80 > > + void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previousLineBrokeCleanly = previousLineBrokeCleanly; } > > I used to think we normally put a \n before private. But since thsi is the 3rd time I've made ethis comment today, I think my sense may be off. :)
Thanks for the reviews!
Levi Weintraub
Comment 8
2011-05-03 13:49:23 PDT
Committed
r85652
: <
http://trac.webkit.org/changeset/85652
>
Ryosuke Niwa
Comment 9
2011-05-03 13:50:37 PDT
Comment on
attachment 92117
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=92117&action=review
> Source/WebCore/rendering/RenderBlock.h:46 > +class LineInfo;
Nit: you should declare this right above LineWidth.
> Source/WebCore/rendering/RenderBlockLineLayout.cpp:69 > + : m_isFirstLine(true) > + , m_isLastLine(false) > + , m_isEmpty(true) > + , m_previousLineBrokeCleanly(true)
I feel like some of these member variables being true by default is arbitrary. Can we add an enum flags that the constructor takes?
> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1445 > -bool RenderBlock::requiresLineBox(const InlineIterator& it, bool isLineEmpty, bool previousLineBrokeCleanly) > +static bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = LineInfo())
Nice!
> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1458 > + && !skipNonBreakingSpace(it, lineInfo);
Nit: You need one more indentation here.
> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1725 > + bool startingNewParagraph = lineInfo.previousLineBrokeCleanly();
Maybe previousLineBrokeCleanly is a bad name for the member function?
Ryosuke Niwa
Comment 10
2011-05-03 13:51:06 PDT
Oops, I cleared eric's r+.
Daniel Bates
Comment 11
2011-05-03 16:58:13 PDT
Comment on
attachment 92117
[details]
Patch Clearing review flag to remove this patch from the review queue since it was already committed as per
comment 8
.
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