<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160135] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160135">160135</a></dd>
<dt>Author</dt> <dd>zoltan@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-04 15:21:42 -0800 (Wed, 04 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move TrailingObjects class into its own h/cpp
https://bugs.webkit.org/show_bug.cgi?id=124956
Reviewed by David Hyatt.
Since I moved space-ignoring inline functions into MidpointState in <a href="http://trac.webkit.org/projects/webkit/changeset/160074">r160074</a>,
I can nicely separate TrailingObjects class from BreakingContextInlineHeader.h.
This change improves the readability, and it's part of the RenderBlockLineLayout
refactoring campaign, which is tracked under bug #121261.
No new tests, no behavior change.
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.h:
* rendering/line/BreakingContextInlineHeaders.h:
* rendering/line/TrailingObjects.cpp: Added.
(WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
* rendering/line/TrailingObjects.h: Added.
(WebCore::TrailingObjects::TrailingObjects):
(WebCore::TrailingObjects::setTrailingWhitespace):
(WebCore::TrailingObjects::clear):
(WebCore::TrailingObjects::appendBoxIfNeeded):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh">trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderinglineTrailingObjectscpp">trunk/Source/WebCore/rendering/line/TrailingObjects.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineTrailingObjectsh">trunk/Source/WebCore/rendering/line/TrailingObjects.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -2222,6 +2222,7 @@
</span><span class="cx"> rendering/line/LineBreaker.cpp
</span><span class="cx"> rendering/line/LineInfo.cpp
</span><span class="cx"> rendering/line/LineWidth.cpp
</span><ins>+ rendering/line/TrailingObjects.cpp
</ins><span class="cx">
</span><span class="cx"> rendering/mathml/RenderMathMLBlock.cpp
</span><span class="cx"> rendering/mathml/RenderMathMLFenced.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/ChangeLog        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2013-12-04 Zoltan Horvath <zoltan@webkit.org>
+
+ Move TrailingObjects class into its own h/cpp
+ https://bugs.webkit.org/show_bug.cgi?id=124956
+
+ Reviewed by David Hyatt.
+
+ Since I moved space-ignoring inline functions into MidpointState in r160074,
+ I can nicely separate TrailingObjects class from BreakingContextInlineHeader.h.
+ This change improves the readability, and it's part of the RenderBlockLineLayout
+ refactoring campaign, which is tracked under bug #121261.
+
+ No new tests, no behavior change.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * WebCore.vcxproj/WebCore.vcxproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockFlow.h:
+ * rendering/line/BreakingContextInlineHeaders.h:
+ * rendering/line/TrailingObjects.cpp: Added.
+ (WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
+ * rendering/line/TrailingObjects.h: Added.
+ (WebCore::TrailingObjects::TrailingObjects):
+ (WebCore::TrailingObjects::setTrailingWhitespace):
+ (WebCore::TrailingObjects::clear):
+ (WebCore::TrailingObjects::appendBoxIfNeeded):
+
</ins><span class="cx"> 2013-12-04 Oliver Hunt <oliver@apple.com>
</span><span class="cx">
</span><span class="cx"> Refactor static getter function prototype to include thisValue in addition to the base object
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -4528,6 +4528,7 @@
</span><span class="cx">         Source/WebCore/rendering/line/LineLayoutState.h \
</span><span class="cx">         Source/WebCore/rendering/line/LineWidth.h \
</span><span class="cx">         Source/WebCore/rendering/line/LineWidth.cpp \
</span><ins>+ Source/WebCore/rendering/line/TrailingObjects.cpp \
</ins><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLBlock.h \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -11080,6 +11080,7 @@
</span><span class="cx"> <ClCompile Include="..\rendering\line\LineBreaker.cpp" />
</span><span class="cx"> <ClCompile Include="..\rendering\line\LineInfo.cpp" />
</span><span class="cx"> <ClCompile Include="..\rendering\line\LineWidth.cpp" />
</span><ins>+ <ClCompile Include="..\rendering\line\TrailingObjects.cpp" />
</ins><span class="cx"> <ClCompile Include="..\rendering\shapes\BoxShape.cpp" />
</span><span class="cx"> <ClCompile Include="..\rendering\shapes\PolygonShape.cpp" />
</span><span class="cx"> <ClCompile Include="..\rendering\shapes\RasterShape.cpp" />
</span><span class="lines">@@ -19930,6 +19931,7 @@
</span><span class="cx"> <ClInclude Include="..\rendering\line\LineInlineHeaders.h" />
</span><span class="cx"> <ClInclude Include="..\rendering\line\LineLayoutState.h" />
</span><span class="cx"> <ClInclude Include="..\rendering\line\LineWidth.h" />
</span><ins>+ <ClInclude Include="..\rendering\line\TrailingObjects.h" />
</ins><span class="cx"> <ClInclude Include="..\rendering\shapes\BoxShape.h" />
</span><span class="cx"> <ClInclude Include="..\rendering\shapes\PolygonShape.h" />
</span><span class="cx"> <ClInclude Include="..\rendering\shapes\RasterShape.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -6324,6 +6324,8 @@
</span><span class="cx">                 FEE1811416C319E800084849 /* SQLTransactionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE1811216C319E800084849 /* SQLTransactionBackend.h */; };
</span><span class="cx">                 FF945ECB161F7F3600971BC8 /* PseudoElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */; };
</span><span class="cx">                 FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */ = {isa = PBXBuildFile; fileRef = FF945ECA161F7F3600971BC8 /* PseudoElement.h */; };
</span><ins>+                FFAC30FE184FB145008C4F1E /* TrailingObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = FFAC30FC184FB145008C4F1E /* TrailingObjects.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FFAC30FF184FB145008C4F1E /* TrailingObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFAC30FD184FB145008C4F1E /* TrailingObjects.cpp */; };
</ins><span class="cx">                 FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CA1833EC3800158A31 /* LineBreaker.cpp */; };
</span><span class="cx">                 FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFB698CD1833F17600158A31 /* LineInfo.cpp */; };
</span><span class="cx">                 FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FFD5B977135CC97800D5E92A /* PageVisibilityState.cpp */; };
</span><span class="lines">@@ -13536,6 +13538,8 @@
</span><span class="cx">                 FEE1811216C319E800084849 /* SQLTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionBackend.h; sourceTree = "<group>"; };
</span><span class="cx">                 FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoElement.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FF945ECA161F7F3600971BC8 /* PseudoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElement.h; sourceTree = "<group>"; };
</span><ins>+                FFAC30FC184FB145008C4F1E /* TrailingObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingObjects.h; sourceTree = "<group>"; };
+                FFAC30FD184FB145008C4F1E /* TrailingObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrailingObjects.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 FFB698C91832F10B00158A31 /* BreakingContextInlineHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakingContextInlineHeaders.h; sourceTree = "<group>"; };
</span><span class="cx">                 FFB698CA1833EC3800158A31 /* LineBreaker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineBreaker.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 FFB698CB1833EC3800158A31 /* LineBreaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineBreaker.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22008,6 +22012,8 @@
</span><span class="cx">                 FFB698C81832F10B00158A31 /* line */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                FFAC30FC184FB145008C4F1E /* TrailingObjects.h */,
+                                FFAC30FD184FB145008C4F1E /* TrailingObjects.cpp */,
</ins><span class="cx">                                 FFDBC045183D27B700407109 /* LineWidth.h */,
</span><span class="cx">                                 FFDBC046183D27B700407109 /* LineWidth.cpp */,
</span><span class="cx">                                 FFEFAB2D183BCB6F00514534 /* LineInlineHeaders.h */,
</span><span class="lines">@@ -24495,6 +24501,7 @@
</span><span class="cx">                                 49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */,
</span><span class="cx">                                 5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */,
</span><span class="cx">                                 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */,
</span><ins>+                                FFAC30FE184FB145008C4F1E /* TrailingObjects.h in Headers */,
</ins><span class="cx">                                 9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */,
</span><span class="cx">                                 BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */,
</span><span class="cx">                                 A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */,
</span><span class="lines">@@ -26631,6 +26638,7 @@
</span><span class="cx">                                 7ACD88D314C08BD60084EDD2 /* InspectorIndexedDBAgent.cpp in Sources */,
</span><span class="cx">                                 4D273CF91669420800259CA1 /* InspectorInputAgent.cpp in Sources */,
</span><span class="cx">                                 20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */,
</span><ins>+                                FFAC30FF184FB145008C4F1E /* TrailingObjects.cpp in Sources */,
</ins><span class="cx">                                 71B1E1261640491A00B1880A /* InspectorLayerTreeAgent.cpp in Sources */,
</span><span class="cx">                                 7AA51DD5148506A900AD2752 /* InspectorMemoryAgent.cpp in Sources */,
</span><span class="cx">                                 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/rendering/RenderBlock.h        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class BidiContext;
</span><del>-class InlineIterator;
</del><span class="cx"> class LayoutStateMaintainer;
</span><span class="cx"> class LineLayoutState;
</span><span class="cx"> class LineWidth;
</span><span class="lines">@@ -59,11 +58,7 @@
</span><span class="cx"> class TextLayout;
</span><span class="cx"> class WordMeasurement;
</span><span class="cx">
</span><del>-template <class Iterator, class Run> class BidiResolver;
</del><span class="cx"> template <class Run> class BidiRunList;
</span><del>-template <class Iterator> class MidpointState;
-typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver;
-typedef MidpointState<InlineIterator> LineMidpointState;
</del><span class="cx"> typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet;
</span><span class="cx"> typedef WTF::HashMap<const RenderBlock*, OwnPtr<TrackedRendererListHashSet>> TrackedDescendantsMap;
</span><span class="cx"> typedef WTF::HashMap<const RenderBox*, OwnPtr<HashSet<RenderBlock*>>> TrackedContainerMap;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "RenderBlock.h"
</span><span class="cx"> #include "RenderLineBoxList.h"
</span><span class="cx"> #include "SimpleLineLayout.h"
</span><ins>+#include "TrailingObjects.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineBreakingContextInlineHeadersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h (160134 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2013-12-04 23:20:54 UTC (rev 160134)
+++ trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include "RenderInline.h"
</span><span class="cx"> #include "RenderListMarker.h"
</span><span class="cx"> #include "RenderRubyRun.h"
</span><ins>+#include "TrailingObjects.h"
</ins><span class="cx"> #include "break_lines.h"
</span><span class="cx"> #include <wtf/unicode/CharacterNames.h>
</span><span class="cx">
</span><span class="lines">@@ -67,86 +68,6 @@
</span><span class="cx"> HashSet<const SimpleFontData*> fallbackFonts;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-class TrailingObjects {
-public:
- TrailingObjects();
- void setTrailingWhitespace(RenderText*);
- void clear();
- void appendBoxIfNeeded(RenderBoxModelObject*);
-
- enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace };
-
- void updateMidpointsForTrailingBoxes(LineMidpointState&, const InlineIterator& lBreak, CollapseFirstSpaceOrNot);
-
-private:
- RenderText* m_whitespace;
- Vector<RenderBoxModelObject*, 4> m_boxes;
-};
-
-TrailingObjects::TrailingObjects()
- : m_whitespace(0)
-{
-}
-
-inline void TrailingObjects::setTrailingWhitespace(RenderText* whitespace)
-{
- ASSERT(whitespace);
- m_whitespace = whitespace;
-}
-
-inline void TrailingObjects::clear()
-{
- m_whitespace = 0;
- m_boxes.shrink(0); // Use shrink(0) instead of clear() to retain our capacity.
-}
-
-inline void TrailingObjects::appendBoxIfNeeded(RenderBoxModelObject* box)
-{
- if (m_whitespace)
- m_boxes.append(box);
-}
-
-void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState& lineMidpointState, const InlineIterator& lBreak, CollapseFirstSpaceOrNot collapseFirstSpace)
-{
- if (!m_whitespace)
- return;
-
- // This object is either going to be part of the last midpoint, or it is going to be the actual endpoint.
- // In both cases we just decrease our pos by 1 level to exclude the space, allowing it to - in effect - collapse into the newline.
- if (lineMidpointState.numMidpoints % 2) {
- // Find the trailing space object's midpoint.
- int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1;
- for ( ; trailingSpaceMidpoint > 0 && lineMidpointState.midpoints[trailingSpaceMidpoint].renderer() != m_whitespace; --trailingSpaceMidpoint) { }
- ASSERT(trailingSpaceMidpoint >= 0);
- if (collapseFirstSpace == CollapseFirstSpace)
- lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
-
- // Now make sure every single trailingPositionedBox following the trailingSpaceMidpoint properly stops and starts
- // ignoring spaces.
- size_t currentMidpoint = trailingSpaceMidpoint + 1;
- for (size_t i = 0; i < m_boxes.size(); ++i) {
- if (currentMidpoint >= lineMidpointState.numMidpoints) {
- // We don't have a midpoint for this box yet.
- lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_boxes[i]);
- } else {
- ASSERT(lineMidpointState.midpoints[currentMidpoint].renderer() == m_boxes[i]);
- ASSERT(lineMidpointState.midpoints[currentMidpoint + 1].renderer() == m_boxes[i]);
- }
- currentMidpoint += 2;
- }
- } else if (!lBreak.renderer()) {
- ASSERT(m_whitespace->isText());
- ASSERT(collapseFirstSpace == CollapseFirstSpace);
- // Add a new end midpoint that stops right at the very end.
- unsigned length = m_whitespace->textLength();
- unsigned pos = length >= 2 ? length - 2 : UINT_MAX;
- InlineIterator endMid(0, m_whitespace, pos);
- lineMidpointState.startIgnoringSpaces(endMid);
- for (size_t i = 0; i < m_boxes.size(); ++i)
- lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_boxes[i]);
- }
-}
-
</del><span class="cx"> class BreakingContext {
</span><span class="cx"> public:
</span><span class="cx"> BreakingContext(LineBreaker& lineBreaker, InlineBidiResolver& resolver, LineInfo& inLineInfo, LineWidth& lineWidth, RenderTextInfo& inRenderTextInfo, FloatingObject* inLastFloatFromPreviousLine, bool appliedStartWidth, RenderBlockFlow& block)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineTrailingObjectscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/TrailingObjects.cpp (0 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/TrailingObjects.cpp         (rev 0)
+++ trunk/Source/WebCore/rendering/line/TrailingObjects.cpp        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 ChangSeok Oh <shivamidow@gmail.com>
+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "TrailingObjects.h"
+
+#include "InlineIterator.h"
+
+namespace WebCore {
+
+void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState& lineMidpointState, const InlineIterator& lBreak, CollapseFirstSpaceOrNot collapseFirstSpace)
+{
+ if (!m_whitespace)
+ return;
+
+ // This object is either going to be part of the last midpoint, or it is going to be the actual endpoint.
+ // In both cases we just decrease our pos by 1 level to exclude the space, allowing it to - in effect - collapse into the newline.
+ if (lineMidpointState.numMidpoints % 2) {
+ // Find the trailing space object's midpoint.
+ int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1;
+ for ( ; trailingSpaceMidpoint > 0 && lineMidpointState.midpoints[trailingSpaceMidpoint].renderer() != m_whitespace; --trailingSpaceMidpoint) { }
+ ASSERT(trailingSpaceMidpoint >= 0);
+ if (collapseFirstSpace == CollapseFirstSpace)
+ lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
+
+ // Now make sure every single trailingPositionedBox following the trailingSpaceMidpoint properly stops and starts
+ // ignoring spaces.
+ size_t currentMidpoint = trailingSpaceMidpoint + 1;
+ for (size_t i = 0; i < m_boxes.size(); ++i) {
+ if (currentMidpoint >= lineMidpointState.numMidpoints) {
+ // We don't have a midpoint for this box yet.
+ lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_boxes[i]);
+ } else {
+ ASSERT(lineMidpointState.midpoints[currentMidpoint].renderer() == m_boxes[i]);
+ ASSERT(lineMidpointState.midpoints[currentMidpoint + 1].renderer() == m_boxes[i]);
+ }
+ currentMidpoint += 2;
+ }
+ } else if (!lBreak.renderer()) {
+ ASSERT(m_whitespace->isText());
+ ASSERT(collapseFirstSpace == CollapseFirstSpace);
+ // Add a new end midpoint that stops right at the very end.
+ unsigned length = m_whitespace->textLength();
+ unsigned pos = length >= 2 ? length - 2 : UINT_MAX;
+ InlineIterator endMid(0, m_whitespace, pos);
+ lineMidpointState.startIgnoringSpaces(endMid);
+ for (size_t i = 0; i < m_boxes.size(); ++i)
+ lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_boxes[i]);
+ }
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderinglineTrailingObjectsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/line/TrailingObjects.h (0 => 160135)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/TrailingObjects.h         (rev 0)
+++ trunk/Source/WebCore/rendering/line/TrailingObjects.h        2013-12-04 23:21:42 UTC (rev 160135)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All right reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2013 ChangSeok Oh <shivamidow@gmail.com>
+ * Copyright (C) 2013 Adobe Systems Inc. All right reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TrailingObjects_h
+#define TrailingObjects_h
+
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class InlineIterator;
+class RenderBoxModelObject;
+class RenderText;
+
+struct BidiRun;
+
+template <class Iterator, class Run> class BidiResolver;
+template <class Iterator> class MidpointState;
+typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver;
+typedef MidpointState<InlineIterator> LineMidpointState;
+
+class TrailingObjects {
+public:
+ TrailingObjects()
+ : m_whitespace(0)
+ { }
+
+ void setTrailingWhitespace(RenderText* whitespace)
+ {
+ ASSERT(whitespace);
+ m_whitespace = whitespace;
+ }
+
+ void clear()
+ {
+ m_whitespace = 0;
+ m_boxes.shrink(0); // Use shrink(0) instead of clear() to retain our capacity.
+ }
+
+ void appendBoxIfNeeded(RenderBoxModelObject* box)
+ {
+ if (m_whitespace)
+ m_boxes.append(box);
+ }
+
+ enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace };
+
+ void updateMidpointsForTrailingBoxes(LineMidpointState&, const InlineIterator& lBreak, CollapseFirstSpaceOrNot);
+
+private:
+ RenderText* m_whitespace;
+ Vector<RenderBoxModelObject*, 4> m_boxes;
+};
+
+}
+
+#endif // TrailingObjects_h
</ins></span></pre>
</div>
</div>
</body>
</html>